Bugzilla – Attachment 74390 Details for
Bug 18327
Add the ability to set the received date to today on multi receiving serials
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18327: Add the ability to set the received date to today on multi receiving serials
Bug-18327-Add-the-ability-to-set-the-received-date.patch (text/plain), 7.91 KB, created by
Séverine Queune
on 2018-04-17 19:49:47 UTC
(
hide
)
Description:
Bug 18327: Add the ability to set the received date to today on multi receiving serials
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2018-04-17 19:49:47 UTC
Size:
7.91 KB
patch
obsolete
>From 2b4303ba720ceda9268707d8f40693b4d8945623 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 16 Apr 2018 18:56:06 -0300 >Subject: [PATCH] Bug 18327: Add the ability to set the received date to today > on multi receiving serials >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >When receiving several issues for a subscription (Serials > Serial >collection > Multi receiving), the reception date is always identical to the >publication date. >In some use cases we would like to set this "date received" value to >today. >Note: "date received" refers to the DB column serial.planneddate > >To make this possible this patch replaces the JS prompt with a modal >dialog asking for > 1. the number of issues to receive > 2. if the received date must be set to today > >Ergonomic note: bootstrap styled buttons are used, but they do not display correctly >We may need to improve that (later) > >Test plan: >- Receive 1 or more serials using the "Multi receiving" buttons >Note that this button appears twice, on the "serial collection >information" and the "serial edition" pages >- Try with and without the new checkbox ticked and confirm the behaviour >is correct (i.e. date received is set to today or set to the publish >date) >- Make sure "Edit serials" and "Generate next" buttons still work as >before > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > .../prog/en/modules/serials/serials-collection.tt | 51 ++++++++++++++++++---- > serials/serials-collection.pl | 9 +++- > 2 files changed, 50 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >index c00c7be..7f26f8b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >@@ -21,6 +21,38 @@ > <div id="yui-main"> > <div class="yui-b"> > >+ <!-- Modal --> >+ <div id="multi_receiving" class="modal" tabindex="-1" role="dialog" aria-labelledby="multi_receiving_label" aria-hidden="true"> >+ <div class="modal-dialog"> >+ <div class="modal-content"> >+ <form action="/cgi-bin/koha/serials/serials-collection.pl" method="post"> >+ <div class="modal-body"> >+ <fieldset class="rows"> >+ <legend>Multi receiving</legend> >+ <ol> >+ <li> >+ <label for="nbissues" class="required">How many issues do you want to receive?</label> >+ <input type="text" size="25" id="nbissues" name="nbissues" required="required" /> >+ <li> >+ <li> >+ <label for="date_received_today">Set the date received to today?</label> >+ <input type="checkbox" id="date_received_today" name="date_received_today" /> >+ </li> >+ </ol> >+ <input type="hidden" name="op" value="gennext" /> >+ <input type="hidden" name="subscriptionid" value="[% subscriptionidlist %]" /> >+ </fieldset> >+ </div> >+ >+ <div class="modal-footer"> >+ <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a> >+ <input type="submit" class="btn btn-default approve" value="Multi receiving" /> >+ </div> >+ </form> >+ </div> >+ </div> >+ </div> >+ > > [% UNLESS ( popup ) %] > [% INCLUDE 'serials-toolbar.inc' %] >@@ -112,10 +144,12 @@ > <div id="subscription-year-[% year.year %]"> > [% IF ( CAN_user_serials_receive_serials ) %] > <p> >- <input type="submit" value="Edit serials" /> >+ <div class="btn-group"><input type="submit" value="Edit serials" class="btn btn-default btn-sm" /></div> > [% UNLESS subscription.closed %] >- <input type="button" value="Generate next" onclick="javascript:generateNext([% subscriptionidlist %])" /> >- [% IF ( subscriptions.size == 1 and !serialsadditems ) %] <input type="button" value="Multi receiving" onclick="javascript:generateReceive([% subscriptionidlist %])" />[% END %] >+ <div class="btn-group"><input type="button" value="Generate next" onclick="javascription:generateNext([% subscriptionidlist %])" class="btn btn-default btn-sm" /></div> >+ [% IF ( subscriptions.size == 1 and !serialsadditems ) %] >+ <div class="btn-group"><a href="#multi_receiving" role="button" class="btn btn-default btn-sm" data-toggle="modal"><i class="fa fa-plus"></i> Multi receiving</a></div> >+ [% END %] > [% END %] > </p> > [% END %] >@@ -273,12 +307,9 @@ > </script> > [% Asset.js("js/serials-toolbar.js") %] > [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %] >+ > <script type="text/javascript"> >- function generateReceive(subscriptionid) { >- if(nbissues=prompt(_("How many issues do you want to receive ?"))){ >- document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid+'&nbissues='+nbissues; >- } >- } >+ > function print_slip(subscriptionid,issue){ > var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue; > window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes'); >@@ -316,6 +347,10 @@ > "bInfo": false, > "bFilter": false, > } )); >+ >+ $('#multi_receiving').on('show', function () { >+ $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML); >+ }); > }); > > </script> >diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl >index ed102c2..a4fd91d 100755 >--- a/serials/serials-collection.pl >+++ b/serials/serials-collection.pl >@@ -28,12 +28,15 @@ use C4::Letters; > use C4::Output; > use C4::Context; > >+use Koha::DateUtils qw( dt_from_string ); >+ > use List::MoreUtils qw/uniq/; > > > my $query = new CGI; > my $op = $query->param('op') || q{}; > my $nbissues=$query->param('nbissues'); >+my $date_received_today = $query->param('date_received_today') || 0; > my $dbh = C4::Context->dbh; > > my ($template, $loggedinuser, $cookie) >@@ -66,8 +69,9 @@ if($op eq 'gennext' && @subscriptionid){ > $sth->execute($subscriptionid); > # modify actual expected issue, to generate the next > if ( my $issue = $sth->fetchrow_hashref ) { >+ my $planneddate = $date_received_today ? dt_from_string : $issue->{planneddate}; > ModSerialStatus( $issue->{serialid}, $issue->{serialseq}, >- $issue->{planneddate}, $issue->{publisheddate}, >+ $planneddate, $issue->{publisheddate}, > $issue->{publisheddatetext}, $status, "" ); > } else { > require C4::Serials::Numberpattern; >@@ -81,9 +85,10 @@ if($op eq 'gennext' && @subscriptionid){ > > ## We generate the next publication date > my $nextpublisheddate = GetNextDate($subscription, $expected->{publisheddate}, 1); >+ my $planneddate = $date_received_today ? dt_from_string : $nextpublisheddate; > ## Creating the new issue > NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'}, >- 1, $nextpublisheddate, $nextpublisheddate ); >+ 1, $planneddate, $nextpublisheddate ); > > ## Updating the subscription seq status > my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? >-- >2.1.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 18327
:
74375
|
74376
|
74390
|
74391
|
74456
|
74457
|
74513
|
74514
|
74515
|
74516
|
74535