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

(-)a/circ/circulation.pl (-5 / +36 lines)
Lines 90-102 if (!C4::Context->userenv && !$branch){ Link Here
90
}
90
}
91
91
92
my $barcodes = [];
92
my $barcodes = [];
93
my $batch = $query->param('batch');
93
if ( my $barcode = $query->param('barcode') ) {
94
if ( my $barcode = $query->param('barcode') ) {
94
    $barcodes = [ $barcode ];
95
    $barcodes = [ $barcode ];
96
} else {
97
    my $filefh = $query->upload('uploadfile');
98
    if ( $filefh ) {
99
        while ( my $content = <$filefh> ) {
100
            $content =~ s/[\r\n]*$//g;
101
            push @$barcodes, $content if $content;
102
        }
103
    } elsif ( my $list = $query->param('barcodelist') ) {
104
        push @$barcodes, split( /\s\n/, $list );
105
        $barcodes = [ map { $_ =~ /^\s*$/ ? () : $_ } @$barcodes ];
106
    } else {
107
        @$barcodes = $query->param('barcodes');
108
    }
95
}
109
}
96
110
111
$barcodes = [ uniq @$barcodes ];
112
113
my $template_name = $batch
114
    ? q|circ/circulation_batch_checkouts.tt|
115
    : q|circ/circulation.tt|;
116
97
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
117
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
98
    {
118
    {
99
        template_name   => 'circ/circulation.tt',
119
        template_name   => $template_name,
100
        query           => $query,
120
        query           => $query,
101
        type            => "intranet",
121
        type            => "intranet",
102
        authnotrequired => 0,
122
        authnotrequired => 0,
Lines 325-330 if (@$barcodes) { Link Here
325
345
326
    if ( $error->{'UNKNOWN_BARCODE'}
346
    if ( $error->{'UNKNOWN_BARCODE'}
327
        && C4::Context->preference("itemBarcodeFallbackSearch")
347
        && C4::Context->preference("itemBarcodeFallbackSearch")
348
        && not $batch
328
    )
349
    )
329
    {
350
    {
330
     $template_params->{FALLBACK} = 1;
351
     $template_params->{FALLBACK} = 1;
Lines 404-412 if (@$barcodes) { Link Here
404
    }
425
    }
405
    push @$checkout_infos, $template_params;
426
    push @$checkout_infos, $template_params;
406
  }
427
  }
407
428
  unless ( $batch ) {
408
  $template->param( %{$checkout_infos->[0]} );
429
    $template->param( %{$checkout_infos->[0]} );
409
  $template->param( barcode => $barcodes->[0] );
430
    $template->param( barcode => $barcodes->[0] );
431
  } else {
432
    my $confirmation_needed = grep { $_->{NEEDSCONFIRMATION} } @$checkout_infos;
433
    $template->param(
434
        checkout_infos => $checkout_infos,
435
        confirmation_needed => $confirmation_needed,
436
    );
437
  }
410
}
438
}
411
439
412
# reload the borrower info for the sake of reseting the flags.....
440
# reload the borrower info for the sake of reseting the flags.....
Lines 527-532 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
527
        extendedattributes => $attributes
555
        extendedattributes => $attributes
528
    );
556
    );
529
}
557
}
558
my $view = $batch
559
    ?'batch_checkout_view'
560
    : 'circview';
530
561
531
my @relatives = GetMemberRelatives( $borrower->{'borrowernumber'} );
562
my @relatives = GetMemberRelatives( $borrower->{'borrowernumber'} );
532
my $relatives_issues_count =
563
my $relatives_issues_count =
Lines 559-565 $template->param( Link Here
559
    totaldue          => sprintf('%.2f', $total),
590
    totaldue          => sprintf('%.2f', $total),
560
    inprocess         => $inprocess,
591
    inprocess         => $inprocess,
561
    is_child          => ($borrowernumber && $borrower->{'category_type'} eq 'C'),
592
    is_child          => ($borrowernumber && $borrower->{'category_type'} eq 'C'),
562
    circview => 1,
593
    $view             => 1,
563
    soundon           => C4::Context->preference("SoundOn"),
594
    soundon           => C4::Context->preference("SoundOn"),
564
    fast_cataloging   => $fast_cataloging,
595
    fast_cataloging   => $fast_cataloging,
565
    CircAutoPrintQuickSlip   => C4::Context->preference("CircAutoPrintQuickSlip"),
596
    CircAutoPrintQuickSlip   => C4::Context->preference("CircAutoPrintQuickSlip"),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt (-1 / +272 lines)
Line 0 Link Here
0
- 
1
[% USE Branches %]
2
[% USE KohaDates %]
3
[% IF ( export_remove_fields OR export_with_csv_profile ) %]
4
   [% SET exports_enabled = 1 %]
5
[% END %]
6
[% USE AuthorisedValues %]
7
[% INCLUDE 'doc-head-open.inc' %]
8
[% SET destination = "circ" %]
9
<title>Koha &rsaquo; Circulation
10
[% IF borrowernumber %]
11
  &rsaquo; Checking out a batch to [% INCLUDE 'patron-title.inc' invert_name = 1 %]
12
[% END %]
13
</title>
14
[% INCLUDE 'doc-head-close.inc' %]
15
[% INCLUDE 'calendar.inc' %]
16
[% IF ( UseTablesortForCirc ) %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
17
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
18
[% INCLUDE 'datatables-strings.inc' %]
19
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>[% END %]
20
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
21
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
22
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
23
<script type="text/javascript">
24
//<![CDATA[
25
$(document).ready(function() {
26
        $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, {
27
            "sDom": 't',
28
            "aaSorting": [],
29
            "aoColumnDefs": [
30
                { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false }
31
            ],
32
            "aoColumns": [
33
                { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
34
            ],
35
            "bPaginate": false
36
        }));
37
 });
38
//]]>
39
</script>
40
</head>
41
<body id="circ_circulation_batch_checkouts" class="circ">
42
43
[% INCLUDE 'header.inc' %]
44
[% INCLUDE 'circ-search.inc' %]
45
46
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo;
47
    <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts a batch</a> &rsaquo; [% INCLUDE 'patron-title.inc' %]
48
</div>
49
<div id="doc3" class="yui-t2">
50
51
   <div id="bd">
52
    <div id="yui-main">
53
    <div class="yui-b">
54
55
<div class="yui-g">
56
57
[% UNLESS checkout_infos %]
58
  <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl">
59
    <fieldset id="circ_circulation_issue">
60
      <label for="barcode">Checking out a batch to [% INCLUDE 'patron-title.inc' %]</label>
61
      <fieldset class="rows">
62
        <legend>Use a file</legend>
63
        <ol>
64
          <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
65
        </ol>
66
      </fieldset>
67
      <fieldset class="rows">
68
        <legend>Or list barcodes one by one</legend>
69
        <ol>
70
          <li>
71
            <label for="barcodelist">Barcode list (one barcode per line): </label>
72
            <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
73
          </li>
74
        </ol>
75
      </fieldset>
76
      <input type="hidden" name="op" value="show" />
77
      <fieldset class="action">
78
        <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
79
        <input type="hidden" name="branch" value="[% branch %]" />
80
        <input type="hidden" name="batch" value="1" />
81
        <input type="submit" value="Check out" class="button" />
82
      </fieldset>
83
    </fieldset>
84
  </form>
85
86
[% ELSE %]
87
  [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
88
    <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
89
  [% END %]
90
    <table id="checkout_infos">
91
      <thead>
92
        <tr>
93
          [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
94
            <th></th>
95
          [% END %]
96
          <th>Barcode</th>
97
          <th>Title</th>
98
          <th>Information</th>
99
        </tr>
100
      </thead>
101
      <tbody>
102
        [% FOR checkout_info IN checkout_infos %]
103
          <tr>
104
            [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
105
              <td>
106
                [% IF checkout_info.NEEDSCONFIRMATION %]
107
                  <input type="checkbox" name="barcodes" value="[% checkout_info.barcode %]" checked="checked" />
108
                [% END %]
109
              </td>
110
            [% END %]
111
            <td>[% checkout_info.barcode %]</td>
112
            <td>
113
              <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout_info.item.biblionumber %]&amp;type=intra"><strong>[% checkout_info.item.title |html %][% FOREACH subtitl IN checkout_info.item.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF checkout_info.item.author %], by [% checkout_info.item.author %][% END %][% IF ( checkout_info.itme.itemnotes ) %]- <span class="circ-hlt">[% checkout_info.item.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout_info.item.biblionumber %]&amp;itemnumber=[% checkout_info.item.itemnumber %]#item[% checkout_info.item.itemnumber %]">[% checkout_info.item.barcode %]</a>
114
            </td>
115
            <td>
116
              [% IF checkout_info.NEEDSCONFIRMATION %]
117
                <p class="warn">
118
                  [% IF checkout_info.AGE_RESTRICTION %]
119
                    Age restriction [% checkout_info.AGE_RESTRICTION %]
120
                  [% END %]
121
                  [% IF checkout_info.DEBT %]
122
                    The patron has a debt of [% checkout_info.DEBT %] <!-- Need debt_confirmed -->
123
                  [% END %]
124
                  [% IF checkout_info.RENEW_ISSUE %]
125
                    This Item is currently checked out to this patron. Renew?
126
                  [% END %]
127
                  [% IF checkout_info.RESERVE_WAITING %]
128
                    This Item has been waiting for another patron.
129
                  [% END %]
130
                  [% IF checkout_info.RESERVED %]
131
                    This Item has been on hold for another patron.
132
                  [% END %]
133
                  [% IF checkout_info.ISSUED_TO_ANOTHER %]
134
                    This Item is checked out to another patron.
135
                    [% IF CAN_user_circulate_force_checkout %]
136
                      Check in and check out?
137
                    [% END %]
138
                  [% END %]
139
                  [% IF checkout_info.TOO_MANY %]
140
                    Too many checked out.
141
                  [% END %]
142
                  [% IF checkout_info.BORRNOTSAMEBRANCH %]
143
                    This patrons is from a different library ([% checkout_info.BORRNOTSAMEBRANCH %])</li>
144
                  [% END %]
145
                  [% IF checkout_ino.PATRON_CANT %]
146
                    This patron can't check out this item per library circulation policy.
147
                  [% END %]
148
                  [% IF checkout_info.NOT_FOR_LOAN_FORCING %]
149
                    [% IF checkout_info.itemtype_notforloan %]
150
                      Item type is normally not for loan.
151
                    [% ELSIF checkout_info.item_notforloan %]
152
                      [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
153
                      Item is normally not for loan [% IF item_notforloan_lib %]([% item_notforloan_lib %])[% END %].
154
                    [% END %]
155
                  [% END %]
156
                  [% IF checkout_info.USERBLOCKEDOVERDUE %]
157
                    Patron has [% checkout_info.USERBLOCKEDOVERDUE %] overdue item(s).
158
                  [% END %]
159
                  [% IF checkout_info.ITEM_LOST %]
160
                    This item has been lost with a status of "[% checkout_info.ITEM_LOST %]".
161
                  [% END %]
162
                  [% IF checkout_info.HIGHHOLDS %]
163
                    High demand item. Loan period shortened to [% checkout_info.HIGHHOLDS.duration %] days (due [% checkout_info.HIGHHOLDS.returndate %]).
164
                  [% END %]
165
                  [% IF checkout_info.HIGHHOLDS %] <!-- FIXME -->
166
                      <script language="JavaScript" type="text/javascript">
167
                          $(document).ready(function() {
168
                              $("input[name=duedatespec]:hidden").val('[% checkout_info.HIGHHOLDS.returndate %]');
169
                          });
170
                      </script>
171
                  [% END %]
172
173
                  [% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout or checkout_info.HIGHHOLDS ) %]
174
                      [% IF checkout_info.RESERVED || checkout_info.RESERVE_WAITING %] <!-- arbitrary choice, revert the reserve is not possible-->
175
                      <p>The hold will be canceled.</p>
176
                      [% END %]
177
                  [% END %]
178
                </p>
179
              [% END %]
180
181
182
              [% IF checkout_info.alert.ITEM_LOST || checkout_info.alert.OTHER_CHARGES %]
183
                <p class="info">
184
                  [% IF checkout_info.alert.ITEM_LOST %]
185
                    This item has been lost with a status of "[% checkout_info.alert.ITEM_LOST %]".
186
                  [% END %]
187
                  [% IF checkout_info.alert.OTHER_CHARGES %]
188
                    The patron has unpaid charges for reserves, rentals etc of [% checkout_info.alert.OTHER_CHARGES %].
189
                  [% END %]
190
                </p>
191
              [% END %]
192
193
194
              [% IF checkout_info.IMPOSSIBLE %]
195
                <p class="error">
196
                  [% IF checkout_info.STATS  %]
197
                    Local use recorded
198
                  [% END %]
199
200
                  [% IF checkout_info.NOT_FOR_LOAN %]
201
                    [% IF checkout_info.itemtype_notforloan %]
202
                      Item type not for loan.
203
                    [% ELSIF checkout_info.item_notforloan %]
204
                      [% item_notforloan_lib = AuthorisedValues.GetByCode( checkout_info.authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
205
                      Item not for loan [% IF checkout_info.item_notforloan_lib %]([% checkout_info.item_notforloan_lib %])[% END %].
206
                    [% END %]
207
                  [% END %]
208
                  [% IF checkout_info.WTHDRAWN %]
209
                    Item has been withdrawn
210
                  [% END %]
211
                  [% IF checkout_info.RESTRICTED %]
212
                    Item is restricted
213
                  [% END %]
214
                  [% IF checkout_info.GNA %]
215
                    Patron's address is in doubt
216
                  [% END %]
217
                  [% IF checkout_info.CARD_LOST %]
218
                    Patron's card is lost
219
                  [% END %]
220
                  [% IF checkout_info.DEBARRED %]
221
                    Patron is restricted
222
                  [% END %]
223
                  [% IF checkout_info.NO_MORE_RENEWALS %]
224
                    No more renewals possible
225
                  [% END %]
226
                  [% IF checkout_info.EXPIRED %]
227
                    Patron's card is expired
228
                  [% END %]
229
                  [% IF checkout_info.ITEMNOTSAMEBRANCH %]
230
                    This item belongs to [% Branches.GetName( checkout_info.itemhomebranch ) %] and cannot be checked out from this location.
231
                  [% END %]
232
                  [% IF checkout_info.USERBLOCKEDREMAINING %]
233
                    Patron has had overdue items and is blocked for [% checkout_info.USERBLOCKEDREMAINING %] day(s).
234
                  [% END %]
235
                  [% IF checkout_info.USERBLOCKEDOVERDUE %]
236
                      Checkouts are BLOCKED because patron has overdue items
237
                  [% END %]
238
                  [% IF checkout_info.TOO_MANY %]
239
                    Too many checked out.
240
                  [% END %]
241
                  [% IF checkout_info.UNKNOWN_BARCODE %]
242
                    <li>The barcode was not found [% checkout_info.barcode |html %]
243
                  [% END %]
244
                </p>
245
              [% END %]
246
            </td>
247
          </tr>
248
        [% END %]
249
      </tbody>
250
    </table>
251
252
    [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
253
      <h3>Please confirm checkout</h3>
254
      <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
255
      <input type="hidden" name="issueconfirmed" value="1" />
256
      <input type="hidden" name="debt_confirmed" value="1" />
257
      <input type="hidden" name="branch" value="[% branch %]" />
258
      <input type="hidden" name="batch" value="1" />
259
      <input type="submit" class="approve" value="Checkout or renew" />
260
    </form>
261
    [% END %]
262
263
[% END %]
264
265
</div>
266
</div>
267
</div>
268
<div class="yui-b">
269
[% INCLUDE 'circ-menu.inc' %]
270
</div>
271
</div>
272
[% INCLUDE 'intranet-bottom.inc' %]

Return to bug 11759