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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt (-25 / +56 lines)
Lines 147-160 Link Here
147
                                                        [% END %]
147
                                                        [% END %]
148
                                                    </ul>
148
                                                    </ul>
149
                                                </div>
149
                                                </div>
150
                                                <a class="btn btn-default btn-xs" href="?op=toggle_rota&amp;rota_id=[% rota.rota_id | uri %]">
150
                                                <form id="toggle_rota_[% rota.rota_id | html %]" method="post" action="/cgi-bin/koha/tools/stockrotation.pl">
151
                                                    <i class="fa fa-power-off"></i>
151
                                                    [% INCLUDE 'csrf-token.inc' %]
152
                                                    <input type="hidden" name="op" value="cud-toggle_rota" />
153
                                                    <input type="hidden" name="rota_id" value="[% rota.rota_id | html %]" />
154
                                                    <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-power-off"></i>
152
                                                    [% IF !rota.active %]
155
                                                    [% IF !rota.active %]
153
                                                        Activate
156
                                                        Activate
154
                                                    [% ELSE %]
157
                                                    [% ELSE %]
155
                                                        Deactivate
158
                                                        Deactivate
156
                                                    [% END %]
159
                                                    [% END %]
157
                                                </a>
160
                                                    </button>
161
                                                </form>
158
                                                <a class="btn btn-default btn-xs" href="?op=confirm_delete_rota&amp;rota_id=[% rota.rota_id | uri %]">
162
                                                <a class="btn btn-default btn-xs" href="?op=confirm_delete_rota&amp;rota_id=[% rota.rota_id | uri %]">
159
                                                    <i class="fa fa-trash"></i>
163
                                                    <i class="fa fa-trash"></i>
160
                                                    Delete
164
                                                    Delete
Lines 380-387 Link Here
380
                    <div class="dialog alert">
384
                    <div class="dialog alert">
381
                        <h1>Are you sure you wish to remove this item from its rota</h1>
385
                        <h1>Are you sure you wish to remove this item from its rota</h1>
382
                        <p>
386
                        <p>
383
                            <a class="btn btn-default btn-xs approve" href="?op=remove_item_from_stage&amp;item_id=[% item_id | uri %]&amp;stage_id=[% stage_id | uri %]&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a>
387
                            <form id="remove_item_from_stage_[% item_id | html %]_[% rota.rota_id | html %]" method="post" action="/cgi-bin/koha/tools/stockrotation.pl">
384
                            <a class="btn btn-default btn-xs deny" href="?op=manage_items&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-times"></i>No</a>
388
                                [% INCLUDE 'csrf-token.inc' %]
389
                                <input type="hidden" name="op" value="cud-remove_item_from_stage" />
390
                                <input type="hidden" name="item_id" value="[% item_id | html %]" />
391
                                <input type="hidden" name="rota_id" value="[% rota_id | html %]" />
392
                                <input type="hidden" name="stage_id" value="[% stage_id | html %]" />
393
                                <button class="btn btn-default btn-xs approve" type="submit"><i class="fa fa-fw fa-check"></i> Yes</button>
394
                            </form>
395
                            <a class="btn btn-default btn-xs deny" href="?op=manage_items&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-times"></i> No</a>
385
                        </p>
396
                        </p>
386
                    </div>
397
                    </div>
387
                [% ELSIF (op == 'confirm_delete_rota') %]
398
                [% ELSIF (op == 'confirm_delete_rota') %]
Lines 396-403 Link Here
396
                            [% END %]
407
                            [% END %]
397
                        [% END %]
408
                        [% END %]
398
                        <p>
409
                        <p>
399
                            <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>
410
                            <form id="delete_rota_[% rota.rota_id | html %]" method="post" action="/cgi-bin/koha/tools/stockrotation.pl">
400
                            <a class="btn btn-default btn-xs deny" href="/cgi-bin/koha/tools/stockrotation.pl"><i class="fa fa-fw fa-times"></i>No</a>
411
                                [% INCLUDE 'csrf-token.inc' %]
412
                                <input type="hidden" name="op" value="cud-delete_rota" />
413
                                <input type="hidden" name="rota_id" value="[% rota.rota_id | html %]" />
414
                                <button class="btn btn-default btn-xs approve" type="submit"><i class="fa fa-fw fa-check"></i> Yes</button>
415
                            </form>
416
                            <a class="btn btn-default btn-xs deny" href="/cgi-bin/koha/tools/stockrotation.pl"><i class="fa fa-fw fa-times"></i> No</a>
401
                        </p>
417
                        </p>
402
                    </div>
418
                    </div>
403
                [% ELSIF (op == 'confirm_delete_stage') %]
419
                [% ELSIF (op == 'confirm_delete_stage') %]
Lines 413-420 Link Here
413
                            </ul>
429
                            </ul>
414
                        [% END %]
430
                        [% END %]
415
                        <p>
431
                        <p>
416
                            <a class="btn btn-default btn-xs approve" href="?op=delete_stage&amp;stage_id=[% stage.stage_id | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a>
432
                            <form id="delete_stage_[% stage.stage_id | html %]" method="post" action="/cgi-bin/koha/tools/stockrotation.pl">
417
                            <a class="btn btn-default btn-xs deny" href="?op=manage_stages&amp;rota_id=[% stage.rota.rota_id | uri %]"><i class="fa fa-fw fa-times"></i>No</a>
433
                                [% INCLUDE 'csrf-token.inc' %]
434
                                <input type="hidden" name="op" value="cud-delete_stage" />
435
                                <input type="hidden" name="stage_id" value="[% stage.stage_id | html %]" />
436
                                <button class="btn btn-default btn-xs approve" type="submit"><i class="fa fa-fw fa-check"></i> Yes</button>
437
                            </form>
438
                            <a class="btn btn-default btn-xs deny" href="?op=manage_stages&amp;rota_id=[% stage.rota.rota_id | uri %]"><i class="fa fa-fw fa-times"></i> No</a>
418
                        </p>
439
                        </p>
419
                    </div>
440
                    </div>
420
                [% ELSIF (op == 'manage_items') %]
441
                [% ELSIF (op == 'manage_items') %]
Lines 517-542 Link Here
517
                                                [% in_transit = sritem.item.get_transfer %]
538
                                                [% in_transit = sritem.item.get_transfer %]
518
                                                [% IF stages.size < 2 %]
539
                                                [% IF stages.size < 2 %]
519
                                                    <a class="btn btn-default btn-xs" title="Rota has a single stage, advancing will have no effect" disabled>
540
                                                    <a class="btn btn-default btn-xs" title="Rota has a single stage, advancing will have no effect" disabled>
520
                                                [% ELSIF !in_transit %]
