Wrap up Tags integration - add sysprefs for new installs.
authorJoe Atzberger <joe.atzberger@liblime.com>
Sat, 31 May 2008 05:01:51 +0000 (00:01 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Sun, 1 Jun 2008 02:59:12 +0000 (21:59 -0500)
Note that when the user is not logged in, the Tags input box/button will not display.
The user will see a message telling them to log in to add tags.  However, in order to
keep the results display clean, the message will display only once, utilizing the loop
context variable "__first__".  Useful stuff!

I also threw OPACShelfBrowser sysprefs.sql, but it still needs added to updatedatabase.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl

index ab52bc5..93feea2 100644 (file)
@@ -185,8 +185,26 @@ INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALU
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo');
 
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RenewSerialAddsSuggestion','0','If ON, adds a new suggestion at serial subscription renewal',NULL,'YesNo');
-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('GoogleJackets','0','if ON, displays jacket covers from Google Books API',NULL,'YesNo');
-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RandomizeHoldsQueueWeight','0','if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight',NULL,'YesNo');
-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('StaticHoldsQueueWeight','0','Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective',NULL,'TextArea');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GoogleJackets','0','if ON, displays jacket covers from Google Books API',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RandomizeHoldsQueueWeight','0','if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('StaticHoldsQueueWeight','0','Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective',NULL,'TextArea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoEmailOpacUser','0','Sends notification emails containing new account details to patrons - when account is created.',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoEmailPrimaryAddress','0','Defines the default email address where \'Account Details\' emails are sent.','email|emailpro|B_email|cardnumber|OFF','Choice');
+
+-- Tags and BakerTaylor (note field order differs from above)
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
+       ('BakerTaylorBookstoreURL','','','URL template for \"My Libary Bookstore\" links, to which the \"key\" value is appended, and \"https://\" is prepended.  It should include your hostname and \"Parent Number\".  Make this variable empty to turn MLB links off.<br /> Example: ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&parentNum=10923&key=',''),
+       ('BakerTaylorEnabled','0','','Enable or disable all Baker & Taylor features.','YesNo'),
+       ('BakerTaylorPassword','','','Baker & Taylor Password for Content Cafe (external content)','Textarea'),
+       ('BakerTaylorUsername','','','Baker & Taylor Username for Content Cafe (external content)','Textarea'),
+       ('TagsEnabled','1','','Enables or disables all tagging features.  This is the main switch for tags.','YesNo'),
+       ('TagsExternalDictionary',NULL,'','Path on server to local ispell executable, used to set $Lingua::Ispell::path <br />This dictionary is used as a \"whitelist\" of pre-allowed tags.',''),
+       ('TagsInputOnDetail','1','','Allow users to input tags from the detail page.',         'YesNo'),
+       ('TagsInputOnList',  '0','','Allow users to input tags from the search results list.', 'YesNo'),
+       ('TagsModeration',  NULL,'','Require tags from patrons to be approved before becoming visible.','YesNo'),
+       ('TagsShowOnDetail','10','','Number of tags to display on detail page.  0 is off.',        'Integer'),
+       ('TagsShowOnList',   '6','','Number of tags to display on search results list.  0 is off.','Integer');
+
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACShelfBrowser','1','','Enable/disable Shelf Browser on item details page','YesNo');
+
+-- FIXME: add FrameworksLoaded, noOPACUserLogin, ReadingHistory ?
index e53f3b8..414d5ce 100755 (executable)
@@ -1386,7 +1386,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
                ('TagsExternalDictionary',NULL,'','Path on server to local ispell executable, used to set $Lingua::Ispell::path <br />This dictionary is used as a \"whitelist\" of pre-allowed tags.',''),
                ('TagsInputOnDetail','1','','Allow users to input tags from the detail page.',         'YesNo'),
                ('TagsInputOnList',  '0','','Allow users to input tags from the search results list.', 'YesNo'),
-               ('TagsModeration',  NULL,'','(unimplemented) Requires tags from patrons to be approved before becoming visible.','YesNo'),
+               ('TagsModeration',  NULL,'','Require tags from patrons to be approved before becoming visible.','YesNo'),
                ('TagsShowOnDetail','10','','Number of tags to display on detail page.  0 is off.',        'Integer'),
                ('TagsShowOnList',   '6','','Number of tags to display on search results list.  0 is off.','Integer')
        #);
