Bugzilla – Attachment 26981 Details for
Bug 11395
Batch modifications for records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11395: The modification template should be changed on the list view
Bug-11395-The-modification-template-should-be-chan.patch (text/plain), 7.73 KB, created by
Jonathan Druart
on 2014-04-10 15:22:08 UTC
(
hide
)
Description:
Bug 11395: The modification template should be changed on the list view
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-04-10 15:22:08 UTC
Size:
7.73 KB
patch
obsolete
>From 8dceda37887362fd1e289a9097be895203aeaa8a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 16 Dec 2013 17:02:25 +0100 >Subject: [PATCH] Bug 11395: The modification template should be changed on > the list view > >This patch fixes the following issue: >If the user comes from a basket, the list view is displayed but there is >no way to select the modification template. > >Now the template can be chosen on the list view. This way, the user is >able to change the modifications to apply and see the previewed records. >--- > .../en/modules/tools/batch_record_modification.tt | 61 ++++++++++++++------ > tools/batch_record_modification.pl | 4 +- > 2 files changed, 45 insertions(+), 20 deletions(-) > >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 2ce3481..b9433e7 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 >@@ -41,7 +41,24 @@ $(document).ready(function() { > })); > > $("#mainformsubmit").click(function(){ >- return submitBackgroundJob(document.getElementById("process")); >+ if ( $("#marc_modification_template_id").val() > 0 ) { >+ return submitBackgroundJob(document.getElementById("process")); >+ } >+ alert(_("Please select a modification template.")); >+ return false; >+ }); >+ >+ $("#marc_modification_template_id").change(function(){ >+ var url = "/cgi-bin/koha/svc/records/preview?" >+ var mmtid = $(this).val(); >+ $("a.preview").each(function(){ >+ $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid); >+ }); >+ }); >+ >+ $("a.preview").click(function(){ >+ // Equivalent to rel="gb_page_center[600,500]" >+ return GB_showCenter(_("Preview MARC"), this.href , 600, 500); > }); > > }); >@@ -138,12 +155,23 @@ $(document).ready(function() { > </form> > [% ELSIF view == 'list' %] > [% IF records %] >- [% IF recordtype == 'biblio' %] >- <div id="toolbar"> >- <a id="selectall" href="#">Select All</a> >- | <a id="clearall" href="#">Clear All</a> >- </div> >- <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post" id="process"> >+ <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post" id="process"> >+ <label for="marc_modification_template_id" class="required">Modify record using the following template: </label> >+ <select name="marc_modification_template_id" id="marc_modification_template_id" required="required"> >+ <option value="">Select a template</option> >+ [% FOREACH mmt IN MarcModificationTemplatesLoop %] >+ [% IF mmt.selected %] >+ <option value="[% mmt.template_id %]" selected="selected">[% mmt.name %]</option> >+ [% ELSE %] >+ <option value="[% mmt.template_id %]">[% mmt.name %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ [% IF recordtype == 'biblio' %] >+ <div id="toolbar"> >+ <a id="selectall" href="#">Select All</a> >+ | <a id="clearall" href="#">Clear All</a> >+ </div> > <table id="biblios" class="records"> > <thead> > <tr> >@@ -159,19 +187,17 @@ $(document).ready(function() { > <td><input type="checkbox" name="record_id" value="[% biblio.biblionumber %]" data-items="[% biblio.itemnumbers.size %]" data-issues="[% biblio.issues_count %]" data-reserves="[% biblio.reserves.size %]" /></td> > <td>[% biblio.biblionumber %]</td> > <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title %]</a></td> >- <td><a href="/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=[% biblio.biblionumber %]&mmtid=[% mmtid %]" title="MARC preview" rel="gb_page_center[600,500]">Preview MARC</a> >- >+ <td><a href="/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=[% biblio.biblionumber %]&mmtid=[% mmtid %]" class="preview" data-record_type="biblio" data-record_id="[% biblio.biblionumber %]" data-mmtid="[% mmtid %]" title="Preview MARC" >Preview MARC</a> > </tr> > [% END %] > </tbody> > </table> > <div class="note">Reminder: this action will modify all selected biblios!</div> >- [% ELSE %] >- <div id="toolbar"> >- <a id="selectall" href="#">Select All</a> >- | <a id="clearall" href="#">Clear All</a> >- </div> >- <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post" id="process"> >+ [% ELSE %] >+ <div id="toolbar"> >+ <a id="selectall" href="#">Select All</a> >+ | <a id="clearall" href="#">Clear All</a> >+ </div> > <table id="authorities" class="records"> > <thead> > <tr> >@@ -187,20 +213,19 @@ $(document).ready(function() { > <td><input type="checkbox" name="record_id" value="[% authority.authid %]" data-usage="[% authority.count_usage %]" /></td> > <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid %]">[% authority.authid %]</a></td> > <td>[% PROCESS authresult summary=authority.summary %]</td> >- <td><a href="/cgi-bin/koha/svc/records/preview?record_type=authority&record_id=[% authority.authid %]&mmtid=[% mmtid %]" title="MARC preview" rel="gb_page_center[600,500]">Preview MARC</a> >+ <td><a href="/cgi-bin/koha/svc/records/preview?record_type=authority&record_id=[% authority.authid %]&mmtid=[% mmtid %]" class="preview" data-record_type="authority" data-record_id="[% authority.authid %]" data-mmtid="[% mmtid %]" title="Preview MARC" rel="gb_page_center[600,500]">Preview MARC</a> > </tr> > [% END %] > </tbody> > </table> > <div class="note">Reminder: this action will modify all selected authorities!</div> >- [% END %] >+ [% END %] > <fieldset class="action"> > <input type="hidden" name="op" value="modify" /> > <input type="hidden" name="recordtype" value="[% recordtype %]" /> > <input type="button" id="mainformsubmit" value="Modify selected records" class="button" /> > <input type="hidden" name="runinbackground" id="runinbackground" value="" /> > <input type="hidden" name="completedJobID" id="completedJobID" value="" /> >- <input type="hidden" name="marc_modification_template_id" value="[% mmtid %]" /> > <a class="cancel" href="/cgi-bin/koha/tools/batch_record_modification.pl">Cancel</a> > </fieldset> > <div id="jobpanel"> >diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl >index bec2f9e..d16b547 100755 >--- a/tools/batch_record_modification.pl >+++ b/tools/batch_record_modification.pl >@@ -65,7 +65,7 @@ if ( $completedJobID ) { > exit; > } > >-my @templates = GetModificationTemplates(); >+my @templates = GetModificationTemplates( $mmtid ); > unless ( @templates ) { > $op = 'error'; > $template->param( >@@ -91,7 +91,6 @@ if ( $op eq 'form' ) { > # Display the form > $template->param( > view => 'form', >- MarcModificationTemplatesLoop => \@templates, > ); > } elsif ( $op eq 'list' ) { > # List all records to process >@@ -256,6 +255,7 @@ if ( $op eq 'form' ) { > $template->param( > messages => \@messages, > recordtype => $recordtype, >+ MarcModificationTemplatesLoop => \@templates, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >-- >1.7.10.4
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 11395
:
23502
|
23503
|
23504
|
23505
|
23506
|
23507
|
23508
|
23592
|
24634
|
26072
|
26981
|
28978
|
28999
|
29000
|
29001
|
29002
|
29003
|
29004
|
29056
|
29509
|
29569
|
31344
|
32181
|
32182
|
32184
|
32239
|
32240
|
32241
|
32242
|
32243
|
32244
|
32245
|
32246
|
32247
|
32248
|
32249
|
33145
|
33146
|
33147
|
33148
|
33149
|
33150
|
33151
|
33152
|
33153
|
33154
|
33155
|
34393
|
34394
|
34395
|
34396
|
34397
|
34398
|
34399
|
34400
|
34401
|
34402
|
34552
|
34553
|
34554
|
34555
|
34556
|
34557
|
34558
|
34559
|
34560
|
34561
|
34562
|
35783
|
35784
|
35785
|
35786
|
35787
|
35788
|
35789
|
35790
|
35791
|
35792
|
36295
|
36296
|
36297
|
36298
|
36299
|
36300
|
36301
|
36302
|
36303
|
36304