Bugzilla – Attachment 139359 Details for
Bug 15348
Change/Edit estimated delivery date per order line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15348: (follow-up) Fix calendar widget, translateability, etc
Bug-15348-follow-up-Fix-calendar-widget-translatea.patch (text/plain), 10.84 KB, created by
Martin Renvoize (ashimema)
on 2022-08-18 10:58:07 UTC
(
hide
)
Description:
Bug 15348: (follow-up) Fix calendar widget, translateability, etc
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-08-18 10:58:07 UTC
Size:
10.84 KB
patch
obsolete
>From 241ed2ebd2627d15ea16153f4aff82f0d9d2e091 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Fri, 15 Jul 2022 14:10:47 +1200 >Subject: [PATCH] Bug 15348: (follow-up) Fix calendar widget, translateability, > etc >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Also add functionality to edit the estimated delivery date from a closed >basket. > >Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de> >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > acqui/moddeliverydate.pl | 4 +- > .../prog/en/modules/acqui/basket.tt | 54 ++++++++++++++++++- > .../prog/en/modules/acqui/lateorders.tt | 6 +-- > .../prog/en/modules/acqui/moddeliverydate.tt | 8 +-- > .../prog/en/modules/acqui/neworderempty.tt | 4 +- > 5 files changed, 59 insertions(+), 17 deletions(-) > >diff --git a/acqui/moddeliverydate.pl b/acqui/moddeliverydate.pl >index 5eb698ad86..50de045d81 100755 >--- a/acqui/moddeliverydate.pl >+++ b/acqui/moddeliverydate.pl >@@ -33,10 +33,10 @@ use Modern::Perl; > use CGI qw ( -utf8 ); > use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); >-use C4::Acquisition qw( GetOrder GetBasket ); >+use C4::Acquisition qw( GetOrder GetBasket ModOrder ); > > use Koha::Acquisition::Booksellers; >-use Koha::DateUtils; >+use Koha::DateUtils qw( dt_from_string ); > > my $input = CGI->new; > my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index 47c5d3f405..c068e87460 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -596,7 +596,14 @@ > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <td>[% books_loo.suppliers_report | html %]</td> > [% END %] >- <td>[% books_loo.estimated_delivery_date | $KohaDates %]</td> >+ <td class="actions"> >+ [% books_loo.estimated_delivery_date | $KohaDates %] >+ [% IF CAN_user_acquisition_order_manage %] >+ <a class="edit_delivery_date" href="/cgi-bin/koha/acqui/moddeliverydate.pl?ordernumber=[% books_loo.ordernumber | html %]" title="Edit delivery date" data-ordernumber="[% books_loo.ordernumber | html %]"> >+ <i class="fa fa-pencil"></i> Edit >+ </a> >+ </td> >+ [% END %] > [% IF ( active ) %] > [% UNLESS ( closedate ) %] > <td> >@@ -839,12 +846,37 @@ > </div> > </div> > >+<!-- Modal for editing estimated delivery date --> >+<div class="modal" id="dateEditor" tabindex="-1" role="dialog" aria-labelledby="dateEditorLabel"> >+ <div class="modal-dialog" role="document"> >+ <form id="modify_estimated_delivery_date" action="/cgi-bin/koha/acqui/moddeliverydate.pl" method="post"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >+ <h4 class="modal-title" id="dateEditorLabel">Estimated delivery date</h4> >+ </div> >+ <div class="modal-body"> >+ <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="flatpickr" value="[% books_loo.estimated_delivery_date | $KohaDates %]"/> >+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ <input type="hidden" id="date_ordernumber" name="ordernumber" value="" /> >+ <input type="hidden" name="op" value="save" /> >+ </div> >+ <div class="modal-footer"> >+ <button type="submit" class="btn btn-default">Save</button> >+ <button type="button" class="btn btn-link cancel" data-dismiss="modal">Cancel</button> >+ </div> >+ </div> >+ </form> >+ </div> >+</div> >+ > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/acquisitions-menu.js") | $raw %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'columns_settings.inc' %] > [% Asset.js("lib/hc-sticky.js") | $raw %] > [% Asset.js("js/acq.js") | $raw %] >+ [% INCLUDE 'calendar.inc' %] > <script> > function updateColumnsVisibility(visible) { > if ( visible ) { >@@ -936,7 +968,7 @@ > $("#set_basket_group").show(); > }); > >- $(".modal").on("shown.bs.modal", function(){ >+ $("#addtoBasket").on("shown.bs.modal", function(){ > var basket = $(this).data("basketno"); > var legend = _("Add order to basket %s").format(basket); > $(this).find("h4").text( legend ); >@@ -1019,6 +1051,24 @@ > $("#select_managing_library").on("change", function(){ > $(this).parent().submit(); > }); >+ >+ $(".edit_delivery_date").on("click", function(e) { >+ e.preventDefault(); >+ var ordernumber = $(this).data("ordernumber"); >+ var modalTitle = $(this).attr("title") + " (order number " + ordernumber + ")"; >+ var date_text = $( "#delivery_date_" + ordernumber ).html(); >+ $("#dateEditor .modal-title").text(modalTitle); >+ $("#date_ordernumber").val(ordernumber); >+ $("#estimated_delivery_date").html( date_text ); >+ $("#dateEditor").modal("show"); >+ }); >+ >+ $("#dateEditor").on('hidden.bs.modal', function (e) { >+ $("#dateEditorLabel").html(""); >+ $("#dateEditor .modal-title").text(""); >+ $("#estimated_delivery_date").html( "" ); >+ $("#date_ordernumber").val(""); >+ }); > }); > > function UserSearchPopup(f) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >index 7f40b20f21..cb7be2e9d5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >@@ -305,7 +305,7 @@ > <h4 class="modal-title" id="dateEditorLabel">Estimated delivery date</h4> > </div> > <div class="modal-body"> >- <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="datepicker" value="[% estimated_delivery_date | html %]"/> >+ <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="flatpickr" value="[% estimated_delivery_date | $KohaDates %]"/> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > <input type="hidden" id="date_ordernumber" name="ordernumber" value="" /> > <input type="hidden" name="op" value="save" /> >@@ -387,7 +387,7 @@ > e.preventDefault(); > var ordernumber = $(this).data("ordernumber"); > var note_type = $(this).data("note_type"); >- var modalTitle = $(this).attr("title") + " (order number " + ordernumber + ")"; >+ var modalTitle = _("%s (order number %s)").format($(this).attr("title"), ordernumber); > var note_text = $( "#" + note_type + "-note-" + ordernumber ).html(); > $("#noteEditor .modal-title").text(modalTitle); > $("#notes_ordernumber").val( ordernumber ); >@@ -405,8 +405,6 @@ > $("#type").val(""); > }); > >- $("#estimated_delivery_date").datepicker(); >- > $(".edit_delivery_date").on("click", function(e) { > e.preventDefault(); > var ordernumber = $(this).data("ordernumber"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/moddeliverydate.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/moddeliverydate.tt >index 8b1f0b4568..91da28cdfb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/moddeliverydate.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/moddeliverydate.tt >@@ -1,3 +1,4 @@ >+[% USE KohaDates %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Change estimated delivery date › Acquisitions › Koha</title> >@@ -35,7 +36,7 @@ > <form action="/cgi-bin/koha/acqui/moddeliverydate.pl" method="post"> > <fieldset class="brief"> > <label for="estimated_delivery_date">Estimated delivery date:</label> >- <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="flatpickr flatpickr-input noEnterSubmit" value="[% estimated_delivery_date | html %]"/> >+ <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="flatpickr" value="[% estimated_delivery_date | $KohaDates %]"/> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </fieldset> > <input type="hidden" name="referrer" value="[% referrer | html %]" /> >@@ -51,11 +52,6 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'calendar.inc' %] >- <script> >- $(document).ready(function(){ >- $("#estimated_delivery_date").datepicker(); >- }); >- </script> > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index 34a81d3e98..294c6c9c72 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -483,7 +483,7 @@ > </li> > <li> > <label for="estimated_delivery_date">Estimated delivery date: </label> >- <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="flatpickr flatpickr-input noEnterSubmit" value="[% estimated_delivery_date | html %]"/> >+ <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="flatpickr" value="[% estimated_delivery_date | $KohaDates %]"/> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div> >@@ -685,8 +685,6 @@ > getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); > }); > $("#budget_id").change(); >- >- $("#estimated_delivery_date").datepicker(); > }); > > function UserSearchPopup(f) { >-- >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 15348
:
114430
|
114583
|
114623
|
115121
|
115122
|
115123
|
115124
|
116517
|
118788
|
118789
|
119297
|
119298
|
119299
|
120653
|
120654
|
120655
|
120656
|
136560
|
136561
|
136562
|
136563
|
137057
|
137058
|
137061
|
137098
|
137099
|
137740
|
137741
|
137742
|
137743
|
138110
|
138491
|
138529
|
138530
|
138531
|
138532
|
138533
|
138534
|
138535
|
138536
|
138537
|
138538
|
138539
|
138540
|
139245
|
139274
|
139301
|
139329
|
139330
|
139331
|
139332
|
139333
|
139334
|
139335
|
139336
|
139337
|
139338
|
139339
|
139340
|
139341
|
139342
|
139343
|
139351
|
139352
|
139353
|
139354
|
139355
|
139356
|
139357
|
139358
|
139359
|
139360
|
139361
|
139362
|
139363
|
139364
|
139365
|
139831
|
139832
|
139833
|
139834
|
139835
|
139836
|
139837
|
139838
|
139839
|
139840
|
139841
|
139842
|
139843
|
139844
|
139845
|
140708
|
140735
|
143896
|
143900
|
143903
|
143904