Bug 19882: Add Novelist Select staff client profile
authorNick Clemens <nick@bywatersolutions.com>
Wed, 27 Dec 2017 13:18:26 +0000 (13:18 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 13 Apr 2018 16:24:34 +0000 (13:24 -0300)
This patchset allows for use of a separate Novelist profile for the
staff client and opac. This allows Novelist to determine links and
special styling for each. Testing is best with novelist credentials,
however, confirming that values are set and used correctly and nothing
is broken should suffice.

To test:
1 - Apply patches
2 - Update database
3 - View detail pages for some records on opac and staff client and ensure no changes have been
made
4 - Enable NovelistSelectStaffEnabled (and enter or have info in the Profile and password)
5 - Set NovelistSelectStaffView to 'above'
6 - View detail pages for some records, verify that if novelist info is
available it is displayed and nothing is displayed if not
7 - Repeat with all staff view options

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

installer/data/mysql/atomicupdate/bug_19882_Add_novelist_staff_client_profile.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

diff --git a/installer/data/mysql/atomicupdate/bug_19882_Add_novelist_staff_client_profile.perl b/installer/data/mysql/atomicupdate/bug_19882_Add_novelist_staff_client_profile.perl
new file mode 100644 (file)
index 0000000..4109085
--- /dev/null
@@ -0,0 +1,7 @@
+$DBversion = 'XXX';  # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('NovelistSelectStaffProfile',NULL,'Novelist staff client user Profile',NULL,'free')");
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 19882 - Add Novelist Staff Client Profile)\n";
+}
index 3fbb55b..d498841 100644 (file)
@@ -291,9 +291,10 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('NoticeCSS','',NULL,'Notices CSS url.','free'),
 ('NotifyBorrowerDeparture','30',NULL,'Define number of days before expiry where circulation is warned about patron account expiry','Integer'),
 ('NovelistSelectEnabled','0',NULL,'Enable Novelist Select content.  Requires Novelist Profile and Password','YesNo'),
-('NovelistSelectPassword','',NULL,'Enable Novelist user Profile','free'),
-('NovelistSelectProfile','',NULL,'Novelist Select user Password','free'),
+('NovelistSelectPassword','',NULL,'Novelist select user Password','free'),
+('NovelistSelectProfile','',NULL,'Novelist Select user Profile','free'),
 ('NovelistSelectStaffEnabled','0',NULL,'Enable Novelist Select content in the staff client.  Requires Novelist Profile and Password','YesNo'),
+('NovelistSelectStaffProfile','',NULL,'Novelist Select user Profile for staff client','free'),
 ('NovelistSelectStaffView','tab','tab|above|below','Where to display Novelist Select content in the staff client','Choice'),
 ('NovelistSelectView','tab','tab|above|below|right','Where to display Novelist Select content','Choice'),
 ('numReturnedItemsToShow','20',NULL,'Number of returned items to show on the check-in page','Integer'),
index ad27384..56f9c56 100644 (file)
@@ -98,7 +98,13 @@ Enhanced Content:
         -
             - Access Novelist Select using user profile
             - pref: NovelistSelectProfile
-            - and password
+            - on the opac
+        -
+            - Access Novelist Select using user profile
+            - pref: NovelistSelectStaffProfile
+            - on the staff client
+        -
+            - Access Novelist Select using password:
             - pref: NovelistSelectPassword
               class: password
             - .
index bc83056..ec6695c 100644 (file)
 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
 [% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
 [% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
-[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
+[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
     <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
 [% END %]
 </ul>
 
 <div id="holdings">
 
-[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
+[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
     <span class="results_summary NovelistSelect" style="display:none;">
         <span class="label">Novelist Select: </span>
         <div data-novelist-novelistselect=[% normalized_isbn %]></div>
     [% END %]
 [% END %]
 
-[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
+[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
     <span class="results_summary NovelistSelect" style="display:none;">
         <span class="label">Novelist Select: </span>
         <div data-novelist-novelistselect=[% normalized_isbn %]></div>
 [% END %]
 
 
-[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
+[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
     <div id="NovelistSelect" class="novelistSelect">
         <div data-novelist-novelistselect=[% normalized_isbn %]></div>
     </div>
             $("#marcPreview").on("hidden", function(){
                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
-            [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %]
+            [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
                 novSelect.loadContentForQuery({
                     ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]',
                     ISBN : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]',
                     version : '2.1'
                 },
-                '[% Koha.Preference('NovelistSelectProfile') %]',
+                '[% Koha.Preference('NovelistSelectStaffProfile') %]',
                 '[% Koha.Preference('NovelistSelectPassword') %]',
                 function(d){
                     if ( d.length > 0 ){ //If no content
             verify_images();
         });[% END %]
     </script>
-    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %]
+    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
         [% Asset.js("https://imageserver.ebscohost.com/novelistselect/ns2init.js") %]
     [% END %]
     [% INCLUDE 'datatables.inc' %]