From 225c930c145ed75fb697cb1d6b8e82aef0fb1da5 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 4 Jul 2018 00:12:21 +0000 Subject: [PATCH] Bug 12365: (follow-up) Adding maxlength attribute and popover Test that you can't add a note of more than 100 characters. Test notes with rules, notes are hidden by 'View note' and the popover correctly displays note. View the note by hovering over the link I've moved the Note column so the popover displays nicely and doesn't cover the buttons. I've also changed the placement so that it doesn't cover information in the row. Update: Test that you can edit the note when clicking 'Edit' and that behaviour is the same for editing all other fields Signed-off-by: Michal Denar Signed-off-by: Michal Denar --- .../prog/en/modules/admin/smart-rules.tt | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index 52f5525702..3c23afd213 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -70,6 +70,7 @@ Patron category Item type Actions + Note Current checkouts allowed Current on-site checkouts allowed Loan period @@ -96,7 +97,6 @@ Item level holds Article requests Rental discount (%) - Note Actions @@ -120,6 +120,11 @@ Delete + + [% IF rule.note %] + View note + [% ELSE %] [% END %] + [% IF ( rule.unlimited_maxissueqty ) %] Unlimited [% ELSE %] @@ -247,6 +252,7 @@ + @@ -318,7 +324,6 @@ - @@ -330,6 +335,7 @@ Patron category Item type   + Note Current checkouts allowed Current on-site checkouts allowed Loan period @@ -349,14 +355,13 @@ No renewal before Automatic renewal No automatic renewal after - No automatic renewal after (hard limit) + No automatic renewal after (hard limit) Holds allowed (count) Holds per record (count) On shelf holds allowed Item level holds Article requests Rental discount (%) - Note   @@ -788,6 +793,8 @@ var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone."); $(document).ready(function() { + $('[data-toggle="popover"]').popover(); + $(".delete").on("click",function(){ return confirmDelete(MSG_CONFIRM_DELETE); }); @@ -825,7 +832,11 @@ itm = $(this).text(); itm = itm.replace(/^\s*|\s*$/g,''); var current_column = $("#edit_row td:eq("+i+")"); - if ( i == 7 ) { + if ( i == 3 ) { + // specific processing for the Note column + var note = $(this).find("a[name='viewnote']").data("content"); + $(current_column).find("input[type='text']").val(note); + } else if ( i == 8 ) { // specific processing for the Hard due date column var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val(); var input_value = ''; @@ -836,7 +847,7 @@ } $(current_column).find("input[type='text']").val(input_value); $(current_column).find("select").val(select_value); - } else if ( i == 13 ) { + } else if ( i == 14 ) { // specific processing for cap_fine_to_replacement_price var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']"); $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') ); @@ -861,7 +872,7 @@ // Remove potential previous input added $(current_column).find("input").remove(); $(current_column).append(""); - } else if ( i == 3 || i == 4 ) { + } else if ( i == 4 || i == 5 ) { // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed" // The value is "Unlimited" (or an equivalent translated string) // an it should be set to an empty string -- 2.11.0