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

(-)a/Koha/Acquisition/Order.pm (-1 / +1 lines)
Lines 131-137 sub cancel { Link Here
131
            $self->add_message(
131
            $self->add_message(
132
                {
132
                {
133
                    message => 'error_delitem',
133
                    message => 'error_delitem',
134
                    payload => { item => $item, reason => @{$deleted->messages}[0]->messages }
134
                    payload => { item => $item, reason => @{$deleted->messages}[0]->message }
135
                }
135
                }
136
            );
136
            );
137
        }
137
        }
(-)a/Koha/BackgroundJob/BatchDeleteBiblio.pm (-1 / +1 lines)
Lines 119-125 sub process { Link Here
119
                    code => 'item_not_deleted',
119
                    code => 'item_not_deleted',
120
                    biblionumber => $biblionumber,
120
                    biblionumber => $biblionumber,
121
                    itemnumber => $item->itemnumber,
121
                    itemnumber => $item->itemnumber,
122
                    error => @{$deleted->messages}[0]->messages,
122
                    error => @{$deleted->messages}[0]->message,
123
                };
123
                };
124
                $schema->storage->txn_rollback;
124
                $schema->storage->txn_rollback;
125
                $job->progress( ++$job_progress )->store;
125
                $job->progress( ++$job_progress )->store;
(-)a/Koha/BackgroundJob/BatchDeleteItem.pm (-1 / +1 lines)
Lines 126-132 sub process { Link Here
126
                            biblionumber => $item->biblionumber,
126
                            biblionumber => $item->biblionumber,
127
                            barcode      => $item->barcode,
127
                            barcode      => $item->barcode,
128
                            title        => $item->biblio->title,
128
                            title        => $item->biblio->title,
129
                            reason       => $return,
129
                            reason       => @{$return->messages}[0]->message,
130
                          };
130
                          };
131
131
132
                        next;
132
                        next;
(-)a/Koha/UI/Table/Builder/Items.pm (-1 / +8 lines)
Lines 106-114 Build the headers given the items' info. Link Here
106
sub _build_headers {
106
sub _build_headers {
107
    my ( $self, $items ) = @_;
107
    my ( $self, $items ) = @_;
108
108
109
    use Data::Printer colored => 1; warn p $items;
109
    my @witness_attributes = uniq map {
110
    my @witness_attributes = uniq map {
110
        my $item = $_;
111
        my $item = $_;
111
        map { defined $item->{$_} && $item->{$_} ne "" ? $_ : () } keys %$item
112
        map {
113
            defined $item->{$_}
114
              && !ref( $item->{$_} ) # biblio and safe_to_delete are objects
115
              && $item->{$_} ne ""
116
              ? $_
117
              : ()
118
          } keys %$item
112
    } @$items;
119
    } @$items;
113
120
114
    my ( $itemtag, $itemsubfield ) =
121
    my ( $itemtag, $itemsubfield ) =
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-4 / +3 lines)
Lines 260-277 Link Here
260
                        [% UNLESS can_be_edited %]
260
                        [% UNLESS can_be_edited %]
261
                            <td class="error">Cannot delete</td>
261
                            <td class="error">Cannot delete</td>
262
                        [% ELSE %]
262
                        [% ELSE %]
263
                            [% IF item.safe_to_delete == 1 %]
263
                            [% IF item.safe_to_delete %]
264
                                <td><input type="checkbox" name="itemnumber" value="[% item.itemnumber | html %]" id="row[% item.itemnumber | html %]" checked="checked" /></td>
264
                                <td><input type="checkbox" name="itemnumber" value="[% item.itemnumber | html %]" id="row[% item.itemnumber | html %]" checked="checked" /></td>
265
                            [% ELSE %]
265
                            [% ELSE %]
266
                                [% SET messages = item.safe_to_delete.messages %]
266
                                [% SET messages = item.safe_to_delete.messages %]
267
                                [% FOR m IN messages %]
267
                                [% FOR m IN messages %]
268
                                    [% SWITCH m %]
268
                                    [% SWITCH m.message %]
269
                                    [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %]
269
                                    [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %]
270
                                    [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belong to your library") %]
270
                                    [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belong to your library") %]
271
                                    [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %]
271
                                    [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %]
272
                                    [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %]
272
                                    [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %]
273
                                    [% CASE "last_item_for_hold" %][% SET cannot_delete_reason = t("Last item for bibliographic record with biblio-level hold on it") %]
273
                                    [% CASE "last_item_for_hold" %][% SET cannot_delete_reason = t("Last item for bibliographic record with biblio-level hold on it") %]
274
                                    [% CASE %][% SET cannot_delete_reason = t("Unknown reason") _ '(' _ item.safe_to_delete _ ')' %]
274
                                    [% CASE %][% SET cannot_delete_reason = t("Unknown reason") _ '(' _ m.message _ ')' %]
275
                                    [% END %]
275
                                    [% END %]
276
                                [% END %]
276
                                [% END %]
277
277
278
- 

Return to bug 29788