Bugzilla – Attachment 108204 Details for
Bug 25261
Multiple parts handling - confirmation alert
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25261: (QA follow-up) Add confirmation to issues table
Bug-25261-QA-follow-up-Add-confirmation-to-issues-.patch (text/plain), 4.74 KB, created by
Martin Renvoize (ashimema)
on 2020-08-13 17:03:55 UTC
(
hide
)
Description:
Bug 25261: (QA follow-up) Add confirmation to issues table
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-08-13 17:03:55 UTC
Size:
4.74 KB
patch
obsolete
>From d5998c9f11be1bf3aaac1ac85d9057790f3c48c3 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 5 Aug 2020 10:52:48 +0100 >Subject: [PATCH] Bug 25261: (QA follow-up) Add confirmation to issues table > >The issues table allows for checkins and was not appropriately >requireing confirmation for the multi-part confirmation added in this >bug. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc | 1 + > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 11 +++++++++++ > svc/checkouts | 8 ++++++++ > 3 files changed, 20 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >index 26aed46765..a3636c3a20 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >@@ -10,6 +10,7 @@ > var RETURN_CLAIMED_FAILURE = _("Unable to claim as returned"); > var RETURN_CLAIMED_MAKE = _("Claim returned"); > var RETURN_CLAIMED_NOTES = _("Notes about return claim"); >+ var CONFIRM_RETURN = _("Confirm"); > var NOT_CHECKED_OUT = _("not checked out"); > var TOO_MANY_RENEWALS = _("too many renewals"); > var ON_RESERVE = _("on hold"); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 41c3562a67..a8f8ab0158 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -130,6 +130,15 @@ $(document).ready(function() { > }, "json") > }); > >+ $(".confirm:checked:visible").each(function() { >+ itemnumber = $(this).val(); >+ id = "#checkin_" + itemnumber; >+ materials = $(this).data('materials'); >+ >+ $(this).replaceWith("<span class='confirm' id='checkin_" + itemnumber + "'>" + CONFIRM_RETURN + " (<span>" + materials + "</span>): <input type='checkbox' class='checkin' name='checkin' value='" + itemnumber +"'></input></span>"); >+ $(id).parent().parent().addClass('warn'); >+ }); >+ > $(".renew:checked:visible").each(function() { > var override_limit = $("#override_limit").is(':checked') ? 1 : 0; > >@@ -543,6 +552,8 @@ $(document).ready(function() { > "mDataProp": function ( oObj ) { > if ( oObj.can_renew_error == "on_reserve" ) { > return "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + ON_HOLD + "</a>"; >+ } else if ( oObj.materials ) { >+ return "<input type='checkbox' class='confirm' id='confirm_" + oObj.itemnumber + "' name='confirm' value='" + oObj.itemnumber + "' data-materials='" + oObj.materials.escapeHtml() + "'></input>"; > } else { > return "<input type='checkbox' class='checkin' id='checkin_" + oObj.itemnumber + "' name='checkin' value='" + oObj.itemnumber +"'></input>"; > } >diff --git a/svc/checkouts b/svc/checkouts >index fa470b3a2a..452003cc13 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -104,6 +104,7 @@ my $sql = ' > items.damaged, > items.location, > items.enumchron, >+ items.materials, > > DATEDIFF( issues.issuedate, CURRENT_DATE() ) AS not_issued_today, > >@@ -139,6 +140,7 @@ $sth->execute(@parameters); > > my $item_level_itypes = C4::Context->preference('item-level_itypes'); > my $claims_returned_lost_value = C4::Context->preference('ClaimReturnedLostValue'); >+my $confirm_parts_required = C4::Context->preference("CircConfirmItemParts"); > > my @checkouts_today; > my @checkouts_previous; >@@ -186,6 +188,11 @@ while ( my $c = $sth->fetchrow_hashref() ) { > my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} }); > $damaged = $av->count ? $av->next->lib : ''; > } >+ my $materials; >+ if ( $c->{materials} && $confirm_parts_required ) { >+ my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => '', kohafield =>'items.materials', authorised_value => $c->{materials} }); >+ $materials = $descriptions->{lib} // $c->{materials}; >+ } > my @subtitles = split(/ \| /, $c->{'subtitle'} // '' ); > my $checkout = { > DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, >@@ -248,6 +255,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { > lost => $lost, > claims_returned => $claims_returned, > damaged => $damaged, >+ materials => $materials, > borrower => { > surname => $c->{surname}, > firstname => $c->{firstname}, >-- >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 25261
:
103856
|
103857
|
104011
|
104012
|
104013
|
104404
|
104405
|
104406
|
104407
|
104408
|
104409
|
104410
|
104411
|
104412
|
104413
|
104414
|
107217
|
107218
|
107219
|
107220
|
107221
|
107222
|
107228
|
107229
|
107230
|
107231
|
107232
|
107233
|
107234
|
107285
|
107331
|
107822
|
107823
|
108196
|
108197
|
108198
|
108199
|
108200
|
108201
|
108202
|
108203
|
108204
|
108205
|
108206
|
108207
|
108208
|
108230
|
108231
|
108232
|
108233
|
108234
|
108235
|
108236
|
108237
|
108238
|
108239
|
108240
|
108241
|
108242
|
109478
|
109479
|
109480
|
109481
|
109482
|
109483
|
109484
|
109485
|
109486
|
109487
|
109488
|
109489
|
109490
|
109491
|
109492
|
109493
|
109494
|
109495
|
109496
|
109497
|
109498
|
109499
|
109500
|
109501
|
109502
|
109503
|
109504
|
109508
|
110038
|
110039
|
110040
|
110041
|
110042
|
110043
|
110044
|
110045
|
110046
|
110047
|
110048
|
110049
|
110050
|
110051
|
110052
|
110133
|
110184
|
110258
|
110259
|
110268
|
110322
|
110323
|
110324
|
110325
|
110326
|
110327
|
110328
|
110329
|
110330
|
110331
|
110332
|
110333
|
110334
|
110335
|
110336
|
110337
|
110338
|
110339
|
110340
|
110341
|
110356
|
110357
|
110358
|
110359
|
110360
|
110361
|
110362
|
110363
|
110364
|
110365
|
110366
|
110367
|
110368
|
110369
|
110370
|
110371
|
110372
|
110373
|
110374
|
110375
|
110915
|
110916
|
110917
|
110918
|
110919
|
110920
|
110921
|
110922
|
110923
|
110924
|
110925
|
110926
|
110927
|
110928
|
110929
|
110930
|
110931
|
110932
|
110933
|
110934
|
111027