Browse Source

Bug 8246: Allow deleting record if no more items

The "Delete records if no items remain" was only available if the batch
did not contain "too many" items (see MaxItemsForBatch).
This limitation does not make any sense.

Test plan:
1/ Set MaxItemsForBatch=10
2/ Use the batch item deletion to delete 10+ items
3/ Confirm the checkbox "Delete records if no items remain" is displayed
4/ Check it
5/ Launch the job
6/ Run koha qa test tools

Verify that the records without items have been deleted also.

NOTE: My test db only had two biblios with items, so I set
      MaxItemsForBatch=1.
      Before patch, checkbox did not display.
      After patch, checkbox did display.
      This patch merely moves one line out of the IF/ELSE/END
      block, and reindents for more readability. Though, there
      is a missing <p> if you want to get picky.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
3.20.x
Jonathan Druart 9 years ago
committed by Tomas Cohen Arazi
parent
commit
2a8f84817f
  1. 9
      koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt

9
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt

@ -135,9 +135,12 @@ for( x=0; x<allColumns.length; x++ ){
<div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
<div id="jobfailed"></div>
</div>
[% IF ( too_many_items ) %]<input type="submit" name="mainformsubmit" value="Delete ALL submitted items" onclick="return submitBackgroundJob(this.form);" />[% ELSE %]
<input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label><p>
<input type="submit" name="mainformsubmit" value="Delete selected items" onclick="return submitBackgroundJob(this.form);" />[% END %]
<input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label>
[% IF too_many_items %]
<input type="submit" name="mainformsubmit" value="Delete ALL submitted items" onclick="return submitBackgroundJob(this.form);" />
[% ELSE %]
<input type="submit" name="mainformsubmit" value="Delete selected items" onclick="return submitBackgroundJob(this.form);" />
[% END %]
<a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
</fieldset>

Loading…
Cancel
Save