From 59e9889a875a86821931814b024fab57aff37081 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 2 Mar 2012 13:59:44 +0100 Subject: [PATCH 1/1] Bug 7470: Babeltheque integration 3 features: - adds social network information in search results - adds babeltheque data in opac-detail - adds social network links in opac-detail too (google+, twitter, mail and co.) --- C4/SocialData.pm | 129 +++++++++++++++++ installer/data/mysql/kohastructure.sql | 16 ++ installer/data/mysql/sysprefs.sql | 4 + installer/data/mysql/updatedatabase.pl | 30 ++++ .../admin/preferences/enhanced_content.pref | 6 + .../en/modules/admin/preferences/searching.pref | 7 + koha-tmpl/opac-tmpl/prog/en/css/opac.css | 150 ++++++++++++++++++++ .../opac-tmpl/prog/en/includes/opac-bottom.inc | 4 - koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 59 ++++++-- .../opac-tmpl/prog/en/modules/opac-results.tt | 20 +++ koha-tmpl/opac-tmpl/prog/images/Star0.gif | Bin 0 -> 1360 bytes koha-tmpl/opac-tmpl/prog/images/Star1.gif | Bin 0 -> 1395 bytes koha-tmpl/opac-tmpl/prog/images/Star2.gif | Bin 0 -> 1410 bytes koha-tmpl/opac-tmpl/prog/images/Star3.gif | Bin 0 -> 1391 bytes koha-tmpl/opac-tmpl/prog/images/Star4.gif | Bin 0 -> 1380 bytes koha-tmpl/opac-tmpl/prog/images/Star5.gif | Bin 0 -> 1284 bytes koha-tmpl/opac-tmpl/prog/images/bonus.png | Bin 0 -> 1768 bytes .../opac-tmpl/prog/images/socnet/delicious16.gif | Bin 0 -> 89 bytes .../opac-tmpl/prog/images/socnet/facebook16.png | Bin 0 -> 727 bytes .../opac-tmpl/prog/images/socnet/linkedin16.png | Bin 0 -> 751 bytes .../opac-tmpl/prog/images/socnet/mailto16.png | Bin 0 -> 792 bytes .../opac-tmpl/prog/images/socnet/twitter16.png | Bin 0 -> 780 bytes .../cronjobs/social_data/get_report_social_data.pl | 16 ++ misc/cronjobs/social_data/update_social_data.pl | 16 ++ opac/opac-detail.pl | 7 + opac/opac-search.pl | 19 +++- 26 files changed, 466 insertions(+), 17 deletions(-) create mode 100644 C4/SocialData.pm create mode 100644 koha-tmpl/opac-tmpl/prog/images/Star0.gif create mode 100644 koha-tmpl/opac-tmpl/prog/images/Star1.gif create mode 100644 koha-tmpl/opac-tmpl/prog/images/Star2.gif create mode 100644 koha-tmpl/opac-tmpl/prog/images/Star3.gif create mode 100644 koha-tmpl/opac-tmpl/prog/images/Star4.gif create mode 100644 koha-tmpl/opac-tmpl/prog/images/Star5.gif create mode 100644 koha-tmpl/opac-tmpl/prog/images/bonus.png create mode 100644 koha-tmpl/opac-tmpl/prog/images/socnet/delicious16.gif create mode 100644 koha-tmpl/opac-tmpl/prog/images/socnet/facebook16.png create mode 100644 koha-tmpl/opac-tmpl/prog/images/socnet/linkedin16.png create mode 100644 koha-tmpl/opac-tmpl/prog/images/socnet/mailto16.png create mode 100644 koha-tmpl/opac-tmpl/prog/images/socnet/twitter16.png create mode 100644 misc/cronjobs/social_data/get_report_social_data.pl create mode 100644 misc/cronjobs/social_data/update_social_data.pl diff --git a/C4/SocialData.pm b/C4/SocialData.pm new file mode 100644 index 0000000..e8bca90 --- /dev/null +++ b/C4/SocialData.pm @@ -0,0 +1,129 @@ +package C4::SocialData; + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use Modern::Perl; +use C4::Context; +use Business::ISBN; +use C4::Koha; + +=head2 get_data + +Get social data from a biblio + +params: + $isbn = isbn of the biblio (it must be the same in your database, isbn given to babelio) + +returns: + this function returns an hashref with keys + + isbn = isbn + num_critics = number of critics + num_critics_pro = number of profesionnal critics + num_quotations = number of quotations + num_videos = number of videos + score_avg = average score + num_scores = number of score +=cut +sub get_data { + my ( $isbn ) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare( qq{SELECT * FROM social_data WHERE isbn = ? LIMIT 1} ); + $sth->execute( $isbn ); + my $results = $sth->fetchrow_hashref; + + return $results; +} + +=head 2 + +Update Social data + +params: + $url = url containing csv file with data + +data separator : ; (semicolon) +data order : isbn ; active ; critics number , critics pro number ; quotations number ; videos number ; average score ; scores number + +=cut +sub update_data { + my ( $output_filepath ) = @_; + + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare( qq{INSERT INTO social_data ( + `isbn`, `num_critics`, `num_critics_pro`, `num_quotations`, `num_videos`, `score_avg`, `num_scores` + ) VALUES ( ?, ?, ?, ?, ?, ?, ? ) + ON DUPLICATE KEY UPDATE `num_critics`=?, `num_critics_pro`=?, `num_quotations`=?, `num_videos`=?, `score_avg`=?, `num_scores`=? + } ); + + open( FILE, $output_filepath ) or die "File $output_filepath can not be read"; + my $sep = qq{;}; + my $i = 0; + my $unknown = 0; + while ( my $line = ) { + my ( $isbn, $active, $num_critics, $num_critics_pro, $num_quotations, $num_videos, $score_avg, $num_scores ) = split $sep, $line; + next if not $active; + eval { + $sth->execute( $isbn, $num_critics, $num_critics_pro, $num_quotations, $num_videos, $score_avg, $num_scores, + $num_critics, $num_critics_pro, $num_quotations, $num_videos, $score_avg, $num_scores + ); + }; + if ( $@ ) { + warn "Can't insert $isbn ($@)"; + } else { + $i++; + } + } + say "$i data insered or updated"; +} + +=head 2 + +Get social data report + +=cut +sub get_report { + my $dbh = C4::Context->dbh; + + my $sth = $dbh->prepare( qq{ + SELECT biblionumber, isbn FROM biblioitems + } ); + $sth->execute; + my %results; + while ( my ( $biblionumber, $isbn ) = $sth->fetchrow() ) { + push @{ $results{no_isbn} }, { biblionumber => $biblionumber } and next if not $isbn; + my $original_isbn = $isbn; + $isbn =~ s/^\s*(\S*)\s*$/$1/; + $isbn = GetNormalizedISBN( $isbn, undef, undef ); + $isbn = Business::ISBN->new( $isbn ); + next if not $isbn; + eval{ + $isbn = $isbn->as_isbn13->as_string; + }; + next if $@; + $isbn =~ s/-//g; + my $social_datas = C4::SocialData::get_data( $isbn ); + if ( $social_datas ) { + push @{ $results{with} }, { biblionumber => $biblionumber, isbn => $isbn, original => $original_isbn }; + } else { + push @{ $results{without} }, { biblionumber => $biblionumber, isbn => $isbn, original => $original_isbn }; + } + } + return \%results; +} + +1; + diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 153e17b..0018594 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2710,6 +2710,22 @@ CREATE TABLE `biblioimages` ( CONSTRAINT `bibliocoverimage_fk1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- +-- Table structure for table `social_data` +-- + +DROP TABLE IF EXISTS `social_data`; +CREATE TABLE IF NOT EXISTS `social_data` ( + `isbn` VARCHAR(30), + `num_critics` INT, + `num_critics_pro` INT, + `num_quotations` INT, + `num_videos` INT, + `score_avg` DECIMAL(5,2), + `num_scores` INT, + PRIMARY KEY (`isbn`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index b86d198..eeb94bb 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -352,3 +352,7 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences` (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelayCharge', '0', NULL , 'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.', 'free') INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RoutingListNote','To change this note edit RoutlingListNote system preference.','Define a note to be shown on all routing lists','70|10','Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPKIAuth','None','Use the field from a client-side SSL certificate to look a user in the Koha database','None|Common Name|emailAddress','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('Babeltheque_url_js','','Url for Babeltheque javascript (e.g. http://www.babeltheque.com/bw_XX.js)','','Free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('Babeltheque_url_update', '', 'Url for Babeltheque update (E.G. http://www.babeltheque.com/.../file.csv.bz2)', '', 'Free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SocialNetworks','1','Enable/Disable social networks links in opac detail pages','','YesNo'); + diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a97ccda..769bf02 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4932,6 +4932,36 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } + + + + +$DBversion = "3.07.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do( qq{INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Babeltheque_url_js','','Url for Babeltheque javascript (e.g. http://www.babeltheque.com/bw_XX.js','','Free')} ); + $dbh->do( qq{CREATE TABLE IF NOT EXISTS `social_data` + ( `isbn` VARCHAR(30), + `num_critics` INT, + `num_critics_pro` INT, + `num_quotations` INT, + `num_videos` INT, + `score_avg` DECIMAL(5,2), + `num_scores` INT, + PRIMARY KEY (`isbn`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 + } ); + $dbh->do( qq{INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('Babeltheque_url_update', '', 'Url for Babeltheque update (E.G. http://www.babeltheque.com/.../file.csv.bz2)', '', 'Free')} ); + print "Upgrade to $DBversion done (added syspref and table for babeltheque (Babeltheque_url_js, babeltheque))\n"; + SetVersion($DBversion); +} + +$DBversion = "3.07.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do( qq{INSERT IGNORE INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SocialNetworks','1','Enable/Disable social networks links in opac detail','','YesNo')} ); + print "Upgrade to $DBversion done (added syspref Social_networks)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref index f5828ae..bb3bc2d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref @@ -103,6 +103,12 @@ Enhanced Content: yes: Do no: "Don't" - include information (such as reviews and citations) from Babelthèque in item detail pages on the OPAC. + - + - pref: Babeltheque_url_js + - Defined the url for the Babeltheque javascript file (eg. http://www.babeltheque.com/bw_XX.js) + - + - pref: Babeltheque_url_update + - Defined the url for the Babeltheque update periodically (eq. http://www.babeltheque.com/.../file.csv.bz2). Baker and Taylor: - - pref: BakerTaylorEnabled diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index f4b02cc..bb48cb4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -69,6 +69,13 @@ Searching: yes: Include no: "Don't include" - subdivisions for searches generated by clicking on subject tracings. + - + - pref: SocialNetworks + default: 0 + choices: + yes: Enable + no: Disable + - Enable/Disable social network links in opac detail pages Search Form: - - Show tabs in OPAC and staff-side advanced search for limiting searches on the diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 1a8c6b1..b97dd1e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -2299,3 +2299,153 @@ p.patronimage.edit { border-color:#E8E8E8; margin: 1em 1em 1em 0; } + +/* ## BABELTHEQUE ## */ +/* Uncomment if babeltheque configuration no contains these lines */ +/* +#BW_etiquettes { + clear :left; + border: 1px solid #E8E8E8; + margin-top: 10px; + width: 49%; + float: left; + visibility: hidden; + visibility: visible\9; +} +#BW_etiquettes:not(:empty) { + visibility: visible; +} + +#BW_etiquettes h2 { + clear:left; + background-color: #E8E8E8; + margin: 5px 10px; + padding: 0 5px; +} + +#BW_ulEti {max-width:100%;} + +#BW_ulEti ul { + margin:0; + padding:0 15px; + list-style-type: none; +} + +#BW_ulEti a { + text-decoration: none; +} + +#BW_ulEti a.tag_s0 {font-weight: 120;font-size:0.8em;} +#BW_ulEti a.tag_s1 {font-weight: 150;font-size:0.9em;} +#BW_ulEti a.tag_s2 {font-weight: 180;font-size:1.0em;} +#BW_ulEti a.tag_s3 {font-weight: 200;font-size:1.2em;} +#BW_ulEti a.tag_s4 {font-weight: 220;font-size:1.4em;} +#BW_ulEti a.tag_s5 {font-weight: 230;font-size:1.5em;} +#BW_ulEti a.tag_s6 {font-weight: 320;font-size:1.6em;} +#BW_ulEti a.tag_s7 {font-weight: 350;font-size:1.7em;} +#BW_ulEti a.tag_s8 {font-weight: 400;font-size:1.8em;} +#BW_ulEti { padding: 0px; line-height: 2em; text-align: center;} +#BW_ulEti a { padding: 2px; } +#BW_ulEti { margin: 0px; } + +#BW_ulEti ol { + float:left; + display: inline; + margin: 0 10px; +} + +#BW_suggestions { + border: 1px solid #E8E8E8; + margin-top: 10px; + float: right; + width: 49%; + visibility: hidden; + visibility: visible\9; +} +#BW_suggestions:not(:empty) { + visibility: visible; +} +#BW_suggestions h2 { + background-color: #E8E8E8; + margin: 5px 10px; + padding: 0 5px; +} +#BW_suggestions .BW_livres_tag_page { + padding: 0 15px; +} +#BW_suggestions .BW_livres_tag_page:before { + content : '> '; +} +#BW_droite .BW_livres_tag:before { + content : '> '; +} + +#BW_videos { + clear : both; + border: 1px solid #E8E8E8; + padding-bottom: 140px; + margin-top: 10px; + max-width: 100%; + visibility: hidden; + visibility: visible\9; +} + +#BW_videos:not(:empty) { + visibility: visible; +} + +#BW_videos h2 { + background-color: #E8E8E8; + margin: 5px 10px; + padding: 0 5px; +} +#BW_videos .BW_bloc_vid { + clear: both; + padding: 0 15px; +} +.BW_vignette_vid { + border: 1px solid #DFD9CE; + float: left; + height: 141px; + margin: 5px; + min-height: 141px; + padding: 5px; + white-space: nowrap; +} + +#BW_notes {clear :left;} +#BW_notes h2 {font-size:85%;} + +#BW_citations {} +#BW_citations h2 {font-size:85%;} + +#BW_critiques {} +#BW_critiques h2 {font-size:85%;} + +#BW_critiques_pro {} +#BW_critiques_pro h2 {font-size:85%;} + +#BW_citations,#BW_critiques,#BW_critiques_pro { + background: -moz-linear-gradient(center top , #3399FF, #3333FF) repeat scroll 0 0 transparent; + background: -webkit-gradient(linear, center top, center bottom, from(#3399FF), to(#3333FF)); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#3399FF', endColorstr='#3333FF'); + border: 1px solid #B7B7B7; + border-radius: 5px 5px 5px 5px; + color: #FFFFCC; + display: inline-block; + float: left; + font-weight: bold; + margin: 15px 20px 15px 0; + min-width: 150px; + padding: 0 15px 8px; + position: relative; + text-align: center; + text-shadow: 1px 1px 1px #777777; + white-space: nowrap; +} + +#BW_citations a,#BW_critiques a,#BW_critiques_pro a { + color: #FFFFCC; +} + +*/ diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc index 46e195d..66e26c1 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc @@ -55,9 +55,5 @@ [% END %] -[% IF ( Babeltheque ) %] - -[% END %] - diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 7af60a0..99e8b94 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -1,6 +1,11 @@ [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %] [% INCLUDE 'doc-head-close.inc' %] + + + [% END %] + +[% IF ( Babeltheque ) %] + +[% END %] + [% INCLUDE 'opac-bottom.inc' %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt index 60f1ae8..3b9e838 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -390,6 +390,9 @@ $(document).ready(function(){ [% IF ( SEARCH_RESULT.imageurl ) %] [% SEARCH_RESULT.description %] [% END %] + [% IF ( SEARCH_RESULT.score_avg ) %] + + [% END %] [% END %] [% END %] @@ -478,6 +481,23 @@ $(document).ready(function(){ [% END %] + [% IF ( SEARCH_RESULT.score_avg ) %] + + [% SEARCH_RESULT.score_avg %] / 5 (on [% SEARCH_RESULT.num_scores %] rates) + [% IF ( SEARCH_RESULT.num_critics ) %] + + [% END %] + [% IF ( SEARCH_RESULT.num_critics_pro ) %] + + [% END %] + [% IF ( SEARCH_RESULT.num_videos ) %] + + [% END %] + [% IF ( SEARCH_RESULT.num_quotations ) %] + + [% END %] + + [% END %] [% IF ( LibraryThingForLibrariesID ) %]
[% END %] [% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %] [% IF ( TagsShowOnList ) %] diff --git a/koha-tmpl/opac-tmpl/prog/images/Star0.gif b/koha-tmpl/opac-tmpl/prog/images/Star0.gif new file mode 100644 index 0000000000000000000000000000000000000000..44ffdf488560eebbf1f8a5db485fabe581db9625 GIT binary patch literal 1360 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 literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/Star4.gif b/koha-tmpl/opac-tmpl/prog/images/Star4.gif new file mode 100644 index 0000000000000000000000000000000000000000..473cb32087da78d40ebd8968a542b0bc50b76c55 GIT binary patch literal 1380 zcmW+#dr*{B6u;;yU^Oz@IOQ-9g-8-ibsKQoz!7PYkjJPLBacyos}4kg;ZpWcUW$!^ zNyH@u9Yeqwlu|-eQrbYl%fnD?f<%Eua9bX+kdbox-M#;vIp_Rd=lg;~^eeSn63DaU zA3~&hLP{R) zF|Ywm)QQwI+NkjeE`}iC545N#Q6GoO)pl>yw4G4JY`cn@wFRwGw`HeRZE>h0*c>V( zn`m_tn+^qRgU088D;?r-|5#)XSBoT0`44j?fh!7*z*)VeYbx#b}&j_fd-=f3E}|Lj?Qaq zjyGmGEM5_Nz2<~*pVLe499{cE|F5Zw8^Z=YQk|RkyXd~ij!qdgelW+q$jji<-&(Zr zT0^!&ipg((Z_Sp0N8`PIADLg6(X6m;>nzs0Ex2CfU2fcIy1F;XQ0TU?YGaxH*rxRR zb=8(ut!Vl9L16xSEqS5A5%HHZ9B%5PZghLcX1QD|kL#JX#AV+5xm6Qf=dCkXo=)q^ zT@>S+96B$#tGPO+G4<}%^qzG-N9%WvJ-mNud56ntQKH>F-@D}e$lgjngZZ)6I{cfa zA+adzyD7^R`IDB-WW>CGY>sBTS4MkJa%yQ?RhIoi*Oa05+xoKjCvP?mb<}N;b+aX# z>;LL(3vnImK0Zzg4n}mJdgkx6tjJ3_lcJ&2Fk~9O=9)hHjs5XG=Ee=1W9>%2y_ae4 zc&9Mcdb=Vv(Cl=|#qj94?UA{I$tz3u&D-m_HQjwtP=2oCuF6i|rl{z?&mC)zglA6n z8ao1g`zucdnyuI44(U9shYD_)Jo5t++A6}*-g0w~&<(}pC zRy4jnFETpr>rWyM%r$9vc(bFEY4ybABkekCZ`Q(q|Ewn?j~RyQx0QYQM_xtgXEWT% zKX*av@?!hLInHT2mu`GeGCgk0_n+}R&{;m6aB)XP&eqc}SCqQAcj%ISG`3e(EnS`9 zmiXtZ9uLY+EV-4x>cXcNlFn+TCX)g`tX~ruV0HGPw WB{>D$+-0`Z-OKe#Id5l2bpHd;>%uJn literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/Star5.gif b/koha-tmpl/opac-tmpl/prog/images/Star5.gif new file mode 100644 index 0000000000000000000000000000000000000000..0a61173924a33b422e21e9d649b9f50b36321465 GIT binary patch literal 1284 zcmW+#eN2^A7(XnUkaYoX)3$;IMA*A3^Fe#`ML^ZjPoJ-Cmr;-yj%YTw~M5L5`FXi;%4I1`)-PLv8X85fKRMg=2E z6lN(GlnF`&CD4dfLAW4H5Gn{*p&DQi4V93E9*BVrXkcNPC_}2oW1LgYiSh?pRE%*( zIU~w0RG>*2r<79y_Yj3yP8cVY6WBu@kcn-?0sjyIhfobLh=xjxLI;R}4QOBym7Hp$ z#-of86(szD78Rw8666ZIP=O{Rlo8~Jq!9pgVH`ojEuusokcn-?0ZlLrhfobLh{h&l zK?jI|4QQfHq^8kEjYn`X1POnjMMa7FI8?5#d#k4Fgeqp&Rn)92XqCDvJGJVHLmk28 zP$9WQtDCrVC}0;fJ_lS0;lUHA=10<|`?fl7CC?3~&h!M&UJKK@Ua|ic<-B2;x|Z;7 z-%jVBNmHGM=_@9OZQZO$nC*RYvORG0^18{cSEsLTn`rT~HwN6PGmSI`Pqc<>1 zU)WS%)p5i_Z%XN|ueKF=2X6j$Q^T3Aw43ow{aUce_VJYEOWT`=wF4)*Z;6))$27OU&Uo;+4j!Q6FYL^ zjb472^E?`K{a5=}4<6aud}8WB=;WpI$u}!Q%X2Rz{dBV_V`!;0Ir6~d_?RuP#IGYO ze<9QHFns3k&LX{YZt1Qydu&hmI8NOj3>g()tk|A=u(j&ayMs*+R+iPBYCCw^vodiw zBgZk&u;lk0yRFUp2g}oI#;2aodvDmbf8pn69=&}%qh+YMqAWQ#LhJc%drYQp+qAtu zCv~JmSK0RA^o1Vd8{xW?`GIlIi+QP0sgDYrcZPPB|MK6Vg2!tYPH%7=bMB71KhyYH z!4kudRRwncb5(IqTeKICdT%yX$IX0tz#8c|pH^aC5zseM^ z)0OVKpRMZb_BU(wfnL#zqm3mo=K1?+rSZ${fu(WFxOY@kaB=NPgC&38$*0x dSba#BtyLDYQLU!bVzSqMx#OMhH@LYG^Z&S!h!y|< literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/bonus.png b/koha-tmpl/opac-tmpl/prog/images/bonus.png new file mode 100644 index 0000000000000000000000000000000000000000..663a31d6601ceadf7565160923eaa6690de8ed42 GIT binary patch literal 1768 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%xRe+5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8hm3bwJ6}oxF$}kgLQj3#|G7CyF^YauyCMG83 zmzLNn0bL65LT-VtFWlg~VrW1CgG|37u|VHY&pf(~1RD?6IsxA(xEJ)Q4 zN-fSWElLK)N18HBGcfG%TLe-Fbd8mNQ6?}_5_4SglS^|`^GZBjY?XjAdMTMHR)&U7 zF2;@)&L)N~My>{ih8C_a#+F9ru11c=ZU&|<#xOIm>2XL&K>`K=X2e?wH%5XlY89!SKiOR zoD#JB;f21MYdL)@;^qhJzN>!w-_)1&j43a7?2ZSmlxda zfAp>-4P*V`Dfy!#;43Yv2l56%teJC z_Xu!%zL_&;k0(2e!l|UhiT`C}_xiFi6^9&jk(u%Nvv_x-#{3m-J5xC?X0430^*`Hj zNr8{=UU-_&b>L^HAuNr2!5Zeus(ClQl~3CCXOg#NnVH<`xsN2XHCVVAm>7;94{Q^9C15-4 z+ZzW5bMEE_28k8NjgRe-6id1FMX>pIrjfavtPRg#}$V+$=iCriC8iv zMY^n8{mEUBu`SZ_SrU6yVsZfgtc`4M=cqp9jz~6h-tuC?+ZA3PV?LZ=VaZRAZ;0Pu zc|)=Eq1L_GC(0Zc4JS*@XfV*05nQuFN317hS+|_m$32w~8kVg*#daWP&fL8{W^QWQ zF~&P;rl+?>m@RU+AT#r?*7Ubpzr##kZM4{R_ z{1dM*sejJ$seV6IAzjy85}S Ib4q9e0NACF1poj5 literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/socnet/delicious16.gif b/koha-tmpl/opac-tmpl/prog/images/socnet/delicious16.gif new file mode 100644 index 0000000000000000000000000000000000000000..11682e826fc90c534475d4259d6c2ad1e3fb7794 GIT binary patch literal 89 zcmZ?wbhEHb6krfwn8*ME|NsBLd-pDoR{Y5V7SI8aAbAERt)BeFt2@rzY4ldJ$~kbe j=x?Qj!?Yz0%T{Er(u&@tS#yes_lEh}$F}*}3=Gx)?P(tN literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/socnet/facebook16.png b/koha-tmpl/opac-tmpl/prog/images/socnet/facebook16.png new file mode 100644 index 0000000000000000000000000000000000000000..1176590b3ee947b67fa2f7c6d7fc7b9754a69972 GIT binary patch literal 727 zcmV;|0x127P)003>6 z003>600000003>600000003>600000003>6NBc_+0007VNklsQ?dpl|oN1>3jxT?+!gU##VSVH_7R@_uM|{Mh}= zCti4PAn5Pke0}B8#ru*ZLiM-9e~D*OL8-K6es|a1(Sv7pdKfd=^6C>m>Jf1| zQS}OAbux^wK?nK|Kvq}|?OD&^y?w2{*Kfb^VW>eonc_iC7^W1~Z3n1gMOe4I2EfzT zpLy_XfWa?ynsGrU1zsM(*hIoCarwhR6pSJ8-IgzJ-jDF;`5-0VB}tXEDL6h5MFsUn zOcEaP;6Nu3S9A+-e8)MuGrdK3y-jLS87wfH4LU#rIrP z6*E0RgCR)^e$-=drgTngz6vTJ7HpxYz(h0UsC8yE%P`t6q-KYf$Yu_lgjegRCY z#-AYqVU%I*R5nhFsn%rXg@6Y>g#{x5e_<3rwB@ZTSWyZqI4FXHx41UjS-r02*qna? zRFxp`0GQWZVeP6KCEumo(a9J8lj9}hAIG+??`?E;b@xVb+}4H_VNSIZfMrX1*s*09 z9pw^%2lob|ukP^hK%-QuxIOcFH=>2HS&~WqYZZBtWm%MsjErZ4LnB!jhPl`zdj9m` zts7S_T$=eh6=2t_ISUqoZSylq1ZyqjvWxHgCJMtzn}v^o;h+1ROLuju17`pL002ov JPDHLkV1hJ+L6-mk literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/socnet/linkedin16.png b/koha-tmpl/opac-tmpl/prog/images/socnet/linkedin16.png new file mode 100644 index 0000000000000000000000000000000000000000..2a195c2b7682bf66b118b08bc019bbb297c550ac GIT binary patch literal 751 zcmV003>6 z003>600000003>600000003>600000003>6NBc_+0007tNkl+ zn_!`i`LJ|m^1d_ke&6SDF_Tusdf>q2;oP(O9RcXR`N31CUtRyC<^3C`fqzQ?JA6Aw zZEWq|-G96H@x>nnE;Khkym;lz>dI!w(g(r+lb@U8_k(2b`qghX{QS9-&vaXUV{m^+ zP$j5Q1!c}VoXCGSSW2hcS)PBqyXiwd=_aF8bgoGql;aB>US2!F_uD%RCpnMmAQ<&H zKH{a$Z8S~^O(QQ$F1)bHyRWaaGl<#V?bGlPBA{wGC&;YPikc!T@BpJEr*1>gz?B!RYUS+7C9d7-@&4tjBzZ|0pw2QJK$Ydh@rZOZq1A{uar7}TWue{V>EnxB{`x1r zxN)0vXHN0#$|A`irWj8^by|QLR+VU$QB_k8vb>-UfnGo1)31Ku^XtC?5Q$+$foVXs z!jl3TFcnZkW+YTqg_>e!AOSbKn<}OXGvFLB4QZI#bVi>|2{e1~X`0iAIaQ={_N`Z1 zr(e8=&_V-8mlinn?j61u1vQdgOn&i8;E_rL0B7#_` zL16Ibkp5mDi5$NT6ATdVNaHcT3=$-AAOhlW&Wp>oZ}!b}D9!eCGLayS2%LbA5FbtF zf9nG*X$`r0CuJEdBY*j}A%i0vj~C%YR$$ hqa;-M7{a%}{$IHtX7n4~n=$|Z002ovPDHLkV1g_(Te<)M literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/socnet/mailto16.png b/koha-tmpl/opac-tmpl/prog/images/socnet/mailto16.png new file mode 100644 index 0000000000000000000000000000000000000000..d8e4a5ad20489ece6a0d152dadb117c7b013bbcd GIT binary patch literal 792 zcmV+z1LypSP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipt{ z4jVOgtWhHX00NjvL_t(I%dM2VN^5NphM!ppIU|B3xD@OxG$|C3fK5b1LA(GPEyTi0 z@E)wR6YR9HH%%mvU}qXpgxDykXw-;Cv$77jGP~IPvh%yy=Yg-B=X>X!myyTE$A_Mt zo}{YsFG@ssetv!o77B%AI-S;`p&@Cv+kXW$41@FYb3HjZNy^jHlkV*7FflPfCX>N+ zT}0%!fT~I;6rx(KQZAQST3SLZ%TmX2SYKZ!m&-9WHpcHNHw=U0<6{bi0&8n)M59rp z(P*gax~M9_6bgNOCbe2kTdh{dR?Fowr>CbZEG*#r{&%5) zK!ClyJ<{nklarHto2pnWhFn}+Xsgxg7~3!mip3%i4-e#WIe-t}4Z}c0D3wa2QYogU zraGXi`W1Y3cBai{^OK(-6>YkuZw9B&v$45{*U)Hk(a6&qG9LG#U&H3@|!6itqbB zjhl!tGBSdya(Q`4cXv0citqab-`?JET^Gx;Fin$8Cd0SZ{7MZE5A*W!!p+SMi9~{M zI85;N_7=;s7#|;JaBz_O`};pSK&-2LV^Lzo0 WgKAw8mt9H#0000f@- literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/socnet/twitter16.png b/koha-tmpl/opac-tmpl/prog/images/socnet/twitter16.png new file mode 100644 index 0000000000000000000000000000000000000000..ccb1b618963c52a441bd2b059fae90346ffd97ab GIT binary patch literal 780 zcmV+n1M~ceP)003>6 z003>600000003>600000003>600000003>6NBc_+0007~NklK zv}00jLXys8a_`K%|DMOiO@&ZA@GPGnhr>Ar;O550*(>KSd{Pv}t1%@W$#7B%$CN*WbEy>5hHv`t|0@(z#EU`U}@4RRy_4RBM1Sk3j$$?e^uS%9n3{_4S%P_w=*R zjZPD6r5dXk;1t&XZIhgH*vY*KRN7uDoVPM+coM%uF*g#FSX>cDUG`XDWuJ z){NVG504>+%+#&`#5oQ}!+D!h(sJgBj%o|R*$TJ=jUOeG2;7wb}`0~t5C&&4H1TulCDuy z6%`>090ho169gp*ywHOiD_tc0%_Js>0be_aOr0ZV zzpRKNU@ajAEPxLYVTPz6qByCa-dr}EX&y%}f%oogGO8-_EF%{o#z+K0W&Km9R#g-Y&S~(T7`#dG#Ays( zybt1hb??X9pRa%X;Rla)(gD_ret$8q_w>I?IVMadCEkAr?EDKQX`=G4-NZKl0000< KMNUMnLSTZKHeIX$ literal 0 HcmV?d00001 diff --git a/misc/cronjobs/social_data/get_report_social_data.pl b/misc/cronjobs/social_data/get_report_social_data.pl new file mode 100644 index 0000000..7069e24 --- /dev/null +++ b/misc/cronjobs/social_data/get_report_social_data.pl @@ -0,0 +1,16 @@ +#!/bin/perl + +use Modern::Perl; +use C4::SocialData; + +my $results = C4::SocialData::get_report; + +say "==== Social Data report ===="; +say "Matched : (" . scalar( @{ $results->{with} } ) . ")"; +say "biblionumber = $_->{biblionumber},\toriginal = $_->{original},\tisbn = $_->{isbn}" for @{ $results->{with} }; + +say "No Match : (" . scalar( @{ $results->{without} } ) . ")"; +say "biblionumber = $_->{biblionumber},\toriginal = $_->{original},\tisbn = $_->{isbn}" for @{ $results->{without} }; + +say "Without ISBN : (" . scalar( @{ $results->{no_isbn} } ) . ")"; +say "biblionumber = $_->{biblionumber}" for @{ $results->{no_isbn} }; diff --git a/misc/cronjobs/social_data/update_social_data.pl b/misc/cronjobs/social_data/update_social_data.pl new file mode 100644 index 0000000..53058a7 --- /dev/null +++ b/misc/cronjobs/social_data/update_social_data.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +use Modern::Perl; +use C4::Context; +use C4::SocialData; + +my $url = C4::Context->preference( "Babeltheque_url_update" ); +my $output_dir = qq{/tmp}; +my $output_filepath = qq{$output_dir/social_data.csv}; +system( qq{/bin/rm -f $output_filepath} ); +system( qq{/bin/rm -f $output_dir/social_data.csv.bz2} ); +system( qq{/usr/bin/wget $url -O $output_dir/social_data.csv.bz2 } ) == 0 or die "Can't get bz2 file from url $url ($?)"; +system( qq{/bin/bunzip2 $output_dir/social_data.csv.bz2 } ) == 0 or die "Can't extract bz2 file ($?)"; + + +C4::SocialData::update_data $output_filepath; diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 27684d4..096c6f0 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -836,9 +836,16 @@ $template->param(NovelistSelectView => C4::Context->preference('NovelistSelectVi if ( C4::Context->preference("Babeltheque") ) { $template->param( Babeltheque => 1, + Babeltheque_url_js => C4::Context->preference("Babeltheque_url_js"), ); } +# Social Networks +if ( C4::Context->preference( "SocialNetworks" ) ) { + $template->param( current_url => C4::Context->preference('OPACBaseURL') . "/cgi-bin/koha/opac-detail.pl?biblionumber=$biblionumber" ); + $template->param( SocialNetworks => 1 ); +} + # Shelf Browser Stuff if (C4::Context->preference("OPACShelfBrowser")) { # pick the first itemnumber unless one was selected by the user diff --git a/opac/opac-search.pl b/opac/opac-search.pl index eb9ee51..8dd9055 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -36,10 +36,11 @@ use C4::Biblio; # GetBiblioData use C4::Koha; use C4::Tags qw(get_tags); use C4::Branch; # GetBranches +use C4::SocialData; use POSIX qw(ceil floor strftime); use URI::Escape; use Storable qw(thaw freeze); - +use Business::ISBN; my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold"); # create a new CGI object @@ -532,9 +533,23 @@ for (my $i=0;$i<@servers;$i++) { foreach (@newresults) { my $record = GetMarcBiblio($_->{'biblionumber'}); $_->{coins} = GetCOinSBiblio($record); + if ( C4::Context->preference( "Babeltheque" ) and $_->{normalized_isbn} ) { + my $isbn = Business::ISBN->new( $_->{normalized_isbn} ); + next if not $isbn; + $isbn = $isbn->as_isbn13->as_string; + $isbn =~ s/-//g; + my $social_datas = C4::SocialData::get_data( $isbn ); + next if not $social_datas; + for my $key ( keys %$social_datas ) { + $_->{$key} = $$social_datas{$key}; + if ( $key eq 'score_avg' ){ + $_->{score_int} = sprintf("%.0f", $$social_datas{score_avg} ); + } + } + } } } - + if ($results_hashref->{$server}->{"hits"}){ $total = $total + $results_hashref->{$server}->{"hits"}; } -- 1.7.7.3