Bugzilla – Attachment 162831 Details for
Bug 36193
CSRF - Code review missed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36193: cud- treatment for catalogue/stockrotation.pl
Bug-36193-cud--treatment-for-cataloguestockrotatio.patch (text/plain), 7.77 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-03-06 11:54:53 UTC
(
hide
)
Description:
Bug 36193: cud- treatment for catalogue/stockrotation.pl
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-03-06 11:54:53 UTC
Size:
7.77 KB
patch
obsolete
>From cb4943d637f1009280cf9c70bdb883175595d2ed Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 6 Mar 2024 08:53:59 -0300 >Subject: [PATCH] Bug 36193: cud- treatment for catalogue/stockrotation.pl > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > catalogue/stockrotation.pl | 6 +-- > .../en/modules/catalogue/stockrotation.tt | 44 ++++++++++++++----- > 2 files changed, 37 insertions(+), 13 deletions(-) > >diff --git a/catalogue/stockrotation.pl b/catalogue/stockrotation.pl >index 344e0317d78..71d68c42062 100755 >--- a/catalogue/stockrotation.pl >+++ b/catalogue/stockrotation.pl >@@ -127,7 +127,7 @@ if (!defined $op) { > C4::Search::enabled_staff_search_views > ); > >-} elsif ($op eq "toggle_in_demand") { >+} elsif ($op eq "cud-toggle_in_demand") { > > # Toggle in demand > toggle_indemand($params{item_id}, $params{stage_id}); >@@ -135,7 +135,7 @@ if (!defined $op) { > # Return to items list > print $input->redirect("?biblionumber=$biblionumber"); > >-} elsif ($op eq "remove_item_from_stage") { >+} elsif ($op eq "cud-remove_item_from_stage") { > > # Remove from the stage > remove_from_stage($params{item_id}, $params{stage_id}); >@@ -143,7 +143,7 @@ if (!defined $op) { > # Return to items list > print $input->redirect("?biblionumber=$biblionumber"); > >-} elsif ($op eq "move_to_next_stage") { >+} elsif ($op eq "cud-move_to_next_stage") { > > move_to_next_stage($params{item_id}, $params{stage_id}); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt >index b1e9e7c9df7..4b626f4a2af 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt >@@ -112,25 +112,42 @@ > [% IF item.stockrotationitem %] > [% in_transit = item.bib_item.get_transfer %] > [% IF !in_transit && item.stages.size > 1 %] >- <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&item_id=[% item.bib_item.id | uri %]&biblionumber=[% biblionumber | uri %]"> >+ <form id="move_to_next_stage_[% item.bib_item.id | html %]" method="post" action="/cgi-bin/koha/catalogue/stockrotation.pl"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="op" value="cud-move_to_next_stage" /> >+ <input type="hidden" name="stage_id" value="[% item.stockrotationitem.stage.stage_id | html %]" /> >+ <input type="hidden" name="item_id" value="[% item.bib_item.id | html %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> >+ <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-arrow-right"></i> Move to next stage</button> >+ </form> > [% ELSE %] >- <a class="btn btn-default btn-xs" disabled> >+ <a class="btn btn-default btn-xs" disabled><i class="fa fa-arrow-right"></i> Move to next stage</a> > [% END %] >- <i class="fa fa-arrow-right"></i> >- Move to next stage >- </a> >+ > [% IF !in_transit %] >- <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&item_id=[% item.bib_item.id | uri %]&biblionumber=[% biblionumber | uri %]"> >+ <form id="toggle_in_demand_[% item.bib_item.id | html %]" method="post" action="/cgi-bin/koha/catalogue/stockrotation.pl"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="op" value="cud-toggle_in_demand" /> >+ <input type="hidden" name="stage_id" value="[% item.stockrotationitem.stage.stage_id | html %]" /> >+ <input type="hidden" name="item_id" value="[% item.bib_item.id | html %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> >+ <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-fire"></i> >+ [% IF item.stockrotationitem.indemand %] >+ Remove "In demand" >+ [% ELSE %] >+ Add "In demand" >+ [% END %]</button> >+ </form> > [% ELSE %] >- <a class="btn btn-default btn-xs" disabled> >- [% END %] >- <i class="fa fa-fire"></i> >+ <a class="btn btn-default btn-xs" disabled><i class="fa fa-fire"></i> > [% IF item.stockrotationitem.indemand %] > Remove "In demand" > [% ELSE %] > Add "In demand" > [% END %] > </a> >+ [% END %] >+ > [% IF !in_transit %] > <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&item_id=[% item.bib_item.id | uri %]&biblionumber=[% biblionumber | uri %]"> > [% ELSE %] >@@ -170,7 +187,14 @@ > <div class="dialog alert"> > <h3>Are you sure you want to remove this item from it's rota?</h3> > <p> >- <a class="btn btn-default btn-xs approve" href="?op=remove_item_from_stage&stage_id=[% stage_id | uri %]&item_id=[% item_id | uri %]&biblionumber=[% biblionumber | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a> >+ <form id="remove_item_from_stage_[% item.bib_item.id | html %]" method="post" action="/cgi-bin/koha/catalogue/stockrotation.pl"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="op" value="cud-remove_item_from_stage" /> >+ <input type="hidden" name="stage_id" value="[% stage_id | html %]" /> >+ <input type="hidden" name="item_id" value="[% item_id | html %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> >+ <button class="btn btn-default btn-xs approve" type="submit"><i class="fa fa-fw fa-check"></i>Yes</button> >+ </form> > <a class="btn btn-default btn-xs deny" href="?biblionumber=[% biblionumber | uri %]"><i class="fa fa-fw fa-times"></i>No</a> > </p> > </div> >-- >2.44.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36193
:
162684
|
162733
|
162734
|
162749
|
162750
|
162751
|
162752
|
162755
|
162769
|
162770
|
162771
|
162772
|
162773
|
162774
|
162775
|
162776
|
162777
|
162784
|
162830
| 162831 |
162837