Bugzilla – Attachment 54386 Details for
Bug 17101
Confirm a question before check in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17101 - Confirm a question before check in
Bug-17101---Confirm-a-question-before-check-in.patch (text/plain), 6.69 KB, created by
Mirko Tietgen
on 2016-08-12 16:31:32 UTC
(
hide
)
Description:
Bug 17101 - Confirm a question before check in
Filename:
MIME Type:
Creator:
Mirko Tietgen
Created:
2016-08-12 16:31:32 UTC
Size:
6.69 KB
patch
obsolete
>From f1e625e8a515a1f406c417e62709d1310ab6eff9 Mon Sep 17 00:00:00 2001 >From: Tobias Reimann <T.Reimann95@gmx.de> >Date: Fri, 12 Aug 2016 08:17:21 -0700 >Subject: [PATCH] Bug 17101 - Confirm a question before check in >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch enable the checkin message type question. This type ask the user before the item is check in, yes or no. Only if he click yes then the item is checked in. > >Test plan: > >1. Create an itemtype, with the checkinmsgtype question >2. Create an item with the itemtype from 1 >3. Check out the item from 2 >4. Check in the item from 3 >5. Click no ==> item shouldn't be check in >6. Check in the item from 3 >7. Click yes ==> item should be check in > >Optional: >Before step 4 check others item in, to check if the prevouis check in's are still shown. > >Sponsored-by: Bücherei Maichingen >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >--- > circ/returns.pl | 22 ++++++++++------- > .../prog/en/modules/admin/itemtypes.tt | 5 ++++ > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 28 +++++++++++++++++----- > 3 files changed, 40 insertions(+), 15 deletions(-) > >diff --git a/circ/returns.pl b/circ/returns.pl >index 418f94e..e0f3964 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -190,6 +190,7 @@ my $issueinformation; > my $itemnumber; > my $barcode = $query->param('barcode'); > my $exemptfine = $query->param('exemptfine'); >+my $accept = $query->param('accept'); > if ( > $exemptfine && > !C4::Auth::haspermission(C4::Context->userenv->{'id'}, {'updatecharges' => 'writeoff'}) >@@ -268,11 +269,14 @@ if ($barcode) { > # Check if we should display a checkin message, based on the the item > # type of the checked in item > my $itemtype = Koha::ItemTypes->find( $biblio->{'itemtype'} ); >- if ( $itemtype && $itemtype->checkinmsg ) { >- $template->param( >- checkinmsg => $itemtype->checkinmsg, >- checkinmsgtype => $itemtype->checkinmsgtype, >- ); >+ if ($itemtype->checkinmsgtype eq 'question' && $accept != '1' && $accept !='2'){ >+ if ( $itemtype && $itemtype->checkinmsg ) { >+ $template->param( >+ checkinmsg => $itemtype->checkinmsg, >+ checkinmsgtype => $itemtype->checkinmsgtype, >+ barcode => $barcode, >+ ); >+ } > } > > # make sure return branch respects home branch circulation rules, default to homebranch >@@ -299,7 +303,6 @@ if ($barcode) { > borrower => $borrower, > additional_materials => $materials, > ); >- > my %input = ( > counter => 0, > first => 1, >@@ -307,9 +310,10 @@ if ($barcode) { > ); > > # do the return >- ( $returned, $messages, $issueinformation, $borrower ) = >- AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $return_date_override, $dropboxdate ); >- >+ if($itemtype->checkinmsgtype ne 'question' || ($itemtype->checkinmsgtype eq 'question' && $accept == '1')) { >+ ( $returned, $messages, $issueinformation, $borrower ) = >+ AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $return_date_override, $dropboxdate ); >+ } > if ($returned) { > my $time_now = DateTime->now( time_zone => C4::Context->tz )->truncate( to => 'minute'); > my $duedate = $issueinformation->{date_due}->strftime('%Y-%m-%d %H:%M'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >index 9a8f431..34f9b96 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -272,6 +272,11 @@ Item types administration > [% ELSE %] > <option value="alert">Alert</option> > [% END %] >+ [% IF itemtype.checkinmsgtype == 'question' %] >+ <option value="question" selected="selected">Question</option> >+ [% ELSE %] >+ <option value="question">Question</option> >+ [% END %] > </select> > </li> > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index f0d584b..d163ea8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -528,12 +528,24 @@ $(document).ready(function () { > </div> > > [% IF ( checkinmsg ) %] >- [% IF ( checkinmsgtype == 'alert' ) %] >+ [% IF ( checkinmsgtype == 'alert' || checkinmsgtype == 'question') %] > <div class="dialog alert"> > [% ELSE %] > <div class="dialog message"> > [% END %] > <p class="problem">[% checkinmsg | html_line_break %]</p> >+ [% IF ( checkinmsgtype == 'question') %] >+ <form method="post" action="returns.pl" class="confirm"> >+ <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button> >+ <input type="hidden" name="barcode" value="[% barcode %]" /> >+ <input type="hidden" name="accept" value="1" /> >+ <button type="submit" class="deny" onclick="this.form.accept.value = 2; this.form.submit();"><i class="fa fa-times"></i> Cancel</button> >+ [% FOREACH inputloo IN inputloop %] >+ <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" /> >+ <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" /> >+ <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />[% END %] >+ [% END %] >+ </form> > </div> > [% END%] > >@@ -553,12 +565,16 @@ $(document).ready(function () { > <fieldset> > <legend>Check in</legend> > <label for="barcode">Enter item barcode: </label> >- [% IF ( exemptfine ) %] >- <input name="barcode" id="barcode" size="14" class="focus alert"/> >- [% ELSIF ( dropboxmode ) %] >- <input name="barcode" id="barcode" size="14" class="focus alert"/> >+ [% IF checkinmsgtype == 'question' %] >+ <input name="barcode" id="barcode" size="14" class="focus" disabled /> > [% ELSE %] >- <input name="barcode" id="barcode" size="14" class="focus"/> >+ [% IF ( exemptfine ) %] >+ <input name="barcode" id="barcode" size="14" class="focus alert"/> >+ [% ELSIF ( dropboxmode ) %] >+ <input name="barcode" id="barcode" size="14" class="focus alert"/> >+ [% ELSE %] >+ <input name="barcode" id="barcode" size="14" class="focus"/> >+ [% END %] > [% END %] > <input type="submit" class="submit" value="Submit" /> > >-- >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 17101
:
54380
|
54381
| 54386 |
54388
|
54389
|
54390
|
54425
|
54495