Bug 9894 - Followup: Add support for "flagged" values
authorLiz Rea <liz@catalyst.net.nz>
Fri, 29 Mar 2013 09:33:33 +0000 (22:33 +1300)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Thu, 18 Apr 2013 11:55:18 +0000 (07:55 -0400)
Even though we don't know what they mean or do.

To test:
- open the docs to have at hand the list of codes/visibility options combinations and
try changing several subfields from a single tagfield. Save, and reopen the "Edit subfields" page.
- Click the "Flagged" checkbox - it should disable the other checkboxes as this setting is (apparently) exclusive to the others.
- Step through several tabs and set your visibilities as you like.
- I had a MySQL shell opened to repeatedly run this query (i tested against field 886
  on the default framework):
>  SELECT tagfield,tagsubfield,hidden FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield=886;
- Compare what was saved on the DB with the docs for that visibility selection.

Bug 9894 - Help file updates

To test:

Click the Help link in the upper right hand corner of the MARC subfield editor
Verify that the epic list of values is gone
Verify that the help page overall looks alright
Verify that the help makes sense and is understandable.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt

index c9ba8e7..d27ba8b 100644 (file)
@@ -21,6 +21,7 @@ $(document).ready(function() {
     $("input[id^='hidden-']").each(function() {
             populateHiddenCheckboxes($(this).attr('id').split('-')[1]);
     });
+
 });
 
 /*function displayMoreConstraint(numlayer){
@@ -38,13 +39,30 @@ $(document).ready(function() {
 function setHiddenValue() {
 
     var tab = $(this).attr('id').split('_')[2];
+    var flagged_checked = $("#hidden_flagged_" + tab).is(':checked');
     var opac_checked = $("#hidden_opac_" + tab).is(':checked');
     var intranet_checked = $("#hidden_intranet_" + tab).is(':checked');
     var editor_checked = $("#hidden_editor_" + tab).is(':checked');
     var collapsed_checked = $("#hidden_collapsed_" + tab).is(':checked');
     var hidden_value = "";
 
-    if ( opac_checked && ! intranet_checked && ! editor_checked && collapsed_checked ) {
+    $(function() {
+        enable_cb();
+        $("#hidden_flagged_" + tab).click(enable_cb());
+    });
+
+    function enable_cb() {
+        if ($("#hidden_flagged_" + tab).is(':checked')) {
+            $('.inclusive_' + tab).attr('disabled',true).removeAttr('checked');
+        }
+        else {
+            $('.inclusive_' + tab).removeAttr('disabled');
+        }
+    }
+
+    if ( flagged_checked ) {
+        hidden_value='-8';
+    } else if ( opac_checked && ! intranet_checked && ! editor_checked && collapsed_checked ) {
         hidden_value='-7';
     } else if ( opac_checked && intranet_checked && ! editor_checked && ! collapsed_checked) {
         hidden_value='-6';
@@ -79,6 +97,7 @@ function setHiddenValue() {
     }
 
     $('#hidden-' + tab).val(hidden_value);
+
 }
 
 function populateHiddenCheckboxes(tab) {
@@ -89,8 +108,13 @@ function populateHiddenCheckboxes(tab) {
     var intranet_checked = false;
     var editor_checked = false;
     var collapsed_checked = false;
+    var flagged_checked = false;
 
-    if ( hidden_value == '-7') {
+
+
+    if ( hidden_value == '-8' ) {
+        flagged_checked = true;
+    } else if ( hidden_value == '-7') {
         opac_checked = true;
         collapsed_checked = true;
     } else if ( hidden_value == '-6' ) {
@@ -139,10 +163,13 @@ function populateHiddenCheckboxes(tab) {
         collapsed_checked = true;
     } // else if ( hidden_value == '8') { skip }
 
+
     $("#hidden_opac_" + tab).attr('checked',opac_checked);
     $("#hidden_intranet_" + tab).attr('checked',intranet_checked);
     $("#hidden_editor_" + tab).attr('checked',editor_checked);
     $("#hidden_collapsed_" + tab).attr('checked',collapsed_checked);
+
+
 }
 
 //]]>
@@ -228,10 +255,11 @@ function populateHiddenCheckboxes(tab) {
                                <li><label for="maxlength[% loo.row %]">Max length:</label><input type="text" id="maxlength[% loo.row %]" name="maxlength" value="[% loo.maxlength %]" size="4" /> (see online help)</li>
                 <li><input type="hidden" id="hidden-[% loo.row %]" name="hidden" value="[% loo.hidden %]" />
                     <label for="hidden[% loo.row %]">Visibility: </label>
-                    <input class="radio" type="checkbox" id="hidden_opac_[% loo.row %]" name="hidden_opac_[% loo.row %]"/> OPAC
-                    <input type="checkbox" id="hidden_intranet_[% loo.row %]" name="hidden_intranet_[% loo.row %]"/> Intranet
-                    <input type="checkbox" id="hidden_editor_[% loo.row %]" name="hidden_editor_[% loo.row %]"/> Editor
-                    <input type="checkbox" id="hidden_collapsed_[% loo.row %]" name="hidden_collapsed_[% loo.row %]"/> Collapsed
+                    <input type="checkbox" id="hidden_opac_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_opac_[% loo.row %]"/> OPAC
+                    <input type="checkbox" id="hidden_intranet_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_intranet_[% loo.row %]"/> Intranet
+                    <input type="checkbox" id="hidden_editor_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_editor_[% loo.row %]"/> Editor
+                    <input type="checkbox" id="hidden_collapsed_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_collapsed_[% loo.row %]"/> Collapsed
+                    <input type="checkbox" id="hidden_flagged_[% loo.row %]" name="flagged_[% loo.row %]"/> Flagged
                 </li>
                 <li><label for="isurl[% loo.row %]">Is a URL:</label>[% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)</li>
                 <li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li>
index ca8f434..2a598bf 100644 (file)
@@ -54,32 +54,15 @@ To edit the subfields associated with the tag, click 'Subfields' to the right of
 </li>
 </ul>
 <ul>
-       <li>hidden
-<ul>
-       <li>allows you to select from 19 possible visibility conditions, 17 of which are implemented. They are the following:
-<ul>
-       <li>-9 =&gt; Future use</li>
-       <li>-8 =&gt; Flag</li>
-       <li>-7 =&gt; OPAC !Intranet !Editor Collapsed</li>
-       <li>-6 =&gt; OPAC Intranet !Editor !Collapsed</li>
-       <li>-5 =&gt; OPAC Intranet !Editor Collapsed</li>
-       <li>-4 =&gt; OPAC !Intranet !Editor !Collapsed</li>
-       <li>-3 =&gt; OPAC !Intranet Editor Collapsed</li>
-       <li>-2 =&gt; OPAC !Intranet Editor !Collapsed</li>
-       <li>-1 =&gt; OPAC Intranet Editor Collapsed</li>
-       <li>0 =&gt; OPAC Intranet Editor !Collapsed</li>
-       <li>1 =&gt; !OPAC Intranet Editor Collapsed</li>
-       <li>2 =&gt; !OPAC !Intranet Editor !Collapsed</li>
-       <li>3 =&gt; !OPAC !Intranet Editor Collapsed</li>
-       <li>4 =&gt; !OPAC Intranet Editor !Collapsed</li>
-       <li>5 =&gt; !OPAC !Intranet !Editor Collapsed</li>
-       <li>6 =&gt; !OPAC Intranet !Editor !Collapsed</li>
-       <li>7 =&gt; !OPAC Intranet !Editor Collapsed</li>
-       <li>8 =&gt; !OPAC !Intranet !Editor !Collapsed</li>
-       <li>9 =&gt; Future use</li>
-</ul>
-</li>
-       <li>( ! means 'not visible' or in the case of Collapsed 'not Collapsed')</li>
+       <li>Visibility
+<ul>
+    <li>Allows you to set the visibility options for a MARC field.</li>
+    <ul>
+        <li><strong>OPAC</strong> - Checking this box determines whether the subfield is visible in the public interface. Unchecking it hides the field in the public interface.</li>
+        <li><strong>Intranet</strong> - Checking this box determines whether the subfield is visible in the staff interface. Unchecking it hides the field in the staff interface.</li>
+        <li><strong>Editor</strong> - Checking this box makes the subfield available to the MARC editor. Unchecking it indicates the field should not be shown in the editor.</li>
+        <li><strong>Collapsed</strong> - Checking this box determines whether the subfield is expanded or collapsed in the MARC editor; the subfield will appear as a clickable link to expand and edit the subfield. Unchecking it indicates that the field will be expanded by default.</li>
+        <li><strong>Flagged</strong> - This setting is exclusive of all other visibility options, and flags the field.</li>
 </ul>
 </li>
 </ul>