From 865fff7126476912ed1927a75854511384654b4d 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 5e5e183..eba47ca 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.0.4