From a57e46faca80402ac28fff00ba2491640ea45db4 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 --- .../en/modules/admin/marc_subfields_structure.tt | 40 +++++++++++++++++--- .../modules/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 c9ba8e7..d27ba8b 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 ca8f434..2a598bf 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