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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt (-3 / +17 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% SET footerjs = 1 %]
3
[% SET footerjs = 1 %]
4
[% PROCESS 'i18n.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Tools &rsaquo; Batch item deletion</title>
6
<title>Koha &rsaquo; Tools &rsaquo; Batch item deletion</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
Lines 108-116 Link Here
108
              <tr>
109
              <tr>
109
                [% IF show %]
110
                [% IF show %]
110
                  [% IF item_loo.nomod %]
111
                  [% IF item_loo.nomod %]
111
                    <td class="error">Cannot edit</td>
112
                    <td class="error">Cannot delete</td>
112
                  [% ELSE %]
113
                [% ELSE %]
113
                    <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" checked="checked" data-is-onloan="[% item_loo.onloan | html %]" /></td>
114
                    [% SET can_be_deleted = item_loo.item.safe_to_delete %]
115
                    [% IF can_be_deleted == 1 %]
116
                        <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" checked="checked" /></td>
117
                    [% ELSE %]
118
                        [% SWITCH can_be_deleted %]
119
                        [% CASE "book_on_loan" %][% SET cannot_delete_reason = t("Item is checked out") %]
120
                        [% CASE "not_same_branch" %][% SET cannot_delete_reason = t("Item does not belongs to your library") %]
121
                        [% CASE "book_reserved" %][% SET cannot_delete_reason = t("Item has a waiting hold") %]
122
                        [% CASE "linked_analytics" %][% SET cannot_delete_reason = t("Item has linked analytics") %]
123
                        [% CASE %][% SET cannot_delete_reason = t("Unknown reason") %]
124
                        [% END %]
125
126
                        <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber | html %]" id="row[% item_loo.itemnumber | html %]" disabled="disabled" title="[% cannot_delete_reason %]"/></td>
127
                    [% END %]
114
                  [% END %]
128
                  [% END %]
115
                [% ELSE %]
129
                [% ELSE %]
116
                  <td>&nbsp;</td>
130
                  <td>&nbsp;</td>
(-)a/tools/batchMod.pl (-1 / +2 lines)
Lines 633-638 sub BuildItemsData{ Link Here
633
            $this_row{biblionumber} = $biblio->biblionumber;
633
            $this_row{biblionumber} = $biblio->biblionumber;
634
            $this_row{holds}        = $biblio->holds->count;
634
            $this_row{holds}        = $biblio->holds->count;
635
            $this_row{item_holds}   = Koha::Holds->search( { itemnumber => $itemnumber } )->count;
635
            $this_row{item_holds}   = Koha::Holds->search( { itemnumber => $itemnumber } )->count;
636
            $this_row{item}         = Koha::Items->find($itemnumber);
636
637
637
			if (%this_row) {
638
			if (%this_row) {
638
				push(@big_array, \%this_row);
639
				push(@big_array, \%this_row);
Lines 658-663 sub BuildItemsData{ Link Here
658
      $row_data{biblionumber} = $row->{biblionumber};
659
      $row_data{biblionumber} = $row->{biblionumber};
659
      $row_data{holds}        = $row->{holds};
660
      $row_data{holds}        = $row->{holds};
660
      $row_data{item_holds}   = $row->{item_holds};
661
      $row_data{item_holds}   = $row->{item_holds};
662
      $row_data{item}         = $row->{item};
661
      my $is_on_loan = C4::Circulation::IsItemIssued( $row->{itemnumber} );
663
      my $is_on_loan = C4::Circulation::IsItemIssued( $row->{itemnumber} );
662
      $row_data{onloan} = $is_on_loan ? 1 : 0;
664
      $row_data{onloan} = $is_on_loan ? 1 : 0;
663
			push(@item_value_loop,\%row_data);
665
			push(@item_value_loop,\%row_data);
664
- 

Return to bug 8132