Bugzilla – Attachment 168902 Details for
Bug 36372
Allow privileged users to set the 'record source' on cataloguing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36372: (QA follow-up) perltidy cataloguing/record_source.pl, fix permissions issues, add html filters to new template#
Bug-36372-QA-follow-up-perltidy-cataloguingrecords.patch (text/plain), 5.86 KB, created by
Arthur Suzuki
on 2024-07-12 13:01:30 UTC
(
hide
)
Description:
Bug 36372: (QA follow-up) perltidy cataloguing/record_source.pl, fix permissions issues, add html filters to new template#
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2024-07-12 13:01:30 UTC
Size:
5.86 KB
patch
obsolete
>From 6a86b3653f96c034c717252d6b7816df8a6717c0 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Fri, 12 Jul 2024 12:50:06 +0200 >Subject: [PATCH] Bug 36372: (QA follow-up) perltidy > cataloguing/record_source.pl, fix permissions issues, add html filters to new > template# > >--- > cataloguing/record_source.pl | 25 ++++++++++--------- > .../en/modules/cataloguing/record_source.tt | 10 +++++--- > .../integration/Catalogue/Detail_spec.ts | 6 ++--- > 3 files changed, 23 insertions(+), 18 deletions(-) > mode change 100644 => 100755 cataloguing/record_source.pl > >diff --git a/cataloguing/record_source.pl b/cataloguing/record_source.pl >old mode 100644 >new mode 100755 >index 883bf722eee..1005e1aa1f9 >--- a/cataloguing/record_source.pl >+++ b/cataloguing/record_source.pl >@@ -22,7 +22,7 @@ use Modern::Perl; > > use CGI; > use C4::Output qw( output_html_with_http_headers ); >-use C4::Auth qw( get_template_and_user haspermission ); >+use C4::Auth qw( get_template_and_user haspermission ); > use C4::Biblio qw( ModBiblio ); > use C4::Context; > use Koha::DateUtils qw( dt_from_string ); >@@ -35,14 +35,14 @@ use URI::Escape qw( uri_escape_utf8 ); > # ======================== > # MAIN > #========================= >-my $input = CGI->new; >-my $biblionumber = $input->param('biblionumber'); >+my $input = CGI->new; >+my $biblionumber = $input->param('biblionumber'); > my $record_source_id = $input->param('record_source_id') // ''; >-my $save = $input->param('save') // ''; >+my $save = $input->param('save') // ''; >+my $biblio = Koha::Biblios->find($biblionumber); > > if ($save) { >- my $biblio = Koha::Biblios->find($biblionumber); >- $biblio->metadata->set({record_source_id => $record_source_id})->store; >+ $biblio->metadata->set( { record_source_id => $record_source_id } )->store; > my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); > $indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); > print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); >@@ -50,16 +50,17 @@ if ($save) { > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >- template_name => "cataloguing/record_source.tt", >- query => $input, >- type => "intranet", >- flagsrequired => { editcatalogue => 'set_record_sources' }, >- }); >+ template_name => "cataloguing/record_source.tt", >+ query => $input, >+ type => "intranet", >+ flagsrequired => { editcatalogue => 'set_record_sources' }, >+ } >+); > > my $record_sources = Koha::RecordSources->search(); > > $template->param( >- biblionumber => $biblionumber, >+ biblio => $biblio, > record_sources => $record_sources, > ); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/record_source.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/record_source.tt >index 4ddf1b6600e..c6651624f6a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/record_source.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/record_source.tt >@@ -44,16 +44,20 @@ > <h1>Set the record source [% IF ( biblio.title ) %] for [% INCLUDE 'biblio-title.inc' %][% END %]</h1> > > <form method="get" action="/cgi-bin/koha/cataloguing/record_source.pl"> >- <input type="hidden" name="biblionumber" value="[% biblio.biblionumber %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html_entity %]" /> > <select id="record_source_id" name="record_source_id"> > <option value=''>No specified source</option> > [% FOREACH source IN record_sources %] >- <option value=[% source.record_source_id %] [% IF ( source.record_source_id == current_source.record_source_id ) %] selected="selected" [% END %]>[% source.name %]</option> >+ [% IF ( source.record_source_id == current_source.record_source_id ) %] >+ <option value="[% source.record_source_id | html_entity %]" selected="selected">[% source.name | html_entity %]</option> >+ [% ELSE %] >+ <option value="[% source.record_source_id | html_entity %]">[% source.name | html_entity %]</option> >+ [% END %] > [% END %] > </select> > <div class="btn-group"> > <input type="submit" name="save" class="btn btn-primary" value="Set record source" /> >- <button class="btn" href="/cgi-bin/koha/admin/record_sources" target="_blank">Configure record sources</button> >+ <a class="btn btn-secondary" href="/cgi-bin/koha/admin/record_sources">Configure record sources</a> > </div> > </form> > </div> >diff --git a/t/cypress/integration/Catalogue/Detail_spec.ts b/t/cypress/integration/Catalogue/Detail_spec.ts >index 8175a4b3d60..b3cd2b90177 100644 >--- a/t/cypress/integration/Catalogue/Detail_spec.ts >+++ b/t/cypress/integration/Catalogue/Detail_spec.ts >@@ -17,9 +17,9 @@ describe("Set record_source button is present", () => { > cy.get("select").select("No specified source"); > cy.get("input[type=submit]").click(); > >- cy.intercept("GET", '/api/v1/record_sources*').as('listSources') >+ cy.intercept("GET", "/api/v1/record_sources*").as("listSources"); > cy.visit("/cgi-bin/koha/admin/record_sources"); >- cy.wait('@listSources') >+ cy.wait("@listSources"); > cy.get("tr:last-child a.delete").click(); > cy.contains("Poop"); > cy.get("button.approve").click(); >@@ -34,4 +34,4 @@ describe("Set record_source button is present", () => { > cy.visit("/cgi-bin/koha/catalogue/detail.pl?biblionumber=51"); > cy.get("#catalogue_detail_record_source").contains("Poop"); > }); >-}); >\ No newline at end of file >+}); >-- >2.45.1
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 36372
:
166161
|
168054
|
168195
|
168338
|
168339
|
168340
|
168430
|
168510
|
168511
|
168512
|
168897
|
168898
|
168899
|
168900
|
168902
|
169268
|
169269
|
169270
|
169271
|
169542
|
169831
|
172369
|
172370
|
172371
|
176743
|
176744