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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt (+20 lines)
Lines 146-151 Link Here
146
                                                        Deactivate
146
                                                        Deactivate
147
                                                    [% END %]
147
                                                    [% END %]
148
                                                </a>
148
                                                </a>
149
                                                <a class="btn btn-default btn-xs" href="?op=confirm_delete_rota&amp;rota_id=[% rota.rota_id | uri %]">
150
	                                                <i class="fa fa-trash"></i>
151
	                                                Delete
152
                                                </a>
149
                                            </td>
153
                                            </td>
150
                                        </tr>
154
                                        </tr>
151
                                    [% END %]
155
                                    [% END %]
Lines 368-373 Link Here
368
                            <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>
372
                            <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>
369
                        </p>
373
                        </p>
370
                    </div>
374
                    </div>
375
                [% ELSIF (op == 'confirm_delete_rota') %]
376
377
                    <div class="dialog alert">
378
                        <h1>Are you sure you want to delete this rota?</h1>
379
                        [% IF sritemstotal > 0 %]
380
                            [% IF sritemstotal == 1 %]
381
                                <p> [% sritemstotal | html %] item is still attached to this rota, that item will remain at its current stage libraries.</p>
382
                            [% ELSE %]
383
                                <p> [% sritemstotal | html %] items are still attached to this rota, those items will remain at their current stage libraries.</p>
384
                            [% END %]
385
                        [% END %]
386
                        <p>
387
                            <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>
388
                            <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>
389
                        </p>
390
                    </div>
371
                [% ELSIF (op == 'confirm_delete_stage') %]
391
                [% ELSIF (op == 'confirm_delete_stage') %]
372
392
373
                    <div class="dialog alert">
393
                    <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