Bugzilla – Attachment 18050 Details for
Bug 10225
If an item isn't editable, don't show the onclick Edit/Delete menu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10225 - If an item isn't editable, don't show the onclick Edit/Delete menu
Bug-10225---If-an-item-isnt-editable-dont-show-the.patch (text/plain), 3.41 KB, created by
Owen Leonard
on 2013-05-09 19:14:07 UTC
(
hide
)
Description:
Bug 10225 - If an item isn't editable, don't show the onclick Edit/Delete menu
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-05-09 19:14:07 UTC
Size:
3.41 KB
patch
obsolete
>From dbf8fefa3599ff4e5215adbfb4724da76f3b6825 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 >Content-Type: text/plain; charset="utf-8" > >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. >--- > .../prog/en/modules/cataloguing/additem.tt | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 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 97d06a5..1043965 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"); >@@ -134,11 +134,19 @@ $(document).ready(function() { > [% END %] > </tr> > [% FOREACH item_loo IN item_loop %] >- [% IF ( item_loo.itemnumber == itemnumber) %] >- <tr id="row[% item_loo.itemnumber %]" class="active"> >- [% ELSE %] >- <tr id="row[% item_loo.itemnumber %]"> >- [% END %] >+ [% 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> >-- >1.7.9.5
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 10225
:
18050
|
18076
|
18092