From 0394a8f8ce88b6883cd2a14d57971713f98be346 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 9 May 2013 15:08:41 -0400 Subject: [PATCH] Bug 10225 - If an item isn't editable, don't show the onclick Edit/Delete menu The user should not be shown edit/delete links when clicking on a row in additems which they cannot edit because of the IndependantBranches setting. This patch adds a class to the row to exclude such rows in the JavaScript onclick handler. To test: - Turn IndependantBranches on and edit items for a title which has holdings from various branches including your own. - Click a row for an item which is held by your library. You should see the "Edit/Delete" links appear. - Click a row for an item which is held by another library. No links should appear. Signed-off-by: Nicole C. Engard All test pass Signed-off-by: Katrin Fischer All tests and QA script pass. Changes to the templates include no string changes. Signed-off-by: Jared Camins-Esakov (cherry picked from commit b36d3bc796fd1b0a4db32729c994287425f10326) Signed-off-by: Jared Camins-Esakov (cherry picked from commit 1a8db0ba7d62a70cd6b49ee705a5db9b11ad7672) Signed-off-by: Chris Cormack Conflicts: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt --- .../prog/en/modules/cataloguing/additem.tt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 46d99b51cd..22028cc2ee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -13,7 +13,7 @@ $(document).ready(function(){ $("fieldset.rows input").keydown(function(e){ return checkEnter(e); }); /* Inline edit/delete links */ var biblionumber = $("input[name='biblionumber']").attr("value"); - $("td").click(function(event){ + $("tr.editable td").click(function(event){ var $tgt = $(event.target); if($tgt.is("a")||$tgt.is(":first-child")||$tgt.is(":nth-child(2)")){ return true; } else { var rowid = $(this).parent().attr("id"); @@ -131,7 +131,19 @@ $(document).ready(function() { [% END %] [% FOREACH item_loo IN item_loop %] - + [% IF ( item_loo.itemnumber == itemnumber) %] + [% IF item_loo.nomod %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF item_loo.nomod %] + + [% ELSE %] + + [% END %] + [% END %] [% IF ( item_loo.nomod ) %]  [% ELSE %][% IF ( item_loo.hostitemflag ) %]Edit in host Delink [% ELSE %]Edit -- 2.39.5