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

(-)a/catalogue/itemsearch.pl (-2 / +14 lines)
Lines 108-113 my $itemlost_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_v Link Here
108
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.withdrawn', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
108
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.withdrawn', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
109
my $withdrawn_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
109
my $withdrawn_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
110
110
111
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.damaged', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
112
my $damaged_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : [];
113
111
if ( Koha::MarcSubfieldStructures->search( { frameworkcode => '', kohafield => 'items.new_status' } )->count ) {
114
if ( Koha::MarcSubfieldStructures->search( { frameworkcode => '', kohafield => 'items.new_status' } )->count ) {
112
    $template->param( has_new_status => 1 );
115
    $template->param( has_new_status => 1 );
113
}
116
}
Lines 120-126 if ( defined $format ) { Link Here
120
        filters => [],
123
        filters => [],
121
    };
124
    };
122
125
123
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) {
126
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn damaged)) {
124
        if (my @q = $cgi->multi_param($p)) {
127
        if (my @q = $cgi->multi_param($p)) {
125
            if ($q[0] ne '') {
128
            if ($q[0] ne '') {
126
                my $f = {
129
                my $f = {
Lines 174-180 if ( defined $format ) { Link Here
174
    push @{ $filter->{filters} }, $f;
177
    push @{ $filter->{filters} }, $f;
175
178
176
    # Yes/No parameters
179
    # Yes/No parameters
177
    foreach my $p (qw( damaged new_status )) {
180
    foreach my $p (qw( new_status )) {
178
        my $v = $cgi->param($p) // '';
181
        my $v = $cgi->param($p) // '';
179
        my $f = {
182
        my $f = {
180
            field => $p,
183
            field => $p,
Lines 309-314 foreach my $value (@$withdrawn_values) { Link Here
309
    };
312
    };
310
}
313
}
311
314
315
my @damageds;
316
foreach my $value (@$damaged_values) {
317
    push @damageds, {
318
        value => $value->{authorised_value},
319
        label => $value->{lib},
320
    };
321
}
322
312
my @items_search_fields = GetItemSearchFields();
323
my @items_search_fields = GetItemSearchFields();
313
324
314
my $authorised_values = {};
325
my $authorised_values = {};
Lines 324-329 $template->param( Link Here
324
    ccodes => \@ccodes,
335
    ccodes => \@ccodes,
325
    itemlosts => \@itemlosts,
336
    itemlosts => \@itemlosts,
326
    withdrawns => \@withdrawns,
337
    withdrawns => \@withdrawns,
338
    damageds => \@damageds,
327
    items_search_fields => \@items_search_fields,
339
    items_search_fields => \@items_search_fields,
328
    authorised_values_json => to_json($authorised_values),
340
    authorised_values_json => to_json($authorised_values),
329
);
341
);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc (+2 lines)
Lines 37-42 Link Here
37
[%- delimiter | $raw -%]
37
[%- delimiter | $raw -%]
38
"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | replace('"', '""') | $raw %]"
38
"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | replace('"', '""') | $raw %]"
39
[%- delimiter | $raw -%]
39
[%- delimiter | $raw -%]
40
"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged ) || "" | replace('"', '""') | $raw %]"
41
[%- delimiter | $raw -%]
40
"[% (item.issues || 0) | $raw %]"
42
"[% (item.issues || 0) | $raw %]"
41
[%- delimiter | $raw -%]
43
[%- delimiter | $raw -%]
42
"[% IF item.checkout %][% item.checkout.date_due | $KohaDates | $raw %][% END %]"
44
"[% IF item.checkout %][% item.checkout.date_due | $KohaDates | $raw %][% END %]"
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc (+1 lines)
Lines 29-34 Link Here
29
  "[% AuthorisedValues.GetDescriptionByKohaField( frameworkcode => biblio.frameworkcode, kohafield => 'items.notforloan', authorised_value => item.notforloan) | html %]",
29
  "[% AuthorisedValues.GetDescriptionByKohaField( frameworkcode => biblio.frameworkcode, kohafield => 'items.notforloan', authorised_value => item.notforloan) | html %]",
30
  "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | html %]",
30
  "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | html %]",
31
  "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | html %]",
31
  "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | html %]",
32
  "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged ) || "" | html %]",
32
  "[% (item.issues || 0) | html %]",
33
  "[% (item.issues || 0) | html %]",
33
  "[% IF item.checkout %][% item.checkout.date_due | $KohaDates %][% END %]",
34
  "[% IF item.checkout %][% item.checkout.date_due | $KohaDates %][% END %]",
34
  "[% FILTER escape_quotes ~%]
35
  "[% FILTER escape_quotes ~%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt (-1 / +1 lines)
Lines 3-7 Link Here
3
[%- PROCESS 'i18n.inc' -%]
3
[%- PROCESS 'i18n.inc' -%]
4
[%- SET delimiter = Koha.CSVDelimiter() -%]
4
[%- SET delimiter = Koha.CSVDelimiter() -%]
5
[%- BLOCK -%]
5
[%- BLOCK -%]
6
    "[% t("Title") | html %]"[%- delimiter | $raw -%]"[% t("Publication date") | html %]"[%- delimiter | $raw -%]"[% t("Publisher") | html %]"[%- delimiter | $raw -%]"[% t("Collection") | html %]"[%- delimiter | $raw -%]"[% t("Barcode") | html %]"[%- delimiter | $raw -%]"[% t("Serial enumeration") | html %]"[%- delimiter | $raw -%]"[% t("Call number") | html %]"[%- delimiter | $raw -%]"[% t("Home library") | html %]"[%- delimiter | $raw -%]"[% t("Current library") | html %]"[%- delimiter | $raw -%]"[% t("Shelving location") | html %]"[%- delimiter | $raw -%]"[% t("Item type") | html %]"[%- delimiter | $raw -%]"[% t("Inventory number") | html %]"[%- delimiter | $raw -%]"[% t("Not for loan status") | html %]"[%- delimiter | $raw -%]"[% t("Lost status") | html %]"[%- delimiter | $raw -%]"[% t("Withdrawn status") | html %]"[%- delimiter | $raw -%]"[% t("Checkouts") | html %]"[%- delimiter | $raw -%]"[% t("Due date") | html %]"
6
    "[% t("Title") | html %]"[%- delimiter | $raw -%]"[% t("Publication date") | html %]"[%- delimiter | $raw -%]"[% t("Publisher") | html %]"[%- delimiter | $raw -%]"[% t("Collection") | html %]"[%- delimiter | $raw -%]"[% t("Barcode") | html %]"[%- delimiter | $raw -%]"[% t("Serial enumeration") | html %]"[%- delimiter | $raw -%]"[% t("Call number") | html %]"[%- delimiter | $raw -%]"[% t("Home library") | html %]"[%- delimiter | $raw -%]"[% t("Current library") | html %]"[%- delimiter | $raw -%]"[% t("Shelving location") | html %]"[%- delimiter | $raw -%]"[% t("Item type") | html %]"[%- delimiter | $raw -%]"[% t("Inventory number") | html %]"[%- delimiter | $raw -%]"[% t("Not for loan status") | html %]"[%- delimiter | $raw -%]"[% t("Lost status") | html %]"[%- delimiter | $raw -%]"[% t("Withdrawn status") | html %]"[%- delimiter | $raw -%]"[% t("Damaged status") | html %]"[%- delimiter | $raw -%]"[% t("Checkouts") | html %]"[%- delimiter | $raw -%]"[% t("Due date") | html %]"
7
[%- END -%]
7
[%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt (-3 / +11 lines)
Lines 26-34 Link Here
26
    [%- CASE 'All collection codes' %]<span>All collections</span>
26
    [%- CASE 'All collection codes' %]<span>All collections</span>
27
    [%- CASE 'notforloan' %]<span>Status</span>
27
    [%- CASE 'notforloan' %]<span>Status</span>
28
    [%- CASE 'All statuses' %]<span>All statuses</span>
28
    [%- CASE 'All statuses' %]<span>All statuses</span>
29
    [%- CASE 'damaged' %]<span>Damaged</span>
30
    [%- CASE 'itemlost' %]<span>Lost</span>
29
    [%- CASE 'itemlost' %]<span>Lost</span>
31
    [%- CASE 'withdrawn' %]<span>Withdrawn</span>
30
    [%- CASE 'withdrawn' %]<span>Withdrawn</span>
31
    [%- CASE 'damaged' %]<span>Damaged</span>
32
    [%- CASE 'new_status' %]<span>Is new</span>
32
    [%- CASE 'new_status' %]<span>Is new</span>
33
  [%- END -%]
33
  [%- END -%]
34
[%- END -%]
34
[%- END -%]
Lines 204-209 Link Here
204
            [% IF withdrawns.size %]
204
            [% IF withdrawns.size %]
205
                [% INCLUDE form_field_select name="withdrawn" options = withdrawns empty_option = "All statuses" %]
205
                [% INCLUDE form_field_select name="withdrawn" options = withdrawns empty_option = "All statuses" %]
206
            [% END %]
206
            [% END %]
207
            [% IF damageds.size %]
208
                [% INCLUDE form_field_select name="damaged" options = damageds empty_option = "All statuses" %]
209
            [% END %]
207
            <div class="form-field">
210
            <div class="form-field">
208
                <label class="form-field-label">Availability:</label>
211
                <label class="form-field-label">Availability:</label>
209
                <input type="radio" name="onloan" id="onloan_indifferent" value="" checked="checked"/>
212
                <input type="radio" name="onloan" id="onloan_indifferent" value="" checked="checked"/>
Lines 231-237 Link Here
231
              <input type="text" id="itemcallnumber_to" name="itemcallnumber_to" value="" />
234
              <input type="text" id="itemcallnumber_to" name="itemcallnumber_to" value="" />
232
              <span class="hint">(inclusive)</span>
235
              <span class="hint">(inclusive)</span>
233
            </div>
236
            </div>
234
            [% INCLUDE form_field_radio_yes_no name="damaged" %]
235
            [% IF ( has_new_status ) %]
237
            [% IF ( has_new_status ) %]
236
                [% INCLUDE form_field_radio_yes_no name="new_status" divclass='item-new-status' %]
238
                [% INCLUDE form_field_radio_yes_no name="new_status" divclass='item-new-status' %]
237
            [% END %]
239
            [% END %]
Lines 336-341 Link Here
336
                + '      <th id="items_status">' + _("Not for loan status") + '</th>'
338
                + '      <th id="items_status">' + _("Not for loan status") + '</th>'
337
                + '      <th id="items_itemlost">' + _("Lost status") + '</th>'
339
                + '      <th id="items_itemlost">' + _("Lost status") + '</th>'
338
                + '      <th id="items_widthdrawn">' + _("Withdrawn status") + '</th>'
340
                + '      <th id="items_widthdrawn">' + _("Withdrawn status") + '</th>'
341
                + '      <th id="items_damaged">' + _("Damaged status") + '</th>'
339
                + '      <th id="items_checkouts">' + _("Checkouts") + '</th>'
342
                + '      <th id="items_checkouts">' + _("Checkouts") + '</th>'
340
                + '      <th id="items_date_due">' + _("Due date") + '</th>'
343
                + '      <th id="items_date_due">' + _("Due date") + '</th>'
341
                + '      <th id=""></th>'
344
                + '      <th id=""></th>'
Lines 495-500 Link Here
495
                    { 'sName': 'notforloan' },
498
                    { 'sName': 'notforloan' },
496
                    { 'sName': 'itemlost' },
499
                    { 'sName': 'itemlost' },
497
                    { 'sName': 'withdrawn' },
500
                    { 'sName': 'withdrawn' },
501
                    { 'sName': 'damaged' },
498
                    { 'sName': 'issues' },
502
                    { 'sName': 'issues' },
499
                    { 'sName': 'date_due' },
503
                    { 'sName': 'date_due' },
500
                    { 'sName': 'actions', 'bSortable': false }
504
                    { 'sName': 'actions', 'bSortable': false }
Lines 544-549 Link Here
544
                    [% ELSE %]
548
                    [% ELSE %]
545
                        null,
549
                        null,
546
                    [% END %]
550
                    [% END %]
551
                    [% IF damageds.size %]
552
                        { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => damageds %] },
553
                    [% ELSE %]
554
                        null,
555
                    [% END %]
547
                    { 'type': 'text' },
556
                    { 'type': 'text' },
548
                    { 'type': 'text' },
557
                    { 'type': 'text' },
549
                    null
558
                    null
550
- 

Return to bug 26468