index 2faa5cf..57b52bb 100644 (file)
     <dt><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments</a></dt>
        <dd>Moderate patron comments</dd>
     <!-- /TMPL_IF -->
+
+    <!-- TMPL_IF NAME="CAN_user_tools_moderate_comments" --><!-- FIXME: Update here when Tag specific permission is created. -->
+    <dt><a href="/cgi-bin/koha/tags/review.pl">Tags</a></dt>
+       <dd>Moderate patron tags</dd>
+    <!-- /TMPL_IF -->
        </dl>
 </div>
 <div class="yui-u">
index 540263d..6655f29 100755 (executable)
             </ul><!-- TMPL_ELSE -->No tags for this title. 
         <!-- /TMPL_IF -->
         <!-- TMPL_IF NAME="TagsInputOnDetail" -->
+                       <!-- TMPL_IF NAME="loggedinusername" -->
                <span class="label" id="addtagl"><a href="#">Add</a></span>
          <form name="tagform<!-- TMPL_VAR NAME="biblionumber" -->" method="post" action="/cgi-bin/koha/opac-tags.pl" id="tagform">
                 <label for="newtag<!-- TMPL_VAR NAME="biblionumber" -->">New:</label><input name="newtag<!-- TMPL_VAR NAME="biblionumber" -->" id="newtag<!-- TMPL_VAR NAME="biblionumber" -->" maxlength="100" />
                 Tag status here.
             </span>
             <br />
+               <!-- TMPL_ELSE -->
+                               <span id="login4tags" class="tagstatus">Log in to add tags.</span>
+               <!-- /TMPL_IF -->
         <!-- /TMPL_IF -->
         </div>
     <!-- /TMPL_IF -->
index 797240d..bf452d3 100644 (file)
@@ -243,18 +243,17 @@ $(document).ready(function(){
 
                                <!-- /TMPL_IF -->
                                
-                               <span class="results_summary">
-                               </span> 
                                <!-- TMPL_IF NAME="TagsEnabled" -->
                 <!-- TMPL_IF NAME="TagsShowOnList" -->
-                                               <div class="results_summary">
                 <!-- TMPL_IF NAME="TagLoop" -->
+                                       <div class="results_summary">
                         <span class="label">Tags:</span>
                         <ul style="display: inline; list-style: none;"><!-- TMPL_LOOP NAME="TagLoop" --><li style="display: inline; list-style: none;"><a href="/cgi-bin/koha/opac-search.pl?tag=<!-- TMPL_VAR NAME="term" ESCAPE="URL" -->&amp;q=<!-- TMPL_VAR NAME="term" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="term" --></a> <span class="weight">(<!-- TMPL_VAR NAME="weight_total" -->)</span></li>
                             <!-- /TMPL_LOOP -->
                         </ul>
                        <!-- /TMPL_IF -->
                 <!-- TMPL_IF NAME="TagsInputOnList" -->
+                                       <!-- TMPL_IF NAME="loggedinusername" -->
                     <form name="tagform<!-- TMPL_VAR NAME="biblionumber" -->" method="post" action="/cgi-bin/koha/opac-tags.pl">
                         <label for="newtag<!-- TMPL_VAR NAME="biblionumber" -->">New tag:</label>
                         <input name="newtag<!-- TMPL_VAR NAME="biblionumber" -->" id="newtag<!-- TMPL_VAR NAME="biblionumber" -->" maxlength="100" />
@@ -263,8 +262,11 @@ $(document).ready(function(){
                     <span id="newtag<!-- TMPL_VAR NAME="biblionumber" -->_status" class="tagstatus" style="display:none;">
                         Tag status here.
                     </span>
+                       <!-- TMPL_ELSIF NAME="__first__" --><span class="tagstatus" id="login4tags">Log in to add tags.</span>
+                       <!-- /TMPL_IF -->
                 <!-- /TMPL_IF -->
-                                       </div>
+                       <!-- TMPL_IF NAME="TagLoop" -->
+                                       </div><!-- /TMPL_IF -->
                                <!-- /TMPL_IF -->
                 <!-- /TMPL_IF -->
                                <!-- TMPL_IF Name="searchhighlightblob" --><span class="results_summary"><span class="label">Match:</span> <!-- TMPL_VAR NAME="searchhighlightblob" --></span><!-- /TMPL_IF -->