From ca7331087a8c33061098eca87ec78c368d1b62c8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 10 May 2010 13:09:53 -0400 Subject: [PATCH] Proposed fix for Bug 4354, Cannot edit existing issuing rules This patch adds javascript which pulls the values from the chosen row of data and populates the last row's form with that data. Some changes have been made to the markup to better accommodate this. Possibly missing is some kind of visual feedback to the user that the edit action is taking place in a different row from where they clicked. Comments are especially welcomed on this aspect of the interaction. --- .../prog/en/modules/admin/smart-rules.tmpl | 42 +++++++++++++------- 1 files changed, 27 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl index 4576e26..03e81e9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl @@ -9,6 +9,16 @@ $(document).ready(function() { $('#branch').change(function() { $('#selectlibrary').submit(); }); + $(".editrule").click(function(){ + $(this).parent().parent().find("td").each(function (i) { + itm = $(this).text(); + itm = itm.replace(/^\s*|\s*$/g,''); + $("#default-circulation-rules tr:last td:eq("+i+") input").val(itm); + $("#default-circulation-rules tr:last td:eq("+i+") select").val(itm); + $("#default-circulation-rules tr:last td:last input").val(_("Save")); + }); + return false; + }); }); //]]> @@ -57,11 +67,12 @@ $(document).ready(function() {
" /> -
+
- + "/> +
@@ -74,7 +85,7 @@ $(document).ready(function() { - + @@ -108,6 +119,7 @@ $(document).ready(function() { + @@ -115,7 +127,7 @@ $(document).ready(function() { - - - - - - - - - - + + + + + + + + + +
Patron Category Item TypeRenewals Allowed (count) Holds Allowed (count) Rental Discount (%)  
Edit &categorycode=&branch=">Delete
- @@ -123,23 +135,23 @@ $(document).ready(function() { - "/>
-- 1.7.3