Bugzilla – Attachment 109350 Details for
Bug 22417
Add a task queue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22417: Add missing POD and html filters
Bug-22417-Add-missing-POD-and-html-filters.patch (text/plain), 11.83 KB, created by
Jonathan Druart
on 2020-08-31 11:15:11 UTC
(
hide
)
Description:
Bug 22417: Add missing POD and html filters
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-08-31 11:15:11 UTC
Size:
11.83 KB
patch
obsolete
>From ddeecda3954cf438fe7b103bbb2bb8ee1ca3ad93 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 31 Aug 2020 13:08:53 +0200 >Subject: [PATCH] Bug 22417: Add missing POD and html filters > >Also remove "authnotrequired => 0," >--- > Koha/BackgroundJob.pm | 87 +++++++++++++++++++ > Koha/BackgroundJob/BatchUpdateAuthority.pm | 43 +++++++++ > Koha/BackgroundJob/BatchUpdateBiblio.pm | 43 +++++++++ > Koha/BackgroundJobs.pm | 33 +++++++ > admin/background_jobs.pl | 1 - > .../prog/en/modules/admin/background_jobs.tt | 8 +- > 6 files changed, 210 insertions(+), 5 deletions(-) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index b5bf16d2ff..5c96669a64 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -1,5 +1,20 @@ > package Koha::BackgroundJob; > >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use Modern::Perl; > use JSON qw( encode_json decode_json ); > use Carp qw( croak ); >@@ -13,6 +28,37 @@ use Koha::BackgroundJob::BatchUpdateAuthority; > > use base qw( Koha::Object ); > >+=head1 NAME >+ >+Koha::BackgroundJob - Koha BackgroundJob Object class >+ >+This is a base class for BackgroundJob, some methods must be subclassed. >+ >+Example of usage: >+ >+Producer: >+my $job_id = Koha::BackgroundJob->enqueue( >+ { >+ job_type => $job_type, >+ job_size => $job_size, >+ job_args => $job_args >+ } >+); >+ >+Consumer: >+Koha::BackgrounJobs->find($job_id)->process; >+See also C<misc/background_jobs_worker.pl> for a full example >+ >+=head1 API >+ >+=head2 Class methods >+ >+=head3 connect >+ >+Connect to the message broker using default guest/guest credential >+ >+=cut >+ > sub connect { > my ( $self ); > my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613' } ); >@@ -20,6 +66,17 @@ sub connect { > return $stomp; > } > >+=head3 enqueue >+ >+Enqueue a new job. It will insert a new row in the DB table and notify the broker that a new job has been enqueued. >+ >+C<job_size> is the size of the job >+C<job_args> is the arguments of the job. It's a structure that will be JSON encoded. >+ >+Return the job_id of the newly created job. >+ >+=cut >+ > sub enqueue { > my ( $self, $params ) = @_; > >@@ -61,6 +118,12 @@ sub enqueue { > return $job_id; > } > >+=head3 process >+ >+Process the job! >+ >+=cut >+ > sub process { > my ( $self, $args ) = @_; > >@@ -72,8 +135,20 @@ sub process { > : Koha::Exceptions::Exception->throw('->process called without valid job_type'); > } > >+=head3 job_type >+ >+Return the job type of the job. Must be a string. >+ >+=cut >+ > sub job_type { croak "This method must be subclassed" } > >+=head3 messages >+ >+Messages let during the processing of the job. >+ >+=cut >+ > sub messages { > my ( $self ) = @_; > >@@ -86,6 +161,12 @@ sub messages { > return @messages; > } > >+=head3 report >+ >+Report of the job. >+ >+=cut >+ > sub report { > my ( $self ) = @_; > >@@ -93,6 +174,12 @@ sub report { > return $data_dump->{report}; > } > >+=head3 cancel >+ >+Cancel a job. >+ >+=cut >+ > sub cancel { > my ( $self ) = @_; > $self->status('cancelled')->store; >diff --git a/Koha/BackgroundJob/BatchUpdateAuthority.pm b/Koha/BackgroundJob/BatchUpdateAuthority.pm >index f965f8da43..3a7683dec2 100644 >--- a/Koha/BackgroundJob/BatchUpdateAuthority.pm >+++ b/Koha/BackgroundJob/BatchUpdateAuthority.pm >@@ -1,5 +1,20 @@ > package Koha::BackgroundJob::BatchUpdateAuthority; > >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use Modern::Perl; > use JSON qw( encode_json decode_json ); > >@@ -11,10 +26,32 @@ use Koha::MetadataRecord::Authority; > > use base 'Koha::BackgroundJob'; > >+=head1 NAME >+ >+Koha::BackgroundJob::BatchUpdateAuthority - Batch update authorities >+ >+This is a subclass of Koha::BackgroundJob. >+ >+=head1 API >+ >+=head2 Class methods >+ >+=head3 job_type >+ >+Define the job type of this job: batch_authority_record_modification >+ >+=cut >+ > sub job_type { > return 'batch_authority_record_modification'; > } > >+=head3 process >+ >+Process the modification. >+ >+=cut >+ > sub process { > my ( $self, $args ) = @_; > >@@ -79,6 +116,12 @@ sub process { > > } > >+=head3 enqueue >+ >+Enqueue the new job >+ >+=cut >+ > sub enqueue { > my ( $self, $args) = @_; > >diff --git a/Koha/BackgroundJob/BatchUpdateBiblio.pm b/Koha/BackgroundJob/BatchUpdateBiblio.pm >index 6eb4501eaf..3549157b5d 100644 >--- a/Koha/BackgroundJob/BatchUpdateBiblio.pm >+++ b/Koha/BackgroundJob/BatchUpdateBiblio.pm >@@ -1,5 +1,20 @@ > package Koha::BackgroundJob::BatchUpdateBiblio; > >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use Modern::Perl; > use JSON qw( encode_json decode_json ); > >@@ -10,10 +25,32 @@ use C4::MarcModificationTemplates; > > use base 'Koha::BackgroundJob'; > >+=head1 NAME >+ >+Koha::BackgroundJob::BatchUpdateBiblio - Batch update bibliographic records >+ >+This is a subclass of Koha::BackgroundJob. >+ >+=head1 API >+ >+=head2 Class methods >+ >+=head3 job_type >+ >+Define the job type of this job: batch_biblio_record_modification >+ >+=cut >+ > sub job_type { > return 'batch_biblio_record_modification'; > } > >+=head3 process >+ >+Process the modification. >+ >+=cut >+ > sub process { > my ( $self, $args ) = @_; > >@@ -86,6 +123,12 @@ sub process { > $job->store; > } > >+=head3 enqueue >+ >+Enqueue the new job >+ >+=cut >+ > sub enqueue { > my ( $self, $args) = @_; > >diff --git a/Koha/BackgroundJobs.pm b/Koha/BackgroundJobs.pm >index ebf5d7e41d..d2ff22347f 100644 >--- a/Koha/BackgroundJobs.pm >+++ b/Koha/BackgroundJobs.pm >@@ -1,13 +1,46 @@ > package Koha::BackgroundJobs; > >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > use Modern::Perl; > use base qw(Koha::Objects); > use Koha::BackgroundJob; > >+=head1 NAME >+ >+Koha::BackgroundJobs - Koha BackgroundJob Object set class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 _type >+ >+=cut >+ > sub _type { > return 'BackgroundJob'; > } > >+=head3 object_class >+ >+=cut >+ > sub object_class { > return 'Koha::BackgroundJob'; > } >diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl >index e97f908151..ef8422d39b 100755 >--- a/admin/background_jobs.pl >+++ b/admin/background_jobs.pl >@@ -39,7 +39,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > template_name => "admin/background_jobs.tt", > query => $input, > type => "intranet", >- authnotrequired => 0, > flagsrequired => $flags_required, > debug => 1, > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >index 920e33f159..deee565d09 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >@@ -24,7 +24,7 @@ > <div class="dialog message"> > [% SWITCH m.code %] > [% CASE 'cannot_retrieve_jobs' %] >- <div><i class="fa fa-exclamation error"></i>Cannot retrieve pending jobs ([% m.error %])</div> >+ <div><i class="fa fa-exclamation error"></i>Cannot retrieve pending jobs ([% m.error | html %])</div> > [% CASE 'cannot_view_job' %] > <div><i class="fa fa-exclamation error"></i>Insufficient permission to see this job.</div> > [% CASE %] >@@ -104,7 +104,7 @@ > [% END %] > [% SWITCH m.code %] > [% CASE 'biblio_not_modified' %] >- Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has not been modified. An error occurred on modifying it.[% IF m.error %] ([% m.error %])[% END %]. >+ Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has not been modified. An error occurred on modifying it.[% IF m.error %] ([% m.error | html %])[% END %]. > [% CASE 'biblio_modified' %] > Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified. > [% END %] >@@ -122,7 +122,7 @@ > [% END %] > [% SWITCH m.code %] > [% CASE 'authority_not_modified' %] >- Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has not been modified. An error occurred on modifying it[% IF m.error %] ([% m.error %])[% END %]. >+ Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has not been modified. An error occurred on modifying it[% IF m.error %] ([% m.error | html %])[% END %]. > [% CASE 'authority_modified' %] > Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has successfully been modified.. > [% END %] >@@ -146,7 +146,7 @@ > <div class="dialog message"> > <i class="fa fa-info"></i> > [% IF pending_jobs.size > 0 %] >- There is [% pending_jobs.size %] pending jobs on the server: [% pending_jobs.join(', ') %]. >+ There is [% pending_jobs.size | html %] pending jobs on the server: [% pending_jobs.join(', ') | html %]. > [% ELSE %] > There is no pending jobs on the server. > [% END %] >-- >2.20.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 22417
:
105542
|
105543
|
107385
|
107386
|
107387
|
107388
|
107389
|
107390
|
107391
|
107392
|
107393
|
107394
|
107395
|
107396
|
107397
|
107398
|
107399
|
107400
|
107401
|
107402
|
107403
|
107404
|
107405
|
107406
|
107481
|
107482
|
107682
|
108023
|
108024
|
108025
|
108026
|
108027
|
108028
|
108029
|
108030
|
108031
|
108032
|
108033
|
108034
|
108035
|
108036
|
108037
|
108038
|
108039
|
108040
|
108041
|
108042
|
108043
|
108044
|
108045
|
108046
|
108047
|
109270
|
109271
|
109319
|
109320
|
109321
|
109322
|
109323
|
109324
|
109325
|
109326
|
109327
|
109328
|
109329
|
109330
|
109331
|
109332
|
109333
|
109334
|
109335
|
109336
|
109337
|
109338
|
109339
|
109340
|
109341
|
109342
|
109343
|
109344
|
109345
|
109350
|
109351
|
109355
|
109390
|
109391
|
109392
|
109393
|
109394
|
109395
|
109396
|
109397
|
109398
|
109399
|
109400
|
109401
|
109402
|
109403
|
109404
|
109405
|
109406
|
109407
|
109408
|
109409
|
109410
|
109411
|
109412
|
109413
|
109414
|
109415
|
109416
|
109417
|
109418
|
109474
|
109475
|
109476
|
109477
|
110150
|
111091
|
111092
|
111093
|
111094
|
111095
|
111096
|
111097
|
111098
|
111099
|
111100
|
111101
|
111102
|
111103
|
111104
|
111105
|
111106
|
111107
|
111108
|
111109
|
111110
|
111111
|
111112
|
111113
|
111114
|
111115
|
111116
|
111117
|
111118
|
111119
|
111120
|
111121
|
111238
|
111239
|
111245