Bugzilla – Attachment 2932 Details for
Bug 4354
Cannot edit existing issuing rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Revised for current HEAD
0001-Proposed-fix-for-Bug-4354-Cannot-edit-existing-issui.patch (text/plain), 6.67 KB, created by
Owen Leonard
on 2010-12-31 13:54:32 UTC
(
hide
)
Description:
Revised for current HEAD
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2010-12-31 13:54:32 UTC
Size:
6.67 KB
patch
obsolete
>From ca7331087a8c33061098eca87ec78c368d1b62c8 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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; >+ }); > }); > //]]> > </script> >@@ -57,11 +67,12 @@ $(document).ready(function() { > </select> > </form> > <!-- TMPL_IF Name="definedbranch" --><form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="<!-- TMPL_VAR NAME="branch" -->" /> >- <select name="tobranch" id="tobranch"><!-- TMPL_LOOP NAME="branchloop" --><option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option><!-- /TMPL_LOOP --></select> <input type="submit" value="Clone" /></form><!-- /TMPL_IF --></fieldset> >+ <select name="tobranch" id="tobranch"><!-- TMPL_LOOP NAME="branchloop" --><option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option><!-- /TMPL_LOOP --></select> <input type="submit" value="Clone" /></form><!-- /TMPL_IF --> > > <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> > <input type="hidden" name="op" value="add" /> >- <table> >+ <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/> >+ <table id="default-circulation-rules"> > <tr> > <th>Patron Category</th> > <th>Item Type</th> >@@ -74,7 +85,7 @@ $(document).ready(function() { > <th>Renewals Allowed (count)</th> > <th>Holds Allowed (count)</th> > <th>Rental Discount (%)</th> >- <th> </th> >+ <th colspan="2"> </th> > </tr> > <!-- TMPL_LOOP NAME="rules" --> > <!-- TMPL_UNLESS NAME="__odd__" --> >@@ -108,6 +119,7 @@ $(document).ready(function() { > <td><!-- TMPL_VAR NAME="renewalsallowed" --></td> > <td><!-- TMPL_VAR NAME="reservesallowed" --></td> > <td><!-- TMPL_VAR NAME="rentaldiscount" --></td> >+ <td><a href="#" class="editrule">Edit</a></td> > <td> > <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=<!-- TMPL_VAR NAME="itemtype" -->&categorycode=<!-- TMPL_VAR NAME="categorycode" -->&branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a> > </td> >@@ -115,7 +127,7 @@ $(document).ready(function() { > <!-- /TMPL_LOOP --> > <tr> > <td> >- <select name="categorycode"> >+ <select name="categorycode" id="categorycode"> > <option value="*">Default</option> > <!-- TMPL_LOOP NAME="categoryloop" --> > <option value="<!-- TMPL_VAR NAME="categorycode" -->"><!-- TMPL_VAR NAME="description" --></option> >@@ -123,23 +135,23 @@ $(document).ready(function() { > </select> > </td> > <td> >- <select name="itemtype" style="width:13em;"> >+ <select name="itemtype" id="matrixitemtype" style="width:13em;"> > <option value="*">Default</option> > <!-- TMPL_LOOP NAME="itemtypeloop" --> > <option value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="description" --></option> > <!-- /TMPL_LOOP --> > </select> > </td> >- <td><input name="maxissueqty" size="3" /></td> >- <td><input name="issuelength" size="3" /> </td> >- <td><input name="fine" size="4" /></td> >- <td><input name="chargeperiod" size="2" /></td> >- <td><input name="firstremind" size="2" /> </td> >- <td><input name="finedays" size="3" /> </td> >- <td><input name="renewalsallowed" size="2" /></td> >- <td><input name="reservesallowed" size="2" /></td> >- <td><input name="rentaldiscount" size="2" /></td> >- <td><input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/><input type="submit" value="Add" class="submit" /></td> >+ <td><input name="maxissueqty" id="maxissueqty" size="3" /></td> >+ <td><input name="issuelength" id="issuelength" size="3" /> </td> >+ <td><input name="fine" id="fine" size="4" /></td> >+ <td><input name="chargeperiod" id="chargeperiod" size="2" /></td> >+ <td><input name="firstremind" id="firstremind" size="2" /> </td> >+ <td><input name="finedays" id="finedays" size="3" /> </td> >+ <td><input name="renewalsallowed" id="renewalsallowed" size="2" /></td> >+ <td><input name="reservesallowed" id="reservesallowed" size="2" /></td> >+ <td><input name="rentaldiscount" size="2" id="rentaldiscount" /></td> >+ <td colspan="2"><input type="submit" value="Save" class="submit" /></td> > </tr> > </table> > </form> >-- >1.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 4354
:
2182
|
2932
|
2946
|
14622
|
14818
|
14819
|
14821
|
14824
|
14829
|
16199
|
16200
|
16234
|
16610
|
16611
|
16615
|
16616
|
16617
|
16618
|
16650
|
16654
|
16655
|
16656
|
16657
|
16658