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 <nengard@bywatersolutions.com> All test pass Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> All tests and QA script pass. Changes to the templates include no string changes. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> (cherry picked from commitb36d3bc796) Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> (cherry picked from commit1a8db0ba7d) Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Conflicts: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (cherry picked from commit0394a8f8ce)
This commit is contained in:
parent
f05bb04470
commit
a49d2d7875
|
|
@ -7,7 +7,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");
|
||||
|
|
@ -197,7 +197,19 @@ $(document).ready(function() {
|
|||
[% END %]
|
||||
</tr>
|
||||
[% FOREACH item_loo IN item_loop %]
|
||||
<tr id="row[% item_loo.itemnumber %]">
|
||||
[% IF ( item_loo.itemnumber == itemnumber) %]
|
||||
[% IF item_loo.nomod %]
|
||||
<tr id="row[% item_loo.itemnumber %]" class="active">
|
||||
[% ELSE %]
|
||||
<tr id="row[% item_loo.itemnumber %]" class="active editable">
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% IF item_loo.nomod %]
|
||||
<tr id="row[% item_loo.itemnumber %]">
|
||||
[% ELSE %]
|
||||
<tr id="row[% item_loo.itemnumber %]" class="editable">
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF ( item_loo.nomod ) %] <td colspan="2"> </td>[% ELSE %][% IF ( item_loo.hostitemflag ) %]<td><a href="additem.pl?op=edititem&biblionumber=[% item_loo.hostbiblionumber %]&itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a></td>
|
||||
<td><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&biblionumber=[% biblionumber %]&hostitemnumber=[% item_loo.itemnumber %]">Delink</a></td>
|
||||
[% ELSE %]<td><a href="additem.pl?op=edititem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a></td>
|
||||
|
|
|
|||
Loading…
Reference in New Issue