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

(-)a/catalogue/itemsearch.pl (-7 / +26 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(
112
    {
113
        frameworkcode    => '', kohafield => 'items.damaged',
114
        authorised_value => [ -and => { '!=' => undef }, { '!=' => '' } ]
115
    }
116
);
117
my $damaged_values = $mss->count ? GetAuthorisedValues( $mss->next->authorised_value ) : [];
118
111
if ( Koha::MarcSubfieldStructures->search( { frameworkcode => '', kohafield => 'items.new_status' } )->count ) {
119
if ( Koha::MarcSubfieldStructures->search( { frameworkcode => '', kohafield => 'items.new_status' } )->count ) {
112
    $template->param( has_new_status => 1 );
120
    $template->param( has_new_status => 1 );
113
}
121
}
Lines 120-133 if ( defined $format ) { Link Here
120
        filters => [],
128
        filters => [],
121
    };
129
    };
122
130
123
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) {
131
    foreach my $p (
124
        if (my @q = $cgi->multi_param($p)) {
132
        qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn damaged))
125
            if ($q[0] ne '') {
133
    {
134
        if ( my @q = $cgi->multi_param($p) ) {
135
            if ( $q[0] ne '' ) {
126
                my $f = {
136
                my $f = {
127
                    field => $p,
137
                    field => $p,
128
                    query => \@q,
138
                    query => \@q,
129
                };
139
                };
130
                if (my $op = scalar $cgi->param($p . '_op')) {
140
                if ( my $op = scalar $cgi->param( $p . '_op' ) ) {
131
                    $f->{operator} = $op;
141
                    $f->{operator} = $op;
132
                }
142
                }
133
                push @{ $filter->{filters} }, $f;
143
                push @{ $filter->{filters} }, $f;
Lines 174-180 if ( defined $format ) { Link Here
174
    push @{ $filter->{filters} }, $f;
184
    push @{ $filter->{filters} }, $f;
175
185
176
    # Yes/No parameters
186
    # Yes/No parameters
177
    foreach my $p (qw( damaged new_status )) {
187
    foreach my $p (qw( new_status )) {
178
        my $v = $cgi->param($p) // '';
188
        my $v = $cgi->param($p) // '';
179
        my $f = {
189
        my $f = {
180
            field => $p,
190
            field => $p,
Lines 183-192 if ( defined $format ) { Link Here
183
        if ( $p eq 'new_status' ) {
193
        if ( $p eq 'new_status' ) {
184
            $f->{ifnull} = 0;
194
            $f->{ifnull} = 0;
185
        }
195
        }
186
        if ($v eq 'yes') {
196
        if ( $v eq 'yes' ) {
187
            $f->{operator} = '!=';
197
            $f->{operator} = '!=';
188
            push @{ $filter->{filters} }, $f;
198
            push @{ $filter->{filters} }, $f;
189
        } elsif ($v eq 'no') {
199
        } elsif ( $v eq 'no' ) {
190
            $f->{operator} = '=';
200
            $f->{operator} = '=';
191
            push @{ $filter->{filters} }, $f;
201
            push @{ $filter->{filters} }, $f;
192
        }
202
        }
Lines 309-314 foreach my $value (@$withdrawn_values) { Link Here
309
    };
319
    };
310
}
320
}
311
321
322
my @damageds;
323
foreach my $value (@$damaged_values) {
324
    push @damageds, {
325
        value => $value->{authorised_value},
326
        label => $value->{lib},
327
    };
328
}
329
312
my @items_search_fields = GetItemSearchFields();
330
my @items_search_fields = GetItemSearchFields();
313
331
314
my $authorised_values = {};
332
my $authorised_values = {};
Lines 324-329 $template->param( Link Here
324
    ccodes => \@ccodes,
342
    ccodes => \@ccodes,
325
    itemlosts => \@itemlosts,
343
    itemlosts => \@itemlosts,
326
    withdrawns => \@withdrawns,
344
    withdrawns => \@withdrawns,
345
    damageds => \@damageds,
327
    items_search_fields => \@items_search_fields,
346
    items_search_fields => \@items_search_fields,
328
    authorised_values_json => to_json($authorised_values),
347
    authorised_values_json => to_json($authorised_values),
329
);
348
);
(-)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 383-388 Link Here
383
                + '      <th id="items_status">' + _("Not for loan status") + '</th>'
385
                + '      <th id="items_status">' + _("Not for loan status") + '</th>'
384
                + '      <th id="items_itemlost">' + _("Lost status") + '</th>'
386
                + '      <th id="items_itemlost">' + _("Lost status") + '</th>'
385
                + '      <th id="items_widthdrawn">' + _("Withdrawn status") + '</th>'
387
                + '      <th id="items_widthdrawn">' + _("Withdrawn status") + '</th>'
388
                + '      <th id="items_damaged">' + _("Damaged status") + '</th>'
386
                + '      <th id="items_checkouts">' + _("Checkouts") + '</th>'
389
                + '      <th id="items_checkouts">' + _("Checkouts") + '</th>'
387
                + '      <th id="items_date_due">' + _("Due date") + '</th>'
390
                + '      <th id="items_date_due">' + _("Due date") + '</th>'
388
                + '      <th id=""></th>'
391
                + '      <th id=""></th>'
Lines 506-511 Link Here
506
                    { 'sName': 'notforloan' },
509
                    { 'sName': 'notforloan' },
507
                    { 'sName': 'itemlost' },
510
                    { 'sName': 'itemlost' },
508
                    { 'sName': 'withdrawn' },
511
                    { 'sName': 'withdrawn' },
512
                    { 'sName': 'damaged' },
509
                    { 'sName': 'issues' },
513
                    { 'sName': 'issues' },
510
                    { 'sName': 'date_due' },
514
                    { 'sName': 'date_due' },
511
                    { 'sName': 'actions', 'bSortable': false }
515
                    { 'sName': 'actions', 'bSortable': false }
Lines 558-563 Link Here
558
                    [% ELSE %]
562
                    [% ELSE %]
559
                        null,
563
                        null,
560
                    [% END %]
564
                    [% END %]
565
                    [% IF damageds.size %]
566
                        { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => damageds %] },
567
                    [% ELSE %]
568
                        null,
569
                    [% END %]
561
                    { 'type': 'text' },
570
                    { 'type': 'text' },
562
                    { 'type': 'text' },
571
                    { 'type': 'text' },
563
                    null
572
                    null
564
- 

Return to bug 26468