Bugzilla – Attachment 108042 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: Restore the 'add to list' feature
Bug-22417-Restore-the-add-to-list-feature.patch (text/plain), 7.94 KB, created by
David Cook
on 2020-08-11 08:18:45 UTC
(
hide
)
Description:
Bug 22417: Restore the 'add to list' feature
Filename:
MIME Type:
Creator:
David Cook
Created:
2020-08-11 08:18:45 UTC
Size:
7.94 KB
patch
obsolete
>From 818ce8f872a6e6737fc7d9765ee6bbbb8926816b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 11 Jun 2020 12:40:03 +0200 >Subject: [PATCH] Bug 22417: Restore the 'add to list' feature > >This feature has been added recently by bug 18127. > >It highlights the need of a post processing hook. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Cook <dcook@prosentient.com.au> >--- > admin/background_jobs.pl | 4 ++- > .../prog/en/modules/admin/background_jobs.tt | 41 ++++++++++++++-------- > .../en/modules/tools/batch_record_modification.tt | 17 --------- > tools/batch_record_modification.pl | 2 -- > 4 files changed, 29 insertions(+), 35 deletions(-) > >diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl >index 4eacc8c4d4..85dd740b40 100755 >--- a/admin/background_jobs.pl >+++ b/admin/background_jobs.pl >@@ -24,8 +24,8 @@ use C4::Context; > use C4::Auth; > use C4::Output; > >-use Koha::BackgroundJob; > use Koha::BackgroundJobs; >+use Koha::Virtualshelves; > > my $input = new CGI; > my $op = $input->param('op') || 'list'; >@@ -50,6 +50,8 @@ if ( $op eq 'view' ) { > $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 8be94aa65b..e105889606 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 >@@ -51,6 +51,16 @@ > [% IF report.total_records == report.total_success %] > <div class="dialog message"> > All records have successfully been modified! <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a> >+ [% IF lists.count %] >+ <br /> >+ Add modified records to the following list: >+ <select name="add_bibs_to_list" id="add_bibs_to_list"> >+ <option value="">Select a list</option> >+ [% FOREACH list IN lists %] >+ <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option> >+ [% END %] >+ </select> >+ [% END %] > </div> > [% ELSE %] > <div class="dialog message"> >@@ -95,21 +105,6 @@ > 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 %]. > [% 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. >- <h3>Next steps</h3> >- <ul> >- <li><a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a> >- [% IF lists.count %] >- <li> >- <label for="add_bibs_to_list">Add modified records to the following list: </label> >- <select name="add_bibs_to_list" id="add_bibs_to_list"> >- <option value="">Select a list</option> >- [% FOREACH list IN lists %] >- <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option> >- [% END %] >- </select> >- </li> >- [% END %] >- </ul> > [% END %] > </div> > [% END %] >@@ -224,6 +219,22 @@ > "iDisplayLength": 10, > "sPaginationType": "full_numbers" > })); >+ >+ $("#add_bibs_to_list").change(function(){ >+ var selected = $("#add_bibs_to_list").find("option:selected"); >+ if ( selected.attr("class") == "shelf" ){ >+ var shelfnumber = selected.attr("value"); >+ var bibs = new Array(); >+ [% FOREACH message IN job.messages %] >+ [% IF message.code == 'biblio_modified' %] >+ bibs.push("biblionumber="+[% message.biblionumber | html %]); >+ [% END %] >+ [% END %] >+ var bibstring = bibs.join("&"); >+ window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes'); >+ return false; >+ } >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >index 47aad031af..d9e5cff3bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >@@ -357,23 +357,6 @@ > $("#marcPreviewLabel").html(""); > $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + _("Loading") + "</div>"); > }); >- >- $("#add_bibs_to_list").change(function(){ >- var selected = $("#add_bibs_to_list").find("option:selected"); >- if ( selected.attr("class") == "shelf" ){ >- var shelfnumber = selected.attr("value"); >- var bibs = new Array(); >- [% FOREACH message IN messages %] >- [% IF message.code == 'biblio_modified' %] >- bibs.push("biblionumber="+[% message.biblionumber | html %]); >- [% END %] >- [% END %] >- var bibstring = bibs.join("&"); >- window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes'); >- return false; >- } >- }); >- > }); > </script> > [% END %] >diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl >index f4794c58e7..b28390d297 100755 >--- a/tools/batch_record_modification.pl >+++ b/tools/batch_record_modification.pl >@@ -53,8 +53,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ > flagsrequired => { tools => 'records_batchmod' }, > }); > >-$template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) ); >- > my $sessionID = $input->cookie("CGISESSID"); > > my @templates = GetModificationTemplates( $mmtid ); >-- >2.11.0
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