Skip to content

Commit

Permalink
Bug 34478: op =~ ^cud- in pl/pm
Browse files Browse the repository at this point in the history
This is the result of
  bash op_must_start_with_cud-perl.sh

Signed-off-by: Jonathan Druart <[email protected]>
  • Loading branch information
joubu committed Mar 1, 2024
1 parent 11d371a commit 18e8082
Show file tree
Hide file tree
Showing 216 changed files with 552 additions and 552 deletions.
2 changes: 1 addition & 1 deletion acqui/addorderiso2709.pl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
#
# 3rd step = import the records
#
} elsif ( $op eq 'import_records' ) {
} elsif ( $op eq 'cud-import_records' ) {
#import selected lines
$template->param('basketno' => $cgiparams->{'basketno'});
# Budget_id is mandatory for adding an order, we just add a default, the user needs to modify this aftewards
Expand Down
10 changes: 5 additions & 5 deletions acqui/basket.pl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ =head1 CGI PARAMETERS

my @messages;

if ( $op eq 'delete_confirm' ) {
if ( $op eq 'cud-delete_confirm' ) {

output_and_exit( $query, $cookie, $template, 'insufficient_permission' )
unless $logged_in_patron->has_permission( { acquisition => 'delete_baskets' } );
Expand Down Expand Up @@ -162,15 +162,15 @@ =head1 CGI PARAMETERS
);
} elsif ( !$bookseller ) {
$template->param( NO_BOOKSELLER => 1 );
} elsif ($op eq 'export') {
} elsif ($op eq 'cud-export') {
print $query->header(
-type => 'text/csv',
-attachment => 'basket' . $basket->{'basketno'} . '.csv',
);
my $csv_profile_id = $query->param('csv_profile');
print GetBasketAsCSV( scalar $query->param('basketno'), $query, $csv_profile_id ); # if no csv_profile_id passed, using default rows
exit;
} elsif ($op eq 'email') {
} elsif ($op eq 'cud-email') {
my $err = eval {
SendAlerts( 'orderacquisition', scalar $query->param('basketno'), 'ACQORDER' );
};
Expand Down Expand Up @@ -227,13 +227,13 @@ =head1 CGI PARAMETERS
}
elsif ( $op eq 'ediorder' ) {
edi_close_and_order()
} elsif ( $op eq 'mod_users' ) {
} elsif ( $op eq 'cud-mod_users' ) {
my $basketusers_ids = $query->param('users_ids');
my @basketusers = split( /:/, $basketusers_ids );
ModBasketUsers($basketno, @basketusers);
print $query->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=$basketno");
exit;
} elsif ( $op eq 'mod_branch' ) {
} elsif ( $op eq 'cud-mod_branch' ) {
my $branch = $query->param('branch');
$branch = undef if(defined $branch and $branch eq '');
ModBasket({
Expand Down
10 changes: 5 additions & 5 deletions acqui/basketgroup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ sub generate_edifact_orders {
{ vendor_id => $booksellerid, } );
$template->param( ediaccount => ($rs->count > 0));

if ( $op eq "add" ) {
if ( $op eq "cud-add" ) {
#
# if no param('basketgroupid') is not defined, adds a new basketgroup
# else, edit (if it is open) or display (if it is close) the basketgroup basketgroupid
Expand Down Expand Up @@ -300,7 +300,7 @@ sub generate_edifact_orders {
my $basketgroups = &GetBasketgroups($booksellerid);
my $baskets = &GetBasketsByBookseller($booksellerid);
displaybasketgroups($basketgroups, $bookseller, $baskets);
} elsif ($op eq 'mod_basket') {
} elsif ($op eq 'cud-mod_basket') {
#
# edit an individual basket contained in this basketgroup
#
Expand All @@ -324,7 +324,7 @@ sub generate_edifact_orders {
my $basketgroupid = $input->param('basketgroupid');
printbasketgrouppdf($basketgroupid);
exit;
}elsif ( $op eq "export" ) {
}elsif ( $op eq "cud-export" ) {
#
# export a closed basketgroup in csv
#
Expand All @@ -336,7 +336,7 @@ sub generate_edifact_orders {
);
print GetBasketGroupAsCSV( $basketgroupid, $input );
exit;
}elsif( $op eq "delete"){
}elsif( $op eq "cud-delete"){
#
# delete an closed basketgroup
#
Expand All @@ -352,7 +352,7 @@ sub generate_edifact_orders {
ReOpenBasketgroup($basketgroupid);
my $redirectpath = ((defined $input->param('mode'))&& ($input->param('mode') eq 'singlebg')) ?'/cgi-bin/koha/acqui/basketgroup.pl?op=add&amp;basketgroupid='.$basketgroupid.'&amp;booksellerid='.$booksellerid : '/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=' .$booksellerid.'&amp;listclosed=1';
print $input->redirect($redirectpath);
} elsif ( $op eq 'attachbasket') {
} elsif ( $op eq 'cud-attachbasket') {
#
# save a modified basketgroup, or creates a new basketgroup when a basket is closed. called from basket page
#
Expand Down
2 changes: 1 addition & 1 deletion acqui/basketheader.pl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ =head1 CGI PARAMETERS
$template->param( deliveryplace => $deliveryplace );

#End Edit
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
#we are confirming the changes, save the basket
if ( $is_an_edit ) {
ModBasketHeader(
Expand Down
8 changes: 4 additions & 4 deletions acqui/duplicate_orders.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

my $input = CGI->new;
my $basketno = $input->param('basketno');
my $op = $input->param('op') || 'search'; # search, select, batch_edit
my $op = $input->param('op') || 'cud-search'; # search, select, batch_edit

my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
{
Expand Down Expand Up @@ -81,7 +81,7 @@

my ( @result_order_loop, @selected_order_loop );
my @ordernumbers = split ',', scalar $input->param('ordernumbers') || '';
if ( $op eq 'select' ) {
if ( $op eq 'cud-select' ) {

# Set filter for 'all status'
if ( $filters->{orderstatus} eq "any" ) {
Expand All @@ -98,7 +98,7 @@
? @{ C4::Acquisition::GetHistory( ordernumbers => \@ordernumbers ) }
: ();
}
elsif ( $op eq 'batch_edit' ) {
elsif ( $op eq 'cud-batch_edit' ) {
@ordernumbers = $input->multi_param('ordernumber');

# build budget list
Expand Down Expand Up @@ -126,7 +126,7 @@
budget_loop => $budget_loop,
);
}
elsif ( $op eq 'do_duplicate' ) {
elsif ( $op eq 'cud-do_duplicate' ) {
my @fields_to_copy = $input->multi_param('copy_existing_value');

my $default_values;
Expand Down
2 changes: 1 addition & 1 deletion acqui/edifactmsgs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

my $schema = Koha::Database->new()->schema();
my $cmd = $q->param('op');
if ( $cmd && $cmd eq 'delete' ) {
if ( $cmd && $cmd eq 'cud-delete' ) {
my $id = $q->param('message_id');
my $msg = $schema->resultset('EdifactMessage')->find($id);
$msg->deleted(1);
Expand Down
2 changes: 1 addition & 1 deletion acqui/histsearch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ =head1 CGI PARAMETERS
use Koha::DateUtils qw( dt_from_string );

my $input = CGI->new;
my $do_search = $input->param('do_search') || 0;
my $do_search = $input->param('cud-do_search') || 0;

my $dbh = C4::Context->dbh;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Expand Down
4 changes: 2 additions & 2 deletions acqui/invoice-files.pl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ =head1 DESCRIPTION
datereceived => $details->{'datereceived'},
);

if ( $op eq 'upload' ) {
if ( $op eq 'cud-upload' ) {
my $uploaded_file = $input->upload('uploadfile');

if ($uploaded_file) {
Expand All @@ -107,7 +107,7 @@ =head1 DESCRIPTION
else {
$errors{'no_file'} = 1;
}
} elsif ( $op eq 'delete' ) {
} elsif ( $op eq 'cud-delete' ) {
$mf->DelFile( id => scalar $input->param('file_id') );
}

Expand Down
6 changes: 3 additions & 3 deletions acqui/invoice.pl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ =head1 DESCRIPTION
exit 0;
}
}
elsif ( $op && $op eq 'mod' ) {
elsif ( $op && $op eq 'cud-mod' ) {
my $shipmentcost = $input->param('shipmentcost');
my $shipment_budget_id = $input->param('shipment_budget_id');
my $invoicenumber = $input->param('invoicenumber');
Expand Down Expand Up @@ -141,7 +141,7 @@ =head1 DESCRIPTION

$template->param( modified => 1 );
}
elsif ( $op && $op eq 'delete' ) {
elsif ( $op && $op eq 'cud-delete' ) {

output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
unless $logged_in_patron->has_permission( { acquisition => 'delete_invoices' } );
Expand Down Expand Up @@ -180,7 +180,7 @@ =head1 DESCRIPTION
$del_adj->delete();
}
}
elsif ( $op && $op eq 'mod_adj' ) {
elsif ( $op && $op eq 'cud-mod_adj' ) {

output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
unless $logged_in_patron->has_permission( { acquisition => 'edit_invoices' } );
Expand Down
4 changes: 2 additions & 2 deletions acqui/invoices.pl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ =head1 DESCRIPTION
}

my $invoices = [];
if ( $op and $op eq 'do_search' ) {
if ( $op and $op eq 'cud-do_search' ) {
@{$invoices} = GetInvoices(
invoicenumber => $invoicenumber,
supplierid => $supplierid,
Expand Down Expand Up @@ -142,7 +142,7 @@ =head1 DESCRIPTION
$template->param(
openedinvoices => \@openedinvoices,
closedinvoices => \@closedinvoices,
do_search => ( $op and $op eq 'do_search' ) ? 1 : 0,
do_search => ( $op and $op eq 'cud-do_search' ) ? 1 : 0,
invoices => $invoices,
invoicenumber => $invoicenumber,
booksellerid => $supplierid,
Expand Down
2 changes: 1 addition & 1 deletion acqui/lateorders.pl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ =head1 CGI PARAMETERS
push @errors, {delay_digits => 1, bad_delay => $delay};
}

if ($op and $op eq "send_alert"){
if ($op and $op eq "cud-send_alert"){
my @ordernums = $input->multi_param("ordernumber");
my $err;
eval {
Expand Down
2 changes: 1 addition & 1 deletion acqui/moddeliverydate.pl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ =head1 DESCRIPTION
my $basket = GetBasket($order->{basketno});
my $bookseller = Koha::Acquisition::Booksellers->find( $basket->{booksellerid} );

if($op and $op eq 'save') {
if($op and $op eq 'cud-save') {
my $estimated_delivery_date = $input->param('estimated_delivery_date');
$order->{'estimated_delivery_date'} = $estimated_delivery_date ? dt_from_string( $estimated_delivery_date ) : undef;
ModOrder($order);
Expand Down
2 changes: 1 addition & 1 deletion acqui/modordernotes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ =head1 DESCRIPTION
my $bookseller = Koha::Acquisition::Booksellers->find( $basket->{booksellerid} );


if($op and $op eq 'save') {
if($op and $op eq 'cud-save') {
my $ordernotes = $input->param('ordernotes');
if ($type eq "vendor") {
$order->{'order_vendornote'} = $ordernotes;
Expand Down
2 changes: 1 addition & 1 deletion acqui/orderreceive.pl
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ =head1 CGI PARAMETERS
$template->{'VARS'}->{'budget_loops'} = \%budget_loops;

my $op = $input->param('op');
if ($op and $op eq 'edit'){
if ($op and $op eq 'cud-edit'){
$template->param(edit => 1);
}
output_html_with_http_headers $input, $cookie, $template->output;
2 changes: 1 addition & 1 deletion acqui/parcels.pl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ =head1 CGI PARAMETERS
my $booksellerid = $input->param('booksellerid');
my $order = $input->param('orderby') || 'shipmentdate desc';
my $startfrom = $input->param('startfrom');
my $code = $input->param('filter');
my $code = $input->param('cud-filter');
my $datefrom = $input->param('datefrom');
my $dateto = $input->param('dateto');
my $resultsperpage = $input->param('resultsperpage');
Expand Down
2 changes: 1 addition & 1 deletion acqui/supplier.pl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ =head1 CGI PARAMETERS
vendor => $supplier,
contracts => $contracts,
);
} elsif ( $op eq 'delete' ) {
} elsif ( $op eq 'cud-delete' ) {
# no further message needed for the user
# the DELETE button only appears in the template if basketcount == 0 AND subscriptioncount == 0
if ( $supplier->baskets->count == 0 && $supplier->subscriptions->count == 0) {
Expand Down
2 changes: 1 addition & 1 deletion acqui/transferorder.pl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
} else {
# Search for booksellers to transfer from/to
$op = '' unless $op;
if( $op eq "do_search" ) {
if( $op eq "cud-do_search" ) {
my $booksellers = Koha::Acquisition::Booksellers->search(
{ name => { -like => "%$query%" } },
{ order_by => { -asc => 'name' } } );
Expand Down
2 changes: 1 addition & 1 deletion acqui/uncertainprice.pl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ =head1 CGI PARAMETERS
});
my @orders = grep { $_->{'uncertainprice'} } @$pendingorders;

if ( $op eq 'validate' ) {
if ( $op eq 'cud-validate' ) {
$template->param( validate => 1);
my $count = scalar(@orders);
for (my $i=0; $i < $count; $i++) {
Expand Down
8 changes: 4 additions & 4 deletions acqui/vendor_issues.pl
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
exit;
}

if ( $op eq 'add_form' || $op eq 'show' ) {
if ( $op eq 'add_form' || $op eq 'cud-show' ) {
$template->param( issue => $issue );
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
my $type = $input->param('type');
my $started_on = $input->param('started_on');
my $ended_on = $input->param('ended_on');
Expand Down Expand Up @@ -92,9 +92,9 @@
};
}
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
$template->param( issue => $issue );
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
try {
$issue->delete;
push @messages, { type => 'message', code => 'success_on_delete' };
Expand Down
4 changes: 2 additions & 2 deletions acqui/z3950_search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
publicationyear => $publicationyear,
);

if ( $op ne "do_search" ) {
if ( $op ne "cud-do_search" ) {
my $schema = Koha::Database->new()->schema();
my $rs = $schema->resultset('Z3950server')->search(
{
Expand All @@ -98,7 +98,7 @@
);
$template->param(
serverloop => [ $rs->all ],
opsearch => "search",
opsearch => "cud-search",
);
output_html_with_http_headers $input, $cookie, $template->output;
exit;
Expand Down
12 changes: 6 additions & 6 deletions admin/additional-fields.pl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
my $field_id = $input->param('field_id');
my @messages;

if ( $op eq 'add' ) {
if ( $op eq 'cud-add' ) {
my $name = $input->param('name') // q{};
my $authorised_value_category = $input->param('authorised_value_category');
my $marcfield = $input->param('marcfield') // q{};
Expand All @@ -69,7 +69,7 @@
$updated = $af->store ? 1 : 0;
};
push @messages, {
code => 'update',
code => 'cud-update',
number => $updated,
};
} elsif ( $name ) {
Expand All @@ -88,26 +88,26 @@
$inserted = $af->store ? 1 : 0;
};
push @messages, {
code => 'insert',
code => 'cud-insert',
number => $inserted,
};
} else {
push @messages, {
code => 'insert',
code => 'cud-insert',
number => 0,
};
}
$op = 'list';
}

if ( $op eq 'delete' ) {
if ( $op eq 'cud-delete' ) {
my $deleted = 0;
eval {
my $af = Koha::AdditionalFields->find($field_id);
$deleted = $af->delete;
};
push @messages, {
code => 'delete',
code => 'cud-delete',
number => $deleted,
};
$op = 'list';
Expand Down
2 changes: 1 addition & 1 deletion admin/adveditorshortcuts.pl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ =head1 FUNCTIONS

my $shortcuts = Koha::KeyboardShortcuts->search();

if ( $op eq 'save' ) {
if ( $op eq 'cud-save' ) {
my @shortcut_names = $input->multi_param('shortcut_name');
my @shortcut_keys = $input->multi_param('shortcut_keys');
my %updated_shortcuts;
Expand Down
Loading

0 comments on commit 18e8082

Please sign in to comment.