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

(-)a/catalogue/itemsearch.pl (-3 / +21 lines)
Lines 63-69 if (defined $format and $format eq 'json') { Link Here
63
                push @f, $columns[$i];
63
                push @f, $columns[$i];
64
                push @c, 'and';
64
                push @c, 'and';
65
65
66
                if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location itype notforloan ) ) {
66
                if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location itype notforloan itemlost ) ) {
67
                    push @q, "$word";
67
                    push @q, "$word";
68
                    push @op, '=';
68
                    push @op, '=';
69
                } else {
69
                } else {
Lines 103-108 my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised Link Here
103
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
103
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
104
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
104
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
105
105
106
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
107
my $itemlost_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
108
106
if (scalar keys %params > 0) {
109
if (scalar keys %params > 0) {
107
    # Parameters given, it's a search
110
    # Parameters given, it's a search
108
111
Lines 111-117 if (scalar keys %params > 0) { Link Here
111
        filters => [],
114
        filters => [],
112
    };
115
    };
113
116
114
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan)) {
117
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost)) {
115
        if (my @q = $cgi->multi_param($p)) {
118
        if (my @q = $cgi->multi_param($p)) {
116
            if ($q[0] ne '') {
119
            if ($q[0] ne '') {
117
                my $f = {
120
                my $f = {
Lines 164-170 if (scalar keys %params > 0) { Link Here
164
    push @{ $filter->{filters} }, $f;
167
    push @{ $filter->{filters} }, $f;
165
168
166
    # Yes/No parameters
169
    # Yes/No parameters
167
    foreach my $p (qw(damaged itemlost)) {
170
    foreach my $p (qw( damaged )) {
168
        my $v = $cgi->param($p) // '';
171
        my $v = $cgi->param($p) // '';
169
        my $f = {
172
        my $f = {
170
            field => $p,
173
            field => $p,
Lines 232-237 if (scalar keys %params > 0) { Link Here
232
            $location_map->{$loc_value->{authorised_value}} = $loc_value->{lib};
235
            $location_map->{$loc_value->{authorised_value}} = $loc_value->{lib};
233
        }
236
        }
234
237
238
        # Get itemlost labels
239
        my $itemlost_map = {};
240
        foreach my $il_value (@$itemlost_values) {
241
            $itemlost_map->{$il_value->{authorised_value}} = $il_value->{lib};
242
        }
243
235
        foreach my $item (@$results) {
244
        foreach my $item (@$results) {
236
            my $biblio = Koha::Biblios->find( $item->{biblionumber} );
245
            my $biblio = Koha::Biblios->find( $item->{biblionumber} );
237
            $item->{biblio} = $biblio;
246
            $item->{biblio} = $biblio;
Lines 304-309 foreach my $value (@$notforloan_values) { Link Here
304
    };
313
    };
305
}
314
}
306
315
316
my @itemlosts;
317
foreach my $value (@$itemlost_values) {
318
    push @itemlosts, {
319
        value => $value->{authorised_value},
320
        label => $value->{lib},
321
    };
322
}
323
307
my @items_search_fields = GetItemSearchFields();
324
my @items_search_fields = GetItemSearchFields();
308
325
309
my $authorised_values = {};
326
my $authorised_values = {};
Lines 319-324 $template->param( Link Here
319
    itemtypes => \@itemtypes,
336
    itemtypes => \@itemtypes,
320
    ccodes => \@ccodes,
337
    ccodes => \@ccodes,
321
    notforloans => \@notforloans,
338
    notforloans => \@notforloans,
339
    itemlosts => \@itemlosts,
322
    items_search_fields => \@items_search_fields,
340
    items_search_fields => \@items_search_fields,
323
    authorised_values_json => to_json($authorised_values),
341
    authorised_values_json => to_json($authorised_values),
324
);
342
);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc (-1 / +2 lines)
Lines 1-6 Link Here
1
[%- USE Branches -%]
1
[%- USE Branches -%]
2
[%- USE Koha -%]
2
[%- USE Koha -%]
3
[%- USE ItemTypes -%]
3
[%- USE ItemTypes -%]
4
[% USE AuthorisedValues %]
4
[%- SET biblio = item.biblio -%]
5
[%- SET biblio = item.biblio -%]
5
[%- SET biblioitem = item.biblioitem -%]
6
[%- SET biblioitem = item.biblioitem -%]
6
"[% biblio.title | html %] [% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by [% END %][% biblio.author | html %]", "[% (biblioitem.publicationyear || biblio.copyrightdate) | html %]", "[% biblioitem.publishercode | html %]", "[% biblioitem.collectiontitle | html %]", "[% item.barcode | html %]", "[% item.itemcallnumber | html %]", "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]", "[% item.location | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]", "[% item.stocknumber | html %]", "[% item.status | html %]", "[% (item.issues || 0) | html %]"
7
"[% biblio.title | html %] [% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by [% END %][% biblio.author | html %]", "[% (biblioitem.publicationyear || biblio.copyrightdate) | html %]", "[% biblioitem.publishercode | html %]", "[% AuthorisedValues.GetByCode( 'CCODE', item.ccode ) | html %]", "[% item.barcode | html %]", "[% item.itemcallnumber | html %]", "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]", "[% item.location | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]", "[% item.stocknumber | html %]", "[% item.status | html %]","[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) | html %]", "[% (item.issues || 0) | html %]"
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc (+1 lines)
Lines 21-26 Link Here
21
  "[% ItemTypes.GetDescription(item.itype) | html %]",
21
  "[% ItemTypes.GetDescription(item.itype) | html %]",
22
  "[% item.stocknumber | html %]",
22
  "[% item.stocknumber | html %]",
23
  "[% item.status | html %]",
23
  "[% item.status | html %]",
24
  "[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) | html %]",
24
  "[% (item.issues || 0) | html %]",
25
  "[% (item.issues || 0) | html %]",
25
  "[% FILTER escape_quotes ~%]
26
  "[% FILTER escape_quotes ~%]
26
    <div class="btn-group dropup"><button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-pencil"></i> Edit <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | uri %]&itemnumber=[% item.itemnumber | uri %]">Edit item</a></li> <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% item.biblionumber | html %]">Edit record</a></li> </ul> </div>
27
    <div class="btn-group dropup"><button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-pencil"></i> Edit <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | uri %]&itemnumber=[% item.itemnumber | uri %]">Edit item</a></li> <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% item.biblionumber | html %]">Edit record</a></li> </ul> </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt (-1 / +1 lines)
Line 1 Link Here
1
[%- BLOCK -%]Title, Publication date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Itemtype, Inventory number, Status, Checkouts[%- END -%]
1
[%- BLOCK -%]Title, Publication date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Itemtype, Inventory number, Status, Lost, Checkouts[%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt (-3 / +11 lines)
Lines 155-160 Link Here
155
            [% IF notforloans.size %]
155
            [% IF notforloans.size %]
156
                [% INCLUDE form_field_select name="notforloan" options = notforloans empty_option = "All statuses" %]
156
                [% INCLUDE form_field_select name="notforloan" options = notforloans empty_option = "All statuses" %]
157
            [% END %]
157
            [% END %]
158
            [% IF itemlosts.size %]
159
                [% INCLUDE form_field_select name="itemlost" options = itemlosts empty_option = "All statuses" %]
160
            [% END %]
158
          </fieldset>
161
          </fieldset>
159
          <fieldset>
162
          <fieldset>
160
            [% INCLUDE form_field_select_text %]
163
            [% INCLUDE form_field_select_text %]
Lines 174-180 Link Here
174
              <span class="hint">(inclusive)</span>
177
              <span class="hint">(inclusive)</span>
175
            </div>
178
            </div>
176
            [% INCLUDE form_field_radio_yes_no name="damaged" %]
179
            [% INCLUDE form_field_radio_yes_no name="damaged" %]
177
            [% INCLUDE form_field_radio_yes_no name="itemlost" %]
178
            <div class="form-field">
180
            <div class="form-field">
179
              <label class="form-field-label" for="issues_op">Checkout count:</label>
181
              <label class="form-field-label" for="issues_op">Checkout count:</label>
180
              <select id="issues_op" name="issues_op">
182
              <select id="issues_op" name="issues_op">
Lines 272-277 Link Here
272
                + '      <th id="items_itype">' + _("Itemtype") + '</th>'
274
                + '      <th id="items_itype">' + _("Itemtype") + '</th>'
273
                + '      <th id="item_inventoryno">' + _("Inventory number") + '</th>'
275
                + '      <th id="item_inventoryno">' + _("Inventory number") + '</th>'
274
                + '      <th id="items_status">' + _("Status") + '</th>'
276
                + '      <th id="items_status">' + _("Status") + '</th>'
277
                + '      <th id="items_itemlost">' + _("Lost") + '</th>'
275
                + '      <th id="items_checkouts">' + _("Checkouts") + '</th>'
278
                + '      <th id="items_checkouts">' + _("Checkouts") + '</th>'
276
                + '      <th id=""></th>'
279
                + '      <th id=""></th>'
277
                + '    </tr>'
280
                + '    </tr>'
Lines 365-371 Link Here
365
                    { 'sName': 'title' },
368
                    { 'sName': 'title' },
366
                    { 'sName': 'publicationyear' },
369
                    { 'sName': 'publicationyear' },
367
                    { 'sName': 'publishercode' },
370
                    { 'sName': 'publishercode' },
368
          { 'sName': 'ccode' },
371
                    { 'sName': 'ccode' },
369
                    { 'sName': 'barcode' },
372
                    { 'sName': 'barcode' },
370
                    { 'sName': 'itemcallnumber' },
373
                    { 'sName': 'itemcallnumber' },
371
                    { 'sName': 'homebranch' },
374
                    { 'sName': 'homebranch' },
Lines 374-379 Link Here
374
                    { 'sName': 'itype'},
377
                    { 'sName': 'itype'},
375
                    { 'sName': 'stocknumber' },
378
                    { 'sName': 'stocknumber' },
376
                    { 'sName': 'notforloan' },
379
                    { 'sName': 'notforloan' },
380
                    { 'sName': 'itemlost' },
377
                    { 'sName': 'issues' },
381
                    { 'sName': 'issues' },
378
                    { 'sName': 'checkbox', 'bSortable': false }
382
                    { 'sName': 'checkbox', 'bSortable': false }
379
                ],
383
                ],
Lines 409-414 Link Here
409
                    [% ELSE %]
413
                    [% ELSE %]
410
                        null,
414
                        null,
411
                    [% END %]
415
                    [% END %]
416
                    [% IF itemlosts.size %]
417
                        { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => itemlosts %] },
418
                    [% ELSE %]
419
                        null,
420
                    [% END %]
412
                    { 'type': 'text' },
421
                    { 'type': 'text' },
413
                    null
422
                    null
414
                ]
423
                ]
415
- 

Return to bug 22424