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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt (-11 / +1 lines)
Lines 117-132 Link Here
117
        </ul>
117
        </ul>
118
118
119
        <br />
119
        <br />
120
            [% IF ( totalToDelete ) %]
121
                <fieldset><legend>What do you want to do for deleted patrons?</legend>
122
                <label for="delete">Permanently delete these patrons</label>
123
                <input id="delete" type="radio" name="radio" value="delete" checked="checked" />
124
125
                <label for="trash">Move these patrons to the trash</label>
126
                <input id="trash" type="radio" name="radio" value="trash" />
127
                <input type="hidden" name="do_delete" value="[% totalToDelete %]" /></fieldset>
128
129
            [% END %]
130
            [% IF ( totalToAnonymize ) %]
120
            [% IF ( totalToAnonymize ) %]
131
                Checkout history for [% totalToAnonymize %] patrons will be anonymized
121
                Checkout history for [% totalToAnonymize %] patrons will be anonymized
132
                <input type="hidden" name="do_anonym" value="[% totalToAnonymize %]" />
122
                <input type="hidden" name="do_anonym" value="[% totalToAnonymize %]" />
Lines 138-144 Link Here
138
            <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry %]" />
128
            <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry %]" />
139
            <input type="hidden" name="borrower_categorycode" value="[% borrower_categorycode %]" />
129
            <input type="hidden" name="borrower_categorycode" value="[% borrower_categorycode %]" />
140
    </fieldset>
130
    </fieldset>
141
    <fieldset class="action"><input type="submit" value="Finish" /> <a class="cancel" href="/cgi-bin/koha/tools/cleanborrowers.pl">Cancel</a></fieldset>
131
    <fieldset class="action"><input type="submit" value="Commit" /> <a class="cancel" href="/cgi-bin/koha/tools/cleanborrowers.pl">Cancel</a></fieldset>
142
        </form>
132
        </form>
143
</div>
133
</div>
144
<!-- STEP 2 END -->
134
<!-- STEP 2 END -->
(-)a/tools/cleanborrowers.pl (-15 / +6 lines)
Lines 122-141 if ( $params->{'step3'} ) { Link Here
122
        my $membersToDelete =
122
        my $membersToDelete =
123
          GetBorrowersToExpunge( { not_borrowered_since => $filterdate1, expired_before => $borrower_dateexpiry, category_code => $borrower_categorycode } );
123
          GetBorrowersToExpunge( { not_borrowered_since => $filterdate1, expired_before => $borrower_dateexpiry, category_code => $borrower_categorycode } );
124
        $totalDel = scalar(@$membersToDelete);
124
        $totalDel = scalar(@$membersToDelete);
125
        $radio    = $params->{'radio'};
125
        my $i;
126
        if ( $radio eq 'trash' ) {
126
        for ( $i = 0 ; $i < $totalDel ; $i++ ) {
127
            my $i;
127
            MoveMemberToDeleted( $membersToDelete->[$i]->{'borrowernumber'} );
128
            for ( $i = 0 ; $i < $totalDel ; $i++ ) {
128
            C4::VirtualShelves::HandleDelBorrower(
129
                MoveMemberToDeleted( $membersToDelete->[$i]->{'borrowernumber'} );
129
                $membersToDelete->[$i]->{'borrowernumber'} );
130
                C4::VirtualShelves::HandleDelBorrower( $membersToDelete->[$i]->{'borrowernumber'} );
130
            DelMember( $membersToDelete->[$i]->{'borrowernumber'} );
131
                DelMember( $membersToDelete->[$i]->{'borrowernumber'} );
132
            }
133
        } else {    # delete completly.
134
            my $i;
135
            for ( $i = 0 ; $i < $totalDel ; $i++ ) {
136
                C4::VirtualShelves::HandleDelBorrower( $membersToDelete->[$i]->{'borrowernumber'} );
137
                DelMember( $membersToDelete->[$i]->{'borrowernumber'} );
138
            }
139
        }
131
        }
140
        $template->param(
132
        $template->param(
141
            do_delete => '1',
133
            do_delete => '1',
142
- 

Return to bug 11642