Bugzilla – Attachment 107682 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: Let owner of a job see the progress
Bug-22417-Let-owner-of-a-job-see-the-progress.patch (text/plain), 4.11 KB, created by
Jonathan Druart
on 2020-08-03 08:14:12 UTC
(
hide
)
Description:
Bug 22417: Let owner of a job see the progress
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-08-03 08:14:12 UTC
Size:
4.11 KB
patch
obsolete
>From cbdff228a3ab6a54c19ff582d60a7b2ebdb4fa1b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 3 Aug 2020 10:12:40 +0200 >Subject: [PATCH] Bug 22417: Let owner of a job see the progress > >A owner of a job should be able to see the progress of this job. >--- > admin/background_jobs.pl | 29 +++++++++++++------ > .../prog/en/modules/admin/background_jobs.tt | 8 +++-- > 2 files changed, 26 insertions(+), 11 deletions(-) > >diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl >index 9e08c70605..e97f908151 100755 >--- a/admin/background_jobs.pl >+++ b/admin/background_jobs.pl >@@ -31,28 +31,39 @@ my $input = new CGI; > my $op = $input->param('op') || 'list'; > my @messages; > >+# The "view" view should be accessible for the user who create this job. >+my $flags_required = $op ne 'view' ? { parameters => 'manage_background_jobs' } : undef; >+ > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { > template_name => "admin/background_jobs.tt", > query => $input, > type => "intranet", > authnotrequired => 0, >- flagsrequired => { parameters => 'manage_background_jobs' }, # Maybe the "view" view should be accessible for the user who create this job. >- # But in that case what could the permission to check here? tools => '*' ? >+ flagsrequired => $flags_required, > debug => 1, > } > ); > >-my $dbh = C4::Context->dbh; >- > if ( $op eq 'view' ) { > my $id = $input->param('id'); > if ( my $job = Koha::BackgroundJobs->find($id) ) { >- $template->param( >- job => $job, >- ); >- $template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) ) >- if $job->type eq 'batch_biblio_record_modification'; >+ if ( $job->borrowernumber ne $loggedinuser >+ && !Koha::Patrons->find($loggedinuser)->has_permission( { parameters => 'manage_background_jobs' } ) ) >+ { >+ push @messages, { code => 'cannot_view_job' }; >+ } >+ else { >+ $template->param( job => $job, ); >+ $template->param( >+ lists => scalar Koha::Virtualshelves->search( >+ [ >+ { category => 1, owner => $loggedinuser }, >+ { category => 2 } >+ ] >+ ) >+ ) if $job->type eq 'batch_biblio_record_modification'; >+ } > } else { > $op = 'list'; > } >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 4949d958f1..920e33f159 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 >@@ -12,7 +12,7 @@ > <div id="breadcrumbs"> > <a href="/cgi-bin/koha/mainpage.pl">Home</a> > › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> >- › <a href="/cgi-bin/koha/admin/background_jobs.pl">Background jobs</a> >+ [% IF CAN_user_parameters_manage_background_jobs %]› <a href="/cgi-bin/koha/admin/background_jobs.pl">Background jobs</a>[% END %] > </div> > > <div class="main container-fluid"> >@@ -25,6 +25,8 @@ > [% SWITCH m.code %] > [% CASE 'cannot_retrieve_jobs' %] > <div><i class="fa fa-exclamation error"></i>Cannot retrieve pending jobs ([% m.error %])</div> >+ [% CASE 'cannot_view_job' %] >+ <div><i class="fa fa-exclamation error"></i>Insufficient permission to see this job.</div> > [% CASE %] > [% m.code | html %] > [% END %] >@@ -132,7 +134,9 @@ > </ol> > </fieldset> > >- <a href="/cgi-bin/koha/admin/background_jobs.pl">Return to the job list</a> >+ [% IF CAN_user_parameters_manage_background_jobs %] >+ <a href="/cgi-bin/koha/admin/background_jobs.pl">Return to the job list</a> >+ [% END %] > [% END %] > > [% IF op == 'list' %] >-- >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