Bug 11606: Add Novelist client to staff
authorNick Clemens <nick@bywatersolutions.com>
Fri, 27 May 2016 20:51:56 +0000 (16:51 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 22 Jul 2016 17:16:12 +0000 (17:16 +0000)
To test:
1 - Apply patches
2 - Update database
3 - View detail pages for some records 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 displyaed and nothign is displayed if not
7 - Repeat with all staff view options

Sponsored by:
   Walla Walla Public Library (http://www.wallawallapubliclibrary.org/)
   Los Gatos Library (http://www.losgatosca.gov/42/Los-Gatos-Library)

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Internal signoff.

Signed-off-by: Alexis Rodegerdts <arodegerdts@wallawallawa.gov>
Signed-off-by: Dwayne Nance <dnance@ebsco.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
installer/data/mysql/atomicupdate/Bug_11606_Add_NovelistSelect_Staff_Prefs.sql [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_11606_Add_NovelistSelect_Staff_Prefs.sql b/installer/data/mysql/atomicupdate/Bug_11606_Add_NovelistSelect_Staff_Prefs.sql
new file mode 100644 (file)
index 0000000..ee4f78c
--- /dev/null
@@ -0,0 +1,2 @@
+INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NovelistSelectStaffEnabled','0',NULL,'Enable  Novelist Select content to the Staff Interface (requires that you have entered in a user profile and password, which can be seen in image links)','YesNo'),
+('NovelistSelectStaffView','tab','tab|above|below','Where to display Novelist Select content','Choice');
index 4e947fd..46f89d5 100644 (file)
@@ -262,6 +262,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('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'),
+('NovelistSelectStaffEnabled','0',NULL,'Enable Novelist Select content in the staff client.  Requires Novelist Profile and Password','YesNo'),
+('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'),
 ('numSearchResults','20',NULL,'Specify the maximum number of results to display on a page of results','Integer'),
index ce8bee3..b72efda 100644 (file)
@@ -102,6 +102,20 @@ Enhanced Content:
             - pref: NovelistSelectPassword
               class: password
             - .
+        -
+            - pref: NovelistSelectStaffEnabled
+              choices:
+                  yes: Add
+                  no: "Don't add"
+            - Novelist Select content to the Staff client (requires that you have entered in a user profile and password, which can be seen in image links).
+        -
+            - Display Novelist Select staff content
+            - pref: NovelistSelectStaffView
+              choices:
+                  tab: in an OPAC tab
+                  above: above the holdings table
+                  below: below the holdings table
+            - .
     Google:
         -
             - pref: GoogleJackets
index e8de754..351dc6c 100644 (file)
     Details for [% title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %]
   [% END %]
 </title>
+
+[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
+    <script type="text/javascript" src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
+[% END %]
+
 [% INCLUDE 'doc-head-close.inc' %]<script type="text/JavaScript">
 //<![CDATA[
 // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
@@ -196,6 +201,22 @@ function verify_images() {
         $("#marcPreview").on("hidden", function(){
             $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
         });
+     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( 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('NovelistSelectPassword') %]',
+             function(d){
+                 if ( d.length > 0 ){ //If no content
+                     $(".NovelistSelect").show();
+                 }
+             });
+     [% END %]
+
     });
 
      [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
@@ -561,6 +582,9 @@ function verify_images() {
 [% 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' ) %]
+    <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
+[% END %]
 </ul>
 
 [% items_table_block_iter = 0 %]
@@ -823,6 +847,14 @@ function verify_images() {
 [% END %][%# end of block items_table %]
 
 <div id="holdings">
+
+[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && 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>
+    </span>
+[% END %]
+
 [% IF ( count ) %]
     [% IF ( showncount ) %]
         [% PROCESS items_table tab="holdings" items=itemloop %]
@@ -847,6 +879,13 @@ function verify_images() {
     <div id="noitems">No physical items for this record</div>
     [% END %]
 [% END %]
+
+[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && 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>
+    </span>
+[% END %]
     </div>
 
 [% IF (SeparateHoldings) %]
@@ -1054,6 +1093,12 @@ function verify_images() {
 [% END %]
 
 
+[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
+    <div id="NovelistSelect" class="novelistSelect">
+        <div data-novelist-novelistselect=[% normalized_isbn %]></div>
+    </div>
+[% END %]
+
 </div><!-- /bibliodetails -->
 
 <div class="yui-g" id="export" style="margin-top: 1em;">