From be99b72a7d8eb2b4442d2dd6820381521dcd3a9d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 24 Oct 2012 11:32:17 -0400 Subject: [PATCH] [Signed off] Bug 8956 - Split serials enumeration data into separate fields - Part 5 - Add label fields to subscription editor. Signed-off-by: Paul Landers --- .../prog/en/modules/serials/subscription-add.tt | 75 ++++++++++++++++--- 1 files changed, 63 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index 14f01ef..0aa4e0b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -138,10 +138,12 @@ function init_pattern() { irregular_issues = new IrregularPattern(); } function reset_pattern() { - document.getElementById("numberpattern").value = ''; + document.getElementById("numberpattern").value = ''; document.getElementById("irregularity").innerHTML = ''; - init_pattern(); - reset_num_pattern(); + $('.label_field').val('').hide(); + + init_pattern(); + reset_num_pattern(); } // common pre defined number patterns @@ -164,7 +166,10 @@ var patternchoice = document.getElementById("numberpattern").value; document.f.lastvalue1.value=1; document.f.lastvalue2.value=1; document.f.lastvalue3.value=1; - document.f.numberingmethod.value=_("Vol {X}, No {Y}, Issue {Z}"); + $(document.f.x_label).val( _("Vol") ).parent().show(); + $(document.f.y_label).val( _("No") ).parent().show(); + $(document.f.z_label).val( _("Issue") ).parent().show(); + document.f.numberingmethod.value=_("{XL} {X}, {YL} {Y}, {ZL} {Z}"); moreoptions(text[1],text[0],text[2]); display_table(0); // toggle info box on (1) or off (0) break; @@ -184,7 +189,10 @@ var patternchoice = document.getElementById("numberpattern").value; document.f.lastvalue1.value=1; document.f.lastvalue2.value=1; document.f.lastvalue3.value=''; - document.f.numberingmethod.value=_("Vol {X}, No {Y}"); + $(document.f.x_label).val( _("Vol") ).parent().show(); + $(document.f.y_label).val( _("No") ).parent().show(); + $(document.f.z_label).val('').parent().hide(); + document.f.numberingmethod.value=_("{XL} {X}, {YL} {Y}"); moreoptions(text[1],text[0]); display_table(0); break; @@ -204,7 +212,10 @@ var patternchoice = document.getElementById("numberpattern").value; document.f.lastvalue1.value=1; document.f.lastvalue2.value=1; document.f.lastvalue3.value=''; - document.f.numberingmethod.value=_("Vol {X}, Issue {Y}"); + $(document.f.x_label).val( _("Vol") ).parent().show(); + $(document.f.y_label).val( _("Issue") ).parent().show(); + $(document.f.z_label).val('').parent().hide(); + document.f.numberingmethod.value=_("{XL} {X}, {YL} {Y}"); moreoptions(text[1],text[2]); display_table(0); break; @@ -223,7 +234,10 @@ var patternchoice = document.getElementById("numberpattern").value; document.f.setto1.value=0; document.f.setto2.value=1; document.f.setto3.value=''; - document.f.numberingmethod.value=_("No {X}, Issue {Y}"); + $(document.f.x_label).val( _("No") ).parent().show(); + $(document.f.y_label).val( _("Issue") ).parent().show(); + $(document.f.z_label).val('').parent().hide(); + document.f.numberingmethod.value=_("{XL} {X}, {YL} {Y}"); moreoptions(text[0],text[2]); display_table(0); break; @@ -246,6 +260,9 @@ var patternchoice = document.getElementById("numberpattern").value; document.f.setto2.value='1'; document.f.setto3.value=''; document.f.periodicity.value='8'; + $(document.f.x_label).val('').parent().show(); + $(document.f.y_label).val('').parent().show(); + $(document.f.z_label).val('').parent().hide(); document.f.numberingmethod.value=_("{Y} {X}"); moreoptions_seasons(text[15],sYear); document.f.lastvalue1temp.value=document.f.lastvalue1.value=sYear; @@ -256,6 +273,9 @@ var patternchoice = document.getElementById("numberpattern").value; display_table(1); document.getElementById("more_options").innerHTML = ''; document.f.irreg_check.value=1; + $(document.f.x_label).val('').parent().show(); + $(document.f.y_label).val('').parent().show(); + $(document.f.z_label).val('').parent().show(); break; case "8": // Year/Number var d = (document.f.firstacquidate.value) ? new Date( document.f.firstacquidate.value) : new Date() ; @@ -313,6 +333,9 @@ var patternchoice = document.getElementById("numberpattern").value; default: } document.f.lastvalue3.value=''; + $(document.f.x_label).val('').parent().show(); + $(document.f.y_label).val('').parent().show(); + $(document.f.z_label).val('').parent().hide(); document.f.numberingmethod.value=_("{X} / {Y}"); moreoptions(text[16],text[0]); // document.f.lastvalue1temp.value=sYear; @@ -335,6 +358,9 @@ var patternchoice = document.getElementById("numberpattern").value; document.f.lastvalue1.value=1; document.f.lastvalue2.value=''; document.f.lastvalue3.value=''; + $(document.f.x_label).val('').parent().show(); + $(document.f.y_label).val('').parent().hide(); + $(document.f.z_label).val('').parent().hide(); document.f.numberingmethod.value='{X}'; // moreoptions_daily_check(text[0]); moreoptions(text[0]); @@ -350,9 +376,9 @@ function display_table(n) { } else if(n==0){ document.getElementById("basetable").style.display = 'none'; } else { - var disp_val = ( document.getElementById("basetable").style.display == 'none' ) ? 'block' : 'none' ; - document.getElementById("basetable").style.display = disp_val; - } + var disp_val = ( document.getElementById("basetable").style.display == 'none' ) ? 'block' : 'none' ; + document.getElementById("basetable").style.display = disp_val; + } } function set_num_pattern_from_template_vars() { @@ -914,6 +940,29 @@ function Check(f) { } $(document).ready(function() { + $('.label_field').parent().hide(); + $('#add1').change(function() { + if( $(this).val() ) { + $('#x_label').parent().show(); + } else { + $('#x_label').parent().hide(); + } + }); + $('#add2').change(function() { + if( $(this).val() ) { + $('#y_label').parent().show(); + } else { + $('#y_label').parent().hide(); + } + }); + $('#add3').change(function() { + if( $(this).val() ) { + $('#z_label').parent().show(); + } else { + $('#z_label').parent().hide(); + } + }); + init_pattern(); // http://jqueryui.com/demos/datepicker/#date-range var dates = $( "#histstartdate, #histenddate" ).datepicker({ @@ -1309,8 +1358,10 @@ $(document).ready(function() { -
  • -
  • +
  • Appears in numbering formula as {XL}
  • +
  • Appears in numbering formula as {YL}
  • +
  • Appears in numbering formula as {ZL}
  • +
  • -- 1.7.2.5