From 5c5cf485f77df8ed42687668357790d5e77788c6 Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Fri, 29 Mar 2013 22:33:33 +1300 Subject: [PATCH] Bug 9894 - Followup: Add support for "flagged" values 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 Signed-off-by: Jonathan Druart Signed-off-by: Jared Camins-Esakov (cherry picked from commit 0a91a071efa49b77ca1ff2923aafbd9de1a1a481) Signed-off-by: Jared Camins-Esakov --- .../modules/admin/marc_subfields_structure.tt | 40 ++++++++++++++++--- .../help/admin/marc_subfields_structure.tt | 35 +++++----------- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt index c9ba8e7965..d27ba8bbd5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt @@ -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) {
  • (see online help)
  • - OPAC - Intranet - Editor - Collapsed + OPAC + Intranet + Editor + Collapsed + Flagged
  • [% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)
  • (e.g., Title or Local-Number) NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt index ca8f434810..2a598bf5d6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt @@ -54,32 +54,15 @@ To edit the subfields associated with the tag, click 'Subfields' to the right of
      -
    • hidden -
        -
      • allows you to select from 19 possible visibility conditions, 17 of which are implemented. They are the following: -
          -
        • -9 => Future use
        • -
        • -8 => Flag
        • -
        • -7 => OPAC !Intranet !Editor Collapsed
        • -
        • -6 => OPAC Intranet !Editor !Collapsed
        • -
        • -5 => OPAC Intranet !Editor Collapsed
        • -
        • -4 => OPAC !Intranet !Editor !Collapsed
        • -
        • -3 => OPAC !Intranet Editor Collapsed
        • -
        • -2 => OPAC !Intranet Editor !Collapsed
        • -
        • -1 => OPAC Intranet Editor Collapsed
        • -
        • 0 => OPAC Intranet Editor !Collapsed
        • -
        • 1 => !OPAC Intranet Editor Collapsed
        • -
        • 2 => !OPAC !Intranet Editor !Collapsed
        • -
        • 3 => !OPAC !Intranet Editor Collapsed
        • -
        • 4 => !OPAC Intranet Editor !Collapsed
        • -
        • 5 => !OPAC !Intranet !Editor Collapsed
        • -
        • 6 => !OPAC Intranet !Editor !Collapsed
        • -
        • 7 => !OPAC Intranet !Editor Collapsed
        • -
        • 8 => !OPAC !Intranet !Editor !Collapsed
        • -
        • 9 => Future use
        • -
        -
      • -
      • ( ! means 'not visible' or in the case of Collapsed 'not Collapsed')
      • +
      • Visibility +
          +
        • Allows you to set the visibility options for a MARC field.
        • +
            +
          • OPAC - Checking this box determines whether the subfield is visible in the public interface. Unchecking it hides the field in the public interface.
          • +
          • Intranet - Checking this box determines whether the subfield is visible in the staff interface. Unchecking it hides the field in the staff interface.
          • +
          • Editor - Checking this box makes the subfield available to the MARC editor. Unchecking it indicates the field should not be shown in the editor.
          • +
          • Collapsed - 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.
          • +
          • Flagged - This setting is exclusive of all other visibility options, and flags the field.
        -- 2.39.5