View | Details | Raw Unified | Return to bug 17101
Collapse All | Expand All

(-)a/circ/returns.pl (-9 / +13 lines)
Lines 190-195 my $issueinformation; Link Here
190
my $itemnumber;
190
my $itemnumber;
191
my $barcode     = $query->param('barcode');
191
my $barcode     = $query->param('barcode');
192
my $exemptfine  = $query->param('exemptfine');
192
my $exemptfine  = $query->param('exemptfine');
193
my $accept	= $query->param('accept');
193
if (
194
if (
194
  $exemptfine &&
195
  $exemptfine &&
195
  !C4::Auth::haspermission(C4::Context->userenv->{'id'}, {'updatecharges' => 'writeoff'})
196
  !C4::Auth::haspermission(C4::Context->userenv->{'id'}, {'updatecharges' => 'writeoff'})
Lines 268-278 if ($barcode) { Link Here
268
    # Check if we should display a checkin message, based on the the item
269
    # Check if we should display a checkin message, based on the the item
269
    # type of the checked in item
270
    # type of the checked in item
270
    my $itemtype = Koha::ItemTypes->find( $biblio->{'itemtype'} );
271
    my $itemtype = Koha::ItemTypes->find( $biblio->{'itemtype'} );
271
    if ( $itemtype && $itemtype->checkinmsg ) {
272
    if ($itemtype->checkinmsgtype eq 'question' && $accept != '1' && $accept !='2'){
272
        $template->param(
273
    	if ( $itemtype && $itemtype->checkinmsg ) {
273
            checkinmsg     => $itemtype->checkinmsg,
274
       		$template->param(
274
            checkinmsgtype => $itemtype->checkinmsgtype,
275
            	checkinmsg     => $itemtype->checkinmsg,
275
        );
276
            	checkinmsgtype => $itemtype->checkinmsgtype,
277
            	barcode        => $barcode,
278
        	);
279
    	}
276
    }
280
    }
277
281
278
    # make sure return branch respects home branch circulation rules, default to homebranch
282
    # make sure return branch respects home branch circulation rules, default to homebranch
Lines 299-305 if ($barcode) { Link Here
299
        borrower         => $borrower,
303
        borrower         => $borrower,
300
        additional_materials => $materials,
304
        additional_materials => $materials,
301
    );
305
    );
302
303
    my %input = (
306
    my %input = (
304
        counter => 0,
307
        counter => 0,
305
        first   => 1,
308
        first   => 1,
Lines 307-315 if ($barcode) { Link Here
307
    );
310
    );
308
311
309
    # do the return
312
    # do the return
310
    ( $returned, $messages, $issueinformation, $borrower ) =
313
    if($itemtype->checkinmsgtype ne 'question' || ($itemtype->checkinmsgtype eq 'question' && $accept == '1')) {
311
      AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $return_date_override, $dropboxdate );
314
    	( $returned, $messages, $issueinformation, $borrower ) =
312
315
      		AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $return_date_override, $dropboxdate );
316
    }
313
    if ($returned) {
317
    if ($returned) {
314
        my $time_now = DateTime->now( time_zone => C4::Context->tz )->truncate( to => 'minute');
318
        my $time_now = DateTime->now( time_zone => C4::Context->tz )->truncate( to => 'minute');
315
        my $duedate = $issueinformation->{date_due}->strftime('%Y-%m-%d %H:%M');
319
        my $duedate = $issueinformation->{date_due}->strftime('%Y-%m-%d %H:%M');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt (+5 lines)
Lines 272-277 Item types administration Link Here
272
                        [% ELSE %]
272
                        [% ELSE %]
273
                            <option value="alert">Alert</option>
273
                            <option value="alert">Alert</option>
274
                        [% END %]
274
                        [% END %]
275
                        [% IF itemtype.checkinmsgtype == 'question' %]
276
                            <option value="question" selected="selected">Question</option>
277
                        [% ELSE %]
278
                            <option value="question">Question</option>
279
                        [% END %]
275
                    </select>
280
                    </select>
276
                </li>
281
                </li>
277
                <li>
282
                <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-7 / +22 lines)
Lines 528-539 $(document).ready(function () { Link Here
528
    </div>
528
    </div>
529
529
530
[% IF ( checkinmsg ) %]
530
[% IF ( checkinmsg ) %]
531
    [% IF ( checkinmsgtype == 'alert' ) %]
531
    [% IF ( checkinmsgtype == 'alert' || checkinmsgtype == 'question') %]
532
        <div class="dialog alert">
532
        <div class="dialog alert">
533
    [% ELSE %]
533
    [% ELSE %]
534
        <div class="dialog message">
534
        <div class="dialog message">
535
    [% END %]
535
    [% END %]
536
            <p class="problem">[% checkinmsg | html_line_break %]</p>
536
            <p class="problem">[% checkinmsg | html_line_break %]</p>
537
            [% IF ( checkinmsgtype == 'question') %]
538
            <form method="post" action="returns.pl" class="confirm">
539
                  <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
540
                  <input type="hidden" name="barcode" value="[% barcode %]" />
541
                  <input type="hidden" name="accept" value="1" />
542
                  <button type="submit" class="deny" onclick="this.form.accept.value = 2; this.form.submit();"><i class="fa fa-times"></i> Cancel</button>
543
                  [% FOREACH inputloo IN inputloop %]
544
	          <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
545
	          <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
546
	          <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />[% END %]  
547
                  [% END %]
548
           </form>
537
        </div>
549
        </div>
538
[% END%]
550
[% END%]
539
551
Lines 553-564 $(document).ready(function () { Link Here
553
            <fieldset>
565
            <fieldset>
554
	<legend>Check in</legend>
566
	<legend>Check in</legend>
555
            <label for="barcode">Enter item barcode: </label>
567
            <label for="barcode">Enter item barcode: </label>
556
			[% IF ( exemptfine ) %]
568
			[% IF checkinmsgtype == 'question' %]
557
			<input name="barcode" id="barcode" size="14" class="focus alert"/>
569
			<input name="barcode" id="barcode" size="14" class="focus" disabled />
558
			[% ELSIF ( dropboxmode ) %]
559
			<input name="barcode" id="barcode" size="14" class="focus alert"/>
560
			[% ELSE %]
570
			[% ELSE %]
561
			<input name="barcode" id="barcode" size="14" class="focus"/>
571
				[% IF ( exemptfine ) %]
572
				<input name="barcode" id="barcode" size="14" class="focus alert"/>
573
				[% ELSIF ( dropboxmode ) %]
574
				<input name="barcode" id="barcode" size="14" class="focus alert"/>
575
				[% ELSE %]
576
				<input name="barcode" id="barcode" size="14" class="focus"/>
577
				[% END %]
562
			[% END %]
578
			[% END %]
563
            <input type="submit" class="submit" value="Submit" />
579
            <input type="submit" class="submit" value="Submit" />
564
580
565
- 

Return to bug 17101