From: Ian Walls <[email protected]> The variable name for the current branch being edited was the same as the variable used in cat-search.inc, which passed along the circ-rule library to circulation.pl, and then overriding the set library from there.
This patch renames the template variable 'current_branch', so that it does not populate the 'branch' param in cat-search.inc Signed-off-by: Nicole C. Engard <[email protected]> --- admin/smart-rules.pl | 2 +- .../prog/en/modules/admin/smart-rules.tmpl | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index fdd9b91..d015ec2 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -481,7 +481,7 @@ $template->param(categoryloop => \@category_loop, rules => \@sorted_row_loop, branchloop => \@branchloop, humanbranch => ($branch ne '*' ? $branches->{$branch}->{branchname} : ''), - branch => $branch, + current_branch => $branch, definedbranch => scalar(@sorted_row_loop)>0 ); output_html_with_http_headers $input, $cookie, $template->output; 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 eaa0d43..92a44ce 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 @@ -56,7 +56,8 @@ $(document).ready(function() { <!-- /TMPL_LOOP --> </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" -->" /> +<!-- 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="current_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> <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> @@ -109,7 +110,7 @@ $(document).ready(function() { <td><!-- TMPL_VAR NAME="reservesallowed" --></td> <td><!-- TMPL_VAR NAME="rentaldiscount" --></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> + <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="current_branch" -->">Delete</a> </td> </tr> <!-- /TMPL_LOOP --> @@ -139,7 +140,7 @@ $(document).ready(function() { <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 type="hidden" name="branch" value="<!-- TMPL_VAR NAME="current_branch" -->"/><input type="submit" value="Add" class="submit" /></td> </tr> </table> </form> @@ -149,7 +150,7 @@ $(document).ready(function() { <p>You can set a default maximum number of checkouts and hold policy that will be used if none is defined below for a particular item type or category.</p> <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> <input type="hidden" name="op" value="set-branch-defaults" /> - <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/> + <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="current_branch" -->"/> <table> <tr> <th> </th> @@ -188,7 +189,7 @@ $(document).ready(function() { </td> <td><input type="submit" value="Save" class="submit" /></td> <td> - <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=*&branch=<!-- TMPL_VAR NAME="branch" -->">Unset</a> + <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=*&branch=<!-- TMPL_VAR NAME="current_branch" -->">Unset</a> </td> </tr> </table> @@ -205,7 +206,7 @@ $(document).ready(function() { </p> <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> <input type="hidden" name="op" value="add-branch-cat" /> - <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/> + <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="current_branch" -->"/> <table> <tr> <th>Patron Category</th> @@ -231,7 +232,7 @@ $(document).ready(function() { <!-- /TMPL_IF --> </td> <td> - <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=<!-- TMPL_VAR NAME="categorycode" -->&branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a> + <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=<!-- TMPL_VAR NAME="categorycode" -->&branch=<!-- TMPL_VAR NAME="current_branch" -->">Delete</a> </td> </tr> <!-- /TMPL_LOOP --> @@ -274,7 +275,7 @@ $(document).ready(function() { <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl"> <input type="hidden" name="op" value="add-branch-item" /> - <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/> + <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="current_branch" -->"/> <table> <tr> <th>Item Type</th> @@ -302,7 +303,7 @@ $(document).ready(function() { <!-- /TMPL_IF --> </td> <td> - <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&itemtype=<!-- TMPL_VAR NAME="itemtype" -->&branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a> + <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&itemtype=<!-- TMPL_VAR NAME="itemtype" -->&branch=<!-- TMPL_VAR NAME="current_branch" -->">Delete</a> </td> </tr> <!-- /TMPL_LOOP --> -- 1.7.2.3 _______________________________________________ Koha-patches mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