521
                                                    <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;rota_id=[% rota.id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;stage_id=[% sritem.stage.stage_id | uri %]">
522
                                                [% ELSE %]
541
                                                [% ELSE %]
523
                                                    <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;rota_id=[% rota.id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;stage_id=[% sritem.stage.stage_id | uri %]" title="Item is in transit, it will be directed to new stage when checked in">
542
                                                    <form id="move_to_next_stage_[% sritem.id | html %]_[% rota.id | html %]" method="post" action="/cgi-bin/koha/tools/stockrotation.pl">
543
                                                        [% INCLUDE 'csrf-token.inc' %]
544
                                                        <input type="hidden" name="op" value="cud-move_to_next_stage" />
545
                                                        <input type="hidden" name="item_id" value="[% sritem.id | html %]" />
546
                                                        <input type="hidden" name="rota_id" value="[% rota.id | html %]" />
547
                                                        <input type="hidden" name="stage_id" value="[% sritem.stage.stage_id | html %]" />
548
                                                        [% IF !in_transit %]
549
                                                            <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-arrow-right"></i> Move to next stage</button>
550
                                                        [% ELSE %]
551
                                                            <button class="btn btn-default btn-xs" type="submit" title="Item is in transit, it will be directed to new stage when checked in"><i class="fa fa-arrow-right"></i> Move to next stage</button>
552
                                                        [% END %]
553
                                                    </form>
524
                                                [% END %]
554
                                                [% END %]
525
                                                    <i class="fa fa-arrow-right"></i>
555
526
                                                    Move to next stage
527
                                                </a>
528
                                                [% IF !in_transit %]
556
                                                [% IF !in_transit %]
529
                                                    <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&amp;stage_id=[% sritem.stage.stage_id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;rota_id=[% rota.id | uri %]">
557
                                                    <form id="toggle_in_demand_[% sritem.id | html %]_[% rota.id | html %]" method="post" action="/cgi-bin/koha/tools/stockrotation.pl">
530
                                                [% ELSE %]
558
                                                        [% INCLUDE 'csrf-token.inc' %]
531
                                                    <a class="btn btn-default btn-xs" disabled>
559
                                                        <input type="hidden" name="op" value="cud-toggle_in_demand" />
560
                                                        <input type="hidden" name="item_id" value="[% sritem.id | html %]" />
561
                                                        <input type="hidden" name="rota_id" value="[% rota.id | html %]" />
562
                                                        <input type="hidden" name="stage_id" value="[% sritem.stage.stage_id | html %]" />
563
                                                        [% IF sritem.indemand %]
564
                                                            <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-fire"></i> Remove &quot;In demand&quot;</button>
565
                                                        [% ELSE %]
566
                                                            <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-fire"></i> Add &quot;In demand&quot;</button>
567
                                                        [% END %]
568
                                                    </form>
532
                                                [% END %]
569
                                                [% END %]
533
                                                    <i class="fa fa-fire"></i>
570
534
                                                    [% IF sritem.indemand %]
535
                                                    <span>Remove &quot;In demand&quot;</span>
536
                                                    [% ELSE %]
537
                                                    <span>Add &quot;In demand&quot;</span>
538
                                                    [% END %]
539
                                                </a>
540
                                                [% IF !in_transit %]
571
                                                [% IF !in_transit %]
541
                                                    <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% sritem.stage.stage_id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;rota_id=[% rota.id | uri %]">
572
                                                    <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% sritem.stage.stage_id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;rota_id=[% rota.id | uri %]">
542
                                                [% ELSE %]
573
                                                [% ELSE %]
(-)a/tools/stockrotation.pl (-7 / +6 lines)
Lines 107-113 if (!defined $op) { Link Here
107
        op   => $op
107
        op   => $op
108
    );
108
    );
109
109
110
} elsif ($op eq 'toggle_rota') {
110
} elsif ($op eq 'cud-toggle_rota') {
111
111
112
    # Find and update the active status of the rota
112
    # Find and update the active status of the rota
113
    my $rota = Koha::StockRotationRotas->find($params{rota_id});
113
    my $rota = Koha::StockRotationRotas->find($params{rota_id});
Lines 223-229 if (!defined $op) { Link Here
223
        op       => $op
223
        op       => $op
224
    );
224
    );
225
225
226
} elsif ($op eq 'delete_rota') {
226
} elsif ($op eq 'cud-delete_rota') {
227
227
228
    # Get the rota we're deleting
228
    # Get the rota we're deleting
229
    my $rota = Koha::StockRotationRotas->find($params{rota_id});
229
    my $rota = Koha::StockRotationRotas->find($params{rota_id});
Lines 243-249 if (!defined $op) { Link Here
243
        stage => $stage
243
        stage => $stage
244
    );
244
    );
245
245
246
} elsif ($op eq 'delete_stage') {
246
} elsif ($op eq 'cud-delete_stage') {
247
247
248
    # Get the stage we're deleting
248
    # Get the stage we're deleting
249
    my $stage = Koha::StockRotationStages->find($params{stage_id});
249
    my $stage = Koha::StockRotationStages->find($params{stage_id});
Lines 315-328 if (!defined $op) { Link Here
315
        op       => $op
315
        op       => $op
316
    );
316
    );
317
317
318
} elsif ($op eq 'move_to_next_stage') {
318
} elsif ($op eq 'cud-move_to_next_stage') {
319
319
320
    move_to_next_stage($params{item_id}, $params{stage_id});
320
    move_to_next_stage($params{item_id}, $params{stage_id});
321
321
322
    # Return to the items list
322
    # Return to the items list
323
    print $input->redirect("?op=manage_items&rota_id=" . $params{rota_id});
323
    print $input->redirect("?op=manage_items&rota_id=" . $params{rota_id});
324
324
325
} elsif ($op eq 'toggle_in_demand') {
325
} elsif ($op eq 'cud-toggle_in_demand') {
326
326
327
    # Toggle the item's in_demand
327
    # Toggle the item's in_demand
328
    toggle_indemand($params{item_id}, $params{stage_id});
328
    toggle_indemand($params{item_id}, $params{stage_id});
Lines 330-336 if (!defined $op) { Link Here
330
    # Return to the items list
330
    # Return to the items list
331
    print $input->redirect("?op=manage_items&rota_id=".$params{rota_id});
331
    print $input->redirect("?op=manage_items&rota_id=".$params{rota_id});
332
332
333
} elsif ($op eq 'remove_item_from_stage') {
333
} elsif ($op eq 'cud-remove_item_from_stage') {
334
334
335
    # Remove the item from the stage
335
    # Remove the item from the stage
336
    remove_from_stage($params{item_id}, $params{stage_id});
336
    remove_from_stage($params{item_id}, $params{stage_id});
337
- 

Return to bug 36193