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

(-)a/catalogue/itemsearch.pl (-1 / +19 lines)
Lines 106-111 my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_v Link Here
106
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
106
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
107
my $itemlost_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
107
my $itemlost_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
108
108
109
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.withdrawn', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
110
my $withdrawn_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
111
109
if (scalar keys %params > 0) {
112
if (scalar keys %params > 0) {
110
    # Parameters given, it's a search
113
    # Parameters given, it's a search
111
114
Lines 114-120 if (scalar keys %params > 0) { Link Here
114
        filters => [],
117
        filters => [],
115
    };
118
    };
116
119
117
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost)) {
120
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) {
118
        if (my @q = $cgi->multi_param($p)) {
121
        if (my @q = $cgi->multi_param($p)) {
119
            if ($q[0] ne '') {
122
            if ($q[0] ne '') {
120
                my $f = {
123
                my $f = {
Lines 241-246 if (scalar keys %params > 0) { Link Here
241
            $itemlost_map->{$il_value->{authorised_value}} = $il_value->{lib};
244
            $itemlost_map->{$il_value->{authorised_value}} = $il_value->{lib};
242
        }
245
        }
243
246
247
        # Get withdrawn labels
248
        my $withdrawn_map = {};
249
        foreach my $wd_value (@$withdrawn_values) {
250
            $withdrawn_map->{$wd_value->{authorised_value}} = $wd_value->{lib};
251
        }
252
244
        foreach my $item (@$results) {
253
        foreach my $item (@$results) {
245
            my $biblio = Koha::Biblios->find( $item->{biblionumber} );
254
            my $biblio = Koha::Biblios->find( $item->{biblionumber} );
246
            $item->{biblio} = $biblio;
255
            $item->{biblio} = $biblio;
Lines 321-326 foreach my $value (@$itemlost_values) { Link Here
321
    };
330
    };
322
}
331
}
323
332
333
my @withdrawns;
334
foreach my $value (@$withdrawn_values) {
335
    push @withdrawns, {
336
        value => $value->{authorised_value},
337
        label => $value->{lib},
338
    };
339
}
340
324
my @items_search_fields = GetItemSearchFields();
341
my @items_search_fields = GetItemSearchFields();
325
342
326
my $authorised_values = {};
343
my $authorised_values = {};
Lines 337-342 $template->param( Link Here
337
    ccodes => \@ccodes,
354
    ccodes => \@ccodes,
338
    notforloans => \@notforloans,
355
    notforloans => \@notforloans,
339
    itemlosts => \@itemlosts,
356
    itemlosts => \@itemlosts,
357
    withdrawns => \@withdrawns,
340
    items_search_fields => \@items_search_fields,
358
    items_search_fields => \@items_search_fields,
341
    authorised_values_json => to_json($authorised_values),
359
    authorised_values_json => to_json($authorised_values),
342
);
360
);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc (-1 / +1 lines)
Lines 4-7 Link Here
4
[% USE AuthorisedValues %]
4
[% USE AuthorisedValues %]
5
[%- SET biblio = item.biblio -%]
5
[%- SET biblio = item.biblio -%]
6
[%- SET biblioitem = item.biblioitem -%]
6
[%- SET biblioitem = item.biblioitem -%]
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 %]"
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 %]","[% AuthorisedValues.GetByCode( 'WITHDRAWN', item.withdrawn ) || "" | html %]", "[% (item.issues || 0) | html %]"
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc (+1 lines)
Lines 23-28 Link Here
23
  "[% item.stocknumber | html %]",
23
  "[% item.stocknumber | html %]",
24
  "[% item.status | html %]",
24
  "[% item.status | html %]",
25
  "[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) || "" | html %]",
25
  "[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) || "" | html %]",
26
  "[% AuthorisedValues.GetByCode( 'WITHDRAWN', item.withdrawn ) || "" | html %]",
26
  "[% (item.issues || 0) | html %]",
27
  "[% (item.issues || 0) | html %]",
27
  "[% FILTER escape_quotes ~%]
28
  "[% FILTER escape_quotes ~%]
28
    <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>
29
    <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, Not for loan status, Lost status, Checkouts[%- END -%]
1
[%- BLOCK -%]Title, Publication date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Itemtype, Inventory number, Not for loan status, Lost status, Withdrawn status, Checkouts[%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt (-1 / +11 lines)
Lines 27-32 Link Here
27
    [% CASE 'All statuses' %]<span>All statuses</span>
27
    [% CASE 'All statuses' %]<span>All statuses</span>
28
    [% CASE 'damaged' %]<span>Damaged</span>
28
    [% CASE 'damaged' %]<span>Damaged</span>
29
    [% CASE 'itemlost' %]<span>Lost</span>
29
    [% CASE 'itemlost' %]<span>Lost</span>
30
    [% CASE 'withdrawn' %]<span>Withdrawn</span>
30
  [% END %]
31
  [% END %]
31
[% END %]
32
[% END %]
32
33
Lines 158-163 Link Here
158
            [% IF itemlosts.size %]
159
            [% IF itemlosts.size %]
159
                [% INCLUDE form_field_select name="itemlost" options = itemlosts empty_option = "All statuses" %]
160
                [% INCLUDE form_field_select name="itemlost" options = itemlosts empty_option = "All statuses" %]
160
            [% END %]
161
            [% END %]
162
            [% IF withdrawns.size %]
163
                [% INCLUDE form_field_select name="withdrawn" options = withdrawns empty_option = "All statuses" %]
164
            [% END %]
161
          </fieldset>
165
          </fieldset>
162
          <fieldset>
166
          <fieldset>
163
            [% INCLUDE form_field_select_text %]
167
            [% INCLUDE form_field_select_text %]
Lines 275-280 Link Here
275
                + '      <th id="item_inventoryno">' + _("Inventory number") + '</th>'
279
                + '      <th id="item_inventoryno">' + _("Inventory number") + '</th>'
276
                + '      <th id="items_status">' + _("Not for loan status") + '</th>'
280
                + '      <th id="items_status">' + _("Not for loan status") + '</th>'
277
                + '      <th id="items_itemlost">' + _("Lost status") + '</th>'
281
                + '      <th id="items_itemlost">' + _("Lost status") + '</th>'
282
                + '      <th id="items_widthdrawn">' + _("Withdrawn status") + '</th>'
278
                + '      <th id="items_checkouts">' + _("Checkouts") + '</th>'
283
                + '      <th id="items_checkouts">' + _("Checkouts") + '</th>'
279
                + '      <th id=""></th>'
284
                + '      <th id=""></th>'
280
                + '    </tr>'
285
                + '    </tr>'
Lines 378-383 Link Here
378
                    { 'sName': 'stocknumber' },
383
                    { 'sName': 'stocknumber' },
379
                    { 'sName': 'notforloan' },
384
                    { 'sName': 'notforloan' },
380
                    { 'sName': 'itemlost' },
385
                    { 'sName': 'itemlost' },
386
                    { 'sName': 'withdrawn' },
381
                    { 'sName': 'issues' },
387
                    { 'sName': 'issues' },
382
                    { 'sName': 'checkbox', 'bSortable': false }
388
                    { 'sName': 'checkbox', 'bSortable': false }
383
                ],
389
                ],
Lines 418-423 Link Here
418
                    [% ELSE %]
424
                    [% ELSE %]
419
                        null,
425
                        null,
420
                    [% END %]
426
                    [% END %]
427
                    [% IF withdrawns.size %]
428
                        { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => withdrawns %] },
429
                    [% ELSE %]
430
                        null,
431
                    [% END %]
421
                    { 'type': 'text' },
432
                    { 'type': 'text' },
422
                    null
433
                    null
423
                ]
434
                ]
424
- 

Return to bug 23543