Bugzilla – Attachment 174033 Details for
Bug 32773
Have the ability to have more than 1 Fast Add framework
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32773: Add editing support for is_fast_add frameworks
Bug-32773-Add-editing-support-for-isfastadd-framew.patch (text/plain), 8.69 KB, created by
Andrew Fuerste-Henry
on 2024-11-05 19:14:59 UTC
(
hide
)
Description:
Bug 32773: Add editing support for is_fast_add frameworks
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2024-11-05 19:14:59 UTC
Size:
8.69 KB
patch
obsolete
>From e7d975386a5fcc7ac5b7d4a0edaa29e30e09eeaf Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Sun, 3 Nov 2024 17:44:43 +0000 >Subject: [PATCH] Bug 32773: Add editing support for is_fast_add frameworks > >This patch uses the biblionumber to set is_fast_add on the catalog >details page which is used to determine if the Edit button should be >rendered in the cataloging toolbar. It updates the Biblio.pm subroutine >can_be_edited to check if the biblio frameworkcode is 'FA' or if the >biblio framework is_fast_add = 1. > >To test: >1. Set some biblio frameworks as Fast Add frameworks >2. Login as a user with fast_cataloging permissions only >3. Create and edit different types of Fast Add records >4. Add items and edit items >5. Confirm that you can only edit bibs and items > for bibs where the framework is set as a Fast Add framework > and the item is from your home library. >6. Log in as a superlibrarian >7. Confirm you can still create and edit records with the Default > and other frameworks >8. Change a record's framework from a Fast Add to Default >9. Login as the user with only fast_cataloging confirm that you can > no longer edit that record or its items > >Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> >--- > Koha/Biblio.pm | 7 ++++++- > catalogue/detail.pl | 7 +++++++ > catalogue/moredetail.pl | 3 +++ > .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 10 +++++----- > .../prog/en/modules/catalogue/moredetail.tt | 2 +- > 5 files changed, 22 insertions(+), 7 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index d4d54eed42..4992f7b545 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -264,8 +264,13 @@ sub can_be_edited { > Koha::Exceptions::MissingParameter->throw( error => "The patron parameter is missing or invalid" ) > unless $patron && ref($patron) eq 'Koha::Patron'; > >+ my $is_fast_add = >+ defined $self->frameworkcode && $self->frameworkcode ne '' >+ ? Koha::BiblioFrameworks->find( $self->frameworkcode )->is_fast_add >+ : 0; >+ > my $editcatalogue = >- $self->frameworkcode eq 'FA' >+ $self->frameworkcode eq 'FA' || $is_fast_add > ? [ 'fast_cataloging', 'edit_catalogue' ] > : 'edit_catalogue'; > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 7af8010343..13b33818b5 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -48,6 +48,7 @@ use Koha::AuthorisedValues; > use Koha::Biblios; > use Koha::Biblio::ItemGroup::Items; > use Koha::Biblio::ItemGroups; >+use Koha::BiblioFrameworks; > use Koha::CoverImages; > use Koha::DateUtils; > use Koha::ILL::Requests; >@@ -90,10 +91,16 @@ my $activetab = $query->param('activetab'); > my $biblionumber = $query->param('biblionumber'); > $biblionumber = HTML::Entities::encode($biblionumber); > my $biblio = Koha::Biblios->find( $biblionumber ); >+my $frameworkcode = &GetFrameworkCode($biblionumber); >+my $is_fast_add = >+ defined $frameworkcode && $frameworkcode ne '' >+ ? Koha::BiblioFrameworks->find($frameworkcode)->is_fast_add >+ : 0; > > $template->param( > biblio => $biblio, > activetab => $activetab, >+ is_fast_add => $is_fast_add, > ); > > unless ( $biblio ) { >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index 10a1d4fe0f..f8d67b71ed 100755 >--- a/catalogue/moredetail.pl >+++ b/catalogue/moredetail.pl >@@ -33,6 +33,7 @@ use C4::Search qw( enabled_staff_search_views z3950_search_args ); > use Koha::Acquisition::Booksellers; > use Koha::AuthorisedValues; > use Koha::Biblios; >+use Koha::BiblioFrameworks; > use Koha::Items; > use Koha::Patrons; > >@@ -108,6 +109,7 @@ output_and_exit( $query, $cookie, $template, 'unknown_biblio') > unless $biblio && $record; > > my $fw = GetFrameworkCode($biblionumber); >+my $is_fast_add = Koha::BiblioFrameworks->find($fw)->is_fast_add; > my $all_items = $biblio->items->search_ordered; > > my @items; >@@ -315,6 +317,7 @@ $template->param( > itemnumber => $itemnumber, > z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)), > biblio => $biblio, >+ is_fast_add => $is_fast_add, > ); > $template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items ); > $template->{'VARS'}->{'searchid'} = $query->param('searchid'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index 36d924b952..f368839556 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -35,11 +35,11 @@ > </div> > [% END %] > >-[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] >+[% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) or ( frameworkcode == 'FA' || is_fast_add and CAN_user_editcatalogue_fast_cataloging ) %] > <div class="btn-group"> > <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</button> > <ul class="dropdown-menu"> >- [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] >+ [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' || is_fast_add and CAN_user_editcatalogue_fast_cataloging ) %] > [% IF biblio.can_be_edited(logged_in_user) %] > <li><a class="dropdown-item" id="editbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">Edit record</a></li> > [% ELSE %] >@@ -59,7 +59,7 @@ > </li> > [% END %] > >- [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] >+ [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' || is_fast_add and CAN_user_editcatalogue_fast_cataloging ) %] > <li><a class="dropdown-item" id="manageitems" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]">Manage items</a></li> > [% END %] > >@@ -128,7 +128,7 @@ > <li><a class="dropdown-item" href="#" id="z3950copy">Replace record via Z39.50/SRU</a></li> > [% END %] > >- [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] >+ [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' || is_fast_add and CAN_user_editcatalogue_fast_cataloging ) %] > [% IF ( count ) %] > <li data-bs-toggle="tooltip" data-bs-placement="left" title="[% count | html %] item(s) are attached to this record. You must delete all items before deleting this record"> > <a class="dropdown-item disabled" aria-disabled="true" id="deletebiblio" href="#">Delete record</a> >@@ -150,7 +150,7 @@ > [% END %] > [% END %] > >- [% IF CAN_user_editcatalogue_delete_all_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] >+ [% IF CAN_user_editcatalogue_delete_all_items or ( frameworkcode == 'FA' || is_fast_add and CAN_user_editcatalogue_fast_cataloging ) %] > [% IF ( count ) %] > <li> > <form action="/cgi-bin/koha/cataloguing/additem.pl" method="post"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >index 2020f9fb9d..081fc29520 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -122,7 +122,7 @@ > <h4> > Item information > [% UNLESS ( ITEM_DAT.nomod ) %] >- [% IF ( CAN_user_editcatalogue_edit_items ) %] >+ [% IF ( CAN_user_editcatalogue_edit_items || CAN_user_editcatalogue_fast_cataloging && is_fast_add ) %] > <a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% ITEM_DAT.biblionumber | uri %]&itemnumber=[% ITEM_DAT.itemnumber | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit item</a> > [% END %] > [% END %] >-- >2.39.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 32773
:
173401
|
173417
|
173878
|
173879
|
173880
|
173881
|
173882
|
173883
|
173954
|
173955
|
173956
|
173957
|
173958
|
173959
|
173960
|
173961
|
174028
|
174029
|
174030
|
174031
|
174032
|
174033
|
174034
|
174035
|
176927
|
176928
|
176929
|
176930
|
176931
|
176932
|
176933
|
176934
|
176935