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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt (+19 lines)
Lines 145-150 Link Here
145
                                                    Deactivate
145
                                                    Deactivate
146
                                                [% END %]
146
                                                [% END %]
147
                                            </a>
147
                                            </a>
148
                                            <a class="btn btn-default btn-xs" href="?op=confirm_delete_rota&amp;rota_id=[% rota.rota_id | uri %]">
149
                                                <i class="fa fa-trash"></i>
150
                                                Delete
151
                                            </a>
148
                                        </td>
152
                                        </td>
149
                                    </tr>
153
                                    </tr>
150
                                [% END %]
154
                                [% END %]
Lines 366-371 Link Here
366
                            <a class="btn btn-default btn-xs deny" href="?op=manage_items&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-remove"></i>No</a>
370
                            <a class="btn btn-default btn-xs deny" href="?op=manage_items&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-remove"></i>No</a>
367
                        </p>
371
                        </p>
368
                    </div>
372
                    </div>
373
                [% ELSIF (op == 'confirm_delete_rota') %]
374
                    <div class="dialog alert">
375
                        <h1>Are you sure you want to delete this rota?</h1>
376
                        [% IF sritemstotal > 0 %]
377
                            [% IF sritemstotal == 1 %]
378
                                <p> [% sritemstotal | html %] item is still attached to this rota, that item will remain at its current stage libraries.</p>
379
                            [% ELSE %]
380
                                <p> [% sritemstotal | html %] items are still attached to this rota, those items will remain at their current stage libraries.</p>
381
                            [% END %]
382
                        [% END %]
383
                        <p>
384
                            <a class="btn btn-default btn-xs approve" href="?op=delete_rota&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a>
385
                            <a class="btn btn-default btn-xs deny" href="/cgi-bin/koha/tools/stockrotation.pl"><i class="fa fa-fw fa-remove"></i>No</a>
386
                        </p>
387
                    </div>
369
                [% ELSIF (op == 'confirm_delete_stage') %]
388
                [% ELSIF (op == 'confirm_delete_stage') %]
370
389
371
                    <div class="dialog alert">
390
                    <div class="dialog alert">
(-)a/tools/stockrotation.pl (-1 / +36 lines)
Lines 193-198 if (!defined $op) { Link Here
193
        item_id  => $params{item_id}
193
        item_id  => $params{item_id}
194
    );
194
    );
195
195
196
} elsif ($op eq 'confirm_delete_rota') {
197
198
    # Get the rota we're deleting
199
    my $rota = Koha::StockRotationRotas->find($params{rota_id});
200
201
    # Get all items on this rota, for each prefetch their
202
    # stage and biblio objects
203
    my $sritems = Koha::StockRotationItems->search(
204
        { 'stage.rota_id' => $params{rota_id} },
205
        {
206
            prefetch => {
207
                stage => {
208
                    'stockrotationitems' => {
209
                        'itemnumber' => 'biblionumber'
210
                    }
211
                }
212
            }
213
        }
214
    );
215
216
    $template->param(
217
        rota_id  => $params{rota_id},
218
        sritemstotal  => $sritems->count,
219
        op       => $op
220
    );
221
222
} elsif ($op eq 'delete_rota') {
223
224
    # Get the rota we're deleting
225
    my $rota = Koha::StockRotationRotas->find($params{rota_id});
226
227
    $rota->delete;
228
229
    # Return to the rotas list
230
    print $input->redirect("/cgi-bin/koha/tools/stockrotation.pl");
231
196
} elsif ($op eq 'confirm_delete_stage') {
232
} elsif ($op eq 'confirm_delete_stage') {
197
233
198
    # Get the stage we're deleting
234
    # Get the stage we're deleting
199
- 

Return to bug 30869