Bug 34478: op =~ ^cud- in pl/pm

This is the result of
  bash op_must_start_with_cud-perl.sh

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2023-12-12 16:43:08 +01:00
parent 11d371a620
commit 18e808240f
No known key found for this signature in database
GPG Key ID: A085E712BEF0E0F0
216 changed files with 552 additions and 552 deletions

View File

@ -122,7 +122,7 @@ if ($op eq ""){
#
# 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

View File

@ -118,7 +118,7 @@ $template->param( skip_confirm_reopen => 1) if $confirm_pref eq '2';
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' } );
@ -162,7 +162,7 @@ if ( $op eq 'delete_confirm' ) {
);
} 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',
@ -170,7 +170,7 @@ if ( $op eq 'delete_confirm' ) {
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' );
};
@ -227,13 +227,13 @@ if ( $op eq 'delete_confirm' ) {
}
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({

View File

@ -252,7 +252,7 @@ my $rs = $schema->resultset('VendorEdiAccount')->search(
{ 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
@ -300,7 +300,7 @@ if ( $op eq "add" ) {
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
#
@ -324,7 +324,7 @@ if ( $op eq "add" ) {
my $basketgroupid = $input->param('basketgroupid');
printbasketgrouppdf($basketgroupid);
exit;
}elsif ( $op eq "export" ) {
}elsif ( $op eq "cud-export" ) {
#
# export a closed basketgroup in csv
#
@ -336,7 +336,7 @@ if ( $op eq "add" ) {
);
print GetBasketGroupAsCSV( $basketgroupid, $input );
exit;
}elsif( $op eq "delete"){
}elsif( $op eq "cud-delete"){
#
# delete an closed basketgroup
#
@ -352,7 +352,7 @@ if ( $op eq "add" ) {
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
#

View File

@ -135,7 +135,7 @@ if ( $op eq 'add_form' ) {
$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(

View File

@ -32,7 +32,7 @@ use Koha::DateUtils qw( dt_from_string );
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(
{
@ -81,7 +81,7 @@ $filters->{to_placed_on} = $to_placed_on;
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" ) {
@ -98,7 +98,7 @@ if ( $op eq 'select' ) {
? @{ C4::Acquisition::GetHistory( ordernumbers => \@ordernumbers ) }
: ();
}
elsif ( $op eq 'batch_edit' ) {
elsif ( $op eq 'cud-batch_edit' ) {
@ordernumbers = $input->multi_param('ordernumber');
# build budget list
@ -126,7 +126,7 @@ elsif ( $op eq 'batch_edit' ) {
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;

View File

@ -37,7 +37,7 @@ my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
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);

View File

@ -58,7 +58,7 @@ use Koha::AdditionalFields;
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(

View File

@ -83,7 +83,7 @@ else {
datereceived => $details->{'datereceived'},
);
if ( $op eq 'upload' ) {
if ( $op eq 'cud-upload' ) {
my $uploaded_file = $input->upload('uploadfile');
if ($uploaded_file) {
@ -107,7 +107,7 @@ else {
else {
$errors{'no_file'} = 1;
}
} elsif ( $op eq 'delete' ) {
} elsif ( $op eq 'cud-delete' ) {
$mf->DelFile( id => scalar $input->param('file_id') );
}

View File

@ -97,7 +97,7 @@ elsif ( $op && $op eq 'reopen' ) {
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');
@ -141,7 +141,7 @@ elsif ( $op && $op eq 'mod' ) {
$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' } );
@ -180,7 +180,7 @@ elsif ( $op && $op eq 'del_adj' ) {
$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' } );

View File

@ -80,7 +80,7 @@ for my $field (@additional_fields) {
}
my $invoices = [];
if ( $op and $op eq 'do_search' ) {
if ( $op and $op eq 'cud-do_search' ) {
@{$invoices} = GetInvoices(
invoicenumber => $invoicenumber,
supplierid => $supplierid,
@ -142,7 +142,7 @@ $template->{'VARS'}->{'budgets_loop'} = \@budgets_loop;
$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,

View File

@ -84,7 +84,7 @@ if ( $delay and not $delay =~ /^\d{1,3}$/ ) {
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 {

View File

@ -53,7 +53,7 @@ my $order = GetOrder($ordernumber);
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);

View File

@ -52,7 +52,7 @@ 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 $ordernotes = $input->param('ordernotes');
if ($type eq "vendor") {
$order->{'order_vendornote'} = $ordernotes;

View File

@ -202,7 +202,7 @@ foreach my $budget (@{$budgets}) {
$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;

View File

@ -83,7 +83,7 @@ my $input = CGI->new;
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');

View File

@ -88,7 +88,7 @@ if ( $op eq 'display' ) {
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) {

View File

@ -116,7 +116,7 @@ if( $basketno && $ordernumber) {
} 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' } } );

View File

@ -80,7 +80,7 @@ my $pendingorders = SearchOrders({
});
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++) {

View File

@ -53,9 +53,9 @@ unless ($vendor) {
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');
@ -92,9 +92,9 @@ if ( $op eq 'add_form' || $op eq 'show' ) {
};
}
$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' };

View File

@ -85,7 +85,7 @@ $template->param(
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(
{
@ -98,7 +98,7 @@ if ( $op ne "do_search" ) {
);
$template->param(
serverloop => [ $rs->all ],
opsearch => "search",
opsearch => "cud-search",
);
output_html_with_http_headers $input, $cookie, $template->output;
exit;

View File

@ -47,7 +47,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
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{};
@ -69,7 +69,7 @@ if ( $op eq 'add' ) {
$updated = $af->store ? 1 : 0;
};
push @messages, {
code => 'update',
code => 'cud-update',
number => $updated,
};
} elsif ( $name ) {
@ -88,26 +88,26 @@ if ( $op eq 'add' ) {
$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';

View File

@ -54,7 +54,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
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;

View File

@ -109,7 +109,7 @@ if ( $op eq 'add_form' ) {
} # IF-MOD
}
elsif ( $op eq 'add_validate' ) {
elsif ( $op eq 'cud-add_validate' ) {
## add or modify a budget period (confirmation)
## update budget period data
@ -145,7 +145,7 @@ elsif ( $op eq 'add_validate' ) {
}
#--------------------------------------------------
elsif ( $op eq 'delete_confirm' ) {
elsif ( $op eq 'cud-delete_confirm' ) {
## delete a budget period (preparation)
my $funds = GetBudgets({ budget_period_id => $budget_period_id });
my $fund_count = scalar @$funds;
@ -161,7 +161,7 @@ elsif ( $op eq 'delete_confirm' ) {
);
}
elsif ( $op eq 'delete_confirmed' ) {
elsif ( $op eq 'cud-delete_confirmed' ) {
## confirm no funds have been added to budget
my $funds = GetBudgets({ budget_period_id => $budget_period_id });
my $fund_count = scalar @$funds;
@ -186,7 +186,7 @@ elsif ( $op eq 'duplicate_form'){
}
# handle the actual duplication
elsif ( $op eq 'duplicate_budget' ){
elsif ( $op eq 'cud-duplicate_budget' ){
die "please specify a budget period id\n" if( !defined $budget_period_id || $budget_period_id eq '' );
my $budget_period_startdate = $input->param('budget_period_startdate');
@ -253,7 +253,7 @@ elsif ( $op eq 'close_form' ) {
);
}
elsif ( $op eq 'close_confirmed' ) {
elsif ( $op eq 'cud-close_confirmed' ) {
my $to_budget_period_id = $input->param('to_budget_period_id');
my $move_remaining_unspent = $input->param('move_remaining_unspent');
my $report = MoveOrders(

View File

@ -185,7 +185,7 @@ if ($op eq 'add_form') {
#---------------------- DEFAULT DISPLAY BELOW ---------------------
# called by default form, used to confirm deletion of data in DB
} elsif ($op eq 'delete_confirm') {
} elsif ($op eq 'cud-delete_confirm') {
my $budget = GetBudget($budget_id);
$template->param(
@ -196,14 +196,14 @@ if ($op eq 'add_form') {
);
# END $OP eq DELETE_CONFIRM
# called by delete_confirm, used to effectively confirm deletion of data in DB
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
if ( BudgetHasChildren( $budget_id ) ) {
# We should never be here, the interface does not provide this action.
die("Delete a fund with children is not possible");
}
my $rc = DelBudget($budget_id);
$op = 'list';
} elsif( $op eq 'add_validate' ) {
} elsif( $op eq 'cud-add_validate' ) {
my @budgetusersid;
if (defined $budget_users_ids){
@budgetusersid = split(':', $budget_users_ids);

View File

@ -90,7 +90,7 @@ if ( $op eq 'add_form' ) {
# END $OP eq ADD_FORM
}
#ADD_VALIDATE: called by add_form, used to insert/modify data in DB
elsif ( $op eq 'add_validate' ) {
elsif ( $op eq 'cud-add_validate' ) {
## Please see file perltidy.ERR
$template->param( add_validate => 1 );
@ -129,7 +129,7 @@ elsif ( $op eq 'add_validate' ) {
# END $OP eq ADD_VALIDATE
}
#DELETE_CONFIRM: called by default form, used to confirm deletion of data in DB
elsif ( $op eq 'delete_confirm' ) {
elsif ( $op eq 'cud-delete_confirm' ) {
$template->param( delete_confirm => 1 );
my $contract = GetContract( { contractnumber => $contractnumber } );
@ -145,7 +145,7 @@ elsif ( $op eq 'delete_confirm' ) {
# END $OP eq DELETE_CONFIRM
}
#DELETE_CONFIRMED: called by delete_confirm, used to effectively confirm deletion of data in DB
elsif ( $op eq 'delete_confirmed' ) {
elsif ( $op eq 'cud-delete_confirmed' ) {
my $deleted = DelContract( { contractnumber => $contractnumber } );
if ( $deleted ) {

View File

@ -152,7 +152,7 @@ my %labels;
my @names = $input->multi_param();
# ------------------------------------------------------------
if ( $op eq 'save' ) {
if ( $op eq 'cud-save' ) {
#get budgets
my ( @buds, @auth_values );
foreach my $n (@names) {

View File

@ -32,7 +32,7 @@ my $sound = $cgi->param('sound');
my $id = $cgi->param('id');
my $action = $cgi->param('action');
my $where = $cgi->param('where');
my @delete = $cgi->multi_param('delete');
my @delete = $cgi->multi_param('cud-delete');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{

View File

@ -146,7 +146,7 @@ if ($op eq 'add_form') {
# END $OP eq ADD_FORM
################## ADD_VALIDATE ##################################
# called by add_form, used to insert/modify data in DB
} elsif ($op eq 'add_validate') {
} elsif ($op eq 'cud-add_validate') {
$template->param(tagfield => "$input->param('tagfield')");
my @tagsubfield = $input->multi_param('tagsubfield');
my @liblibrarian = $input->multi_param('liblibrarian');
@ -227,7 +227,7 @@ if ($op eq 'add_form') {
################## DELETE_CONFIRM ##################################
# called by default form, used to confirm deletion of data in DB
}
elsif ( $op eq 'delete_confirm' ) {
elsif ( $op eq 'cud-delete_confirm' ) {
my $ass = Koha::Authority::Subfields->find(
{
authtypecode => $authtypecode,
@ -240,7 +240,7 @@ elsif ( $op eq 'delete_confirm' ) {
delete_link => $script_name,
);
}
elsif ( $op eq 'delete_confirmed' ) {
elsif ( $op eq 'cud-delete_confirmed' ) {
Koha::Authority::Subfields->find(
{
authtypecode => $authtypecode,

View File

@ -55,7 +55,7 @@ my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authty
my $sth;
# check that authtype framework is defined in auth_tag_structure if we are on a default action
if (!$op or $op eq 'authtype_create_confirm') {
if (!$op or $op eq 'cud-authtype_create_confirm') {
$sth=$dbh->prepare("select count(*) from auth_tag_structure where authtypecode=?");
$sth->execute($authtypecode);
my ($authtypeexist) = $sth->fetchrow;
@ -63,7 +63,7 @@ if (!$op or $op eq 'authtype_create_confirm') {
} else {
# if authtype does not exists, then OP must be changed to "create authtype" if we are not on the way to create it
# (op = authtyp_create_confirm)
if ($op eq "authtype_create_confirm") {
if ($op eq "cud-authtype_create_confirm") {
duplicate_auth_framework($authtypecode, $existingauthtypecode);
} else {
$op = "authtype_create";
@ -72,7 +72,7 @@ if (!$op or $op eq 'authtype_create_confirm') {
}
$template->param(script_name => $script_name);
$template->param(authority_types => $authority_types );
if ($op && $op ne 'authtype_create_confirm') {
if ($op && $op ne 'cud-authtype_create_confirm') {
$template->param($op => 1);
} else {
$template->param(else => 1);
@ -106,7 +106,7 @@ if ($op eq 'add_form') {
# END $OP eq ADD_FORM
################## ADD_VALIDATE ##################################
# called by add_form, used to insert/modify data in DB
} elsif ($op eq 'add_validate') {
} elsif ($op eq 'cud-add_validate') {
my $tagfield = $input->param('tagfield');
my $liblibrarian = $input->param('liblibrarian');
my $libopac = $input->param('libopac');
@ -142,7 +142,7 @@ if ($op eq 'add_form') {
# END $OP eq ADD_VALIDATE
################## DELETE_CONFIRM ##################################
# called by default form, used to confirm deletion of data in DB
} elsif ($op eq 'delete_confirm') {
} elsif ($op eq 'cud-delete_confirm') {
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from auth_tag_structure where tagfield=?");
$sth->execute($searchfield);
my $data=$sth->fetchrow_hashref;
@ -153,7 +153,7 @@ if ($op eq 'add_form') {
# END $OP eq DELETE_CONFIRM
################## DELETE_CONFIRMED ##################################
# called by delete_confirm, used to effectively confirm deletion of data in DB
} elsif ($op eq 'delete_confirmed') {
} elsif ($op eq 'cud-delete_confirmed') {
$dbh->do(q|delete from auth_tag_structure where tagfield=? and authtypecode=?|, undef, $searchfield, $authtypecode);
$dbh->do(q|delete from auth_subfield_structure where tagfield=? and authtypecode=?|, undef, $searchfield, $authtypecode);
my $tagfield = $input->param('tagfield');
@ -180,7 +180,7 @@ if ($op eq 'add_form') {
);
################## DEFAULT ##################################
} else { # DEFAULT
# here, $op can be unset or set to "authtype_create_confirm".
# here, $op can be unset or set to "cud-authtype_create_confirm".
# warn "authtype : $authtypecode";
if ($searchfield ne '') {
$template->param(searchfield => $searchfield);

View File

@ -91,7 +91,7 @@ if ($op eq 'add_form') {
branches_loop => \@branches_loop,
);
} elsif ($op eq 'add') {
} elsif ($op eq 'cud-add') {
my $new_authorised_value = $input->param('authorised_value');
my $new_category = $input->param('category');
my $image = $input->param( 'image' ) || '';
@ -149,7 +149,7 @@ if ($op eq 'add_form') {
$op = 'list';
$searchfield = $new_category;
} elsif ($op eq 'add_category' ) {
} elsif ($op eq 'cud-add_category' ) {
my $new_category = $input->param('category');
my $already_exists = Koha::AuthorisedValueCategories->find(
@ -183,7 +183,7 @@ if ($op eq 'add_form') {
}
$op = 'list';
} elsif ($op eq 'delete') {
} elsif ($op eq 'cud-delete') {
my $av = Koha::AuthorisedValues->new->find( $id );
my $deleted = eval {$av->delete};
if ( $@ or not $deleted ) {
@ -193,7 +193,7 @@ if ($op eq 'add_form') {
}
$op = 'list';
} elsif ($op eq 'delete_category') {
} elsif ($op eq 'cud-delete_category') {
my $category_name = $input->param('category_name');
my $avc = Koha::AuthorisedValueCategories->find( $category_name );
my $deleted = eval {$avc->delete};

View File

@ -47,7 +47,7 @@ if ( $op eq 'add_form' ) {
}
$template->param( authority_type => $authority_type );
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
my $authtypecode = $input->param('authtypecode');
my $authtypetext = $input->param('authtypetext');
my $auth_tag_to_report = $input->param('auth_tag_to_report');
@ -82,14 +82,14 @@ if ( $op eq 'add_form' ) {
}
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
my $authority_type = Koha::Authority::Types->find($authtypecode);
my $authorities_using_it = Koha::Authorities->search( { authtypecode => $authtypecode } )->count;
$template->param(
authority_type => $authority_type,
authorities_using_it => $authorities_using_it,
);
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
my $authorities_using_it = Koha::Authorities->search( { authtypecode => $authtypecode } )->count;
if ( $authorities_using_it == 0 ) {
my $authority_type = Koha::Authority::Types->find($authtypecode);

View File

@ -63,7 +63,7 @@ if ( $op eq 'view' ) {
}
}
if ( $op eq 'cancel' ) {
if ( $op eq 'cud-cancel' ) {
my $id = $input->param('id');
my $job = Koha::BackgroundJobs->find($id);
if ( $can_manage_background_jobs

View File

@ -49,7 +49,7 @@ if ( $op eq 'add_form' ) {
$framework = Koha::BiblioFrameworks->find($frameworkcode);
}
$template->param( framework => $framework );
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
my $frameworkcode = $input->param('frameworkcode');
my $frameworktext = $input->param('frameworktext');
my $is_a_modif = $input->param('is_a_modif');
@ -81,7 +81,7 @@ if ( $op eq 'add_form' ) {
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
$cache->clear_from_cache("MarcCodedFields-$frameworkcode");
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
my $framework = Koha::BiblioFrameworks->find($frameworkcode);
my $count = Koha::Biblios->search( { frameworkcode => $frameworkcode, } )->count;
@ -89,7 +89,7 @@ if ( $op eq 'add_form' ) {
framework => $framework,
biblios_use_this_framework => $count,
);
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
my $framework = Koha::BiblioFrameworks->find($frameworkcode);
my $deleted = eval { $framework->delete; };

View File

@ -163,7 +163,7 @@ if ( $op eq 'add_form' ) {
};
}
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
my $library = Koha::Libraries->find($branchcode);
my $items_count = Koha::Items->search(
{ -or => {

View File

@ -56,7 +56,7 @@ if ( $op eq 'add_form' ) {
add_form => 1
);
}
elsif ( $op eq 'add_validate' ) {
elsif ( $op eq 'cud-add_validate' ) {
my $name = $cgi->param('name');
$name ||= q{};
my $description = $cgi->param('description');

View File

@ -56,7 +56,7 @@ if ( $op eq 'add_form' ) {
{ categorycode => $categorycode }, $template );
}
}
elsif ( $op eq 'add_validate' ) {
elsif ( $op eq 'cud-add_validate' ) {
my $categorycode = $input->param('categorycode');
my $description = $input->param('description');
@ -75,7 +75,7 @@ elsif ( $op eq 'add_validate' ) {
my $can_place_ill_in_opac = $input->param('can_place_ill_in_opac') // 1;
my $default_privacy = $input->param('default_privacy');
my $reset_password = $input->param('reset_password');
my $change_password = $input->param('change_password');
my $change_password = $input->param('cud-change_password');
my $exclude_from_local_holds_priority = $input->param('exclude_from_local_holds_priority');
my $min_password_length = $input->param('min_password_length');
my $require_strong_password = $input->param('require_strong_password');
@ -168,7 +168,7 @@ elsif ( $op eq 'add_validate' ) {
$searchfield = q||;
$op = 'list';
}
elsif ( $op eq 'delete_confirm' ) {
elsif ( $op eq 'cud-delete_confirm' ) {
my $count = Koha::Patrons->search({
categorycode => $categorycode
@ -182,7 +182,7 @@ elsif ( $op eq 'delete_confirm' ) {
);
}
elsif ( $op eq 'delete_confirmed' ) {
elsif ( $op eq 'cud-delete_confirmed' ) {
my $categorycode = uc( $input->param('categorycode') );
my $category = Koha::Patron::Categories->find( $categorycode );

View File

@ -28,7 +28,7 @@ use C4::Budgets qw( GetBudget GetBudgetPeriod );
This script checks the amount unallocated from the new parent budget , or the period - if no parent_id is given
This script is called from aqbudgets.pl during an 'add' or 'mod' budget, from the JSscript Check() function,
This script is called from aqbudgets.pl during an 'cud-add' or 'cud-mod' budget, from the JSscript Check() function,
to determine whether the new parent budget (or period) has enough unallocated funds for the save to complete.
=cut

View File

@ -48,7 +48,7 @@ if ( $op eq 'add_form' ) {
}
$template->param( city => $city, );
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
my $city_name = $input->param('city_name');
my $city_state = $input->param('city_state');
my $city_zipcode = $input->param('city_zipcode');
@ -83,10 +83,10 @@ if ( $op eq 'add_form' ) {
}
$city_name = q||;
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
my $city = Koha::Cities->find($cityid);
$template->param( city => $city, );
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
my $city = Koha::Cities->find($cityid);
my $deleted = eval { $city->delete; };

View File

@ -64,7 +64,7 @@ if ( $op eq "add_source" ) {
split_rules => Koha::ClassSplitRules->search,
);
}
elsif ( $op eq "add_source_validate" ) {
elsif ( $op eq "cud-add_source_validate" ) {
my $class_source = Koha::ClassSources->find($cn_source);
if ($class_source) {
$class_source->set(
@ -130,7 +130,7 @@ elsif ( $op eq "add_sort_rule" ) {
sort_routines => get_class_sort_routines(),
);
}
elsif ( $op eq "add_sort_rule_validate" ) {
elsif ( $op eq "cud-add_sort_rule_validate" ) {
my $sort_rule = Koha::ClassSortRules->find($class_sort_rule);
if ($sort_rule) {
$sort_rule->set(
@ -189,7 +189,7 @@ elsif ( $op eq "add_split_rule" ) {
split_routines => get_class_split_routines(),
);
}
elsif ( $op eq "add_split_rule_validate" ) {
elsif ( $op eq "cud-add_split_rule_validate" ) {
my $split_rule = Koha::ClassSplitRules->find($class_split_rule);
@split_regex = grep {!/^$/} @split_regex; # Remove empty

View File

@ -19,7 +19,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $action = $input->param('action') // 'list';
if ( $action eq 'save' ) {
if ( $action eq 'cud-save' ) {
my $module = $input->param('module');
my @columnids = $input->multi_param("columnid");
my @columns;

View File

@ -72,7 +72,7 @@ if ( $op eq 'add_form' ) {
branches_loop => \@branches_loop
);
}
elsif ( $op eq 'add_validate' ) {
elsif ( $op eq 'cud-add_validate' ) {
my $description = $input->param('description');
my $can_be_added_manually = $input->param('can_be_added_manually') || 0;
my $credit_number_enabled = $input->param('credit_number_enabled') || 0;

View File

@ -38,7 +38,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
my $libraries = Koha::Libraries->search( {}, { order_by => ['branchname'] } );
if ( $op eq 'save' ) {
if ( $op eq 'cud-save' ) {
foreach my $library ( $libraries->as_list ) {
my $branchcode = $library->branchcode;

View File

@ -50,7 +50,7 @@ if ( $op eq 'add_form' ) {
}
$template->param( currency => $currency, );
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
my $currency_code = $input->param('currency_code');
my $symbol = $input->param('symbol');
my $isocode = $input->param('isocode');
@ -91,7 +91,7 @@ if ( $op eq 'add_form' ) {
}
$searchfield = q||;
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
my $currency = Koha::Acquisition::Currencies->find($currency_code);
my $nb_of_orders = Koha::Acquisition::Orders->search( { currency => $currency->currency } )->count;
@ -101,7 +101,7 @@ if ( $op eq 'add_form' ) {
nb_of_orders => $nb_of_orders,
nb_of_vendors => $nb_of_vendors,
);
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
my $currency = Koha::Acquisition::Currencies->find($currency_code);
my $deleted = eval { $currency->delete; };

View File

@ -72,7 +72,7 @@ if ( $op eq 'add_form' ) {
branches_loop => \@branches_loop
);
}
elsif ( $op eq 'add_validate' ) {
elsif ( $op eq 'cud-add_validate' ) {
my $description = $input->param('description');
my $can_be_invoiced = $input->param('can_be_invoiced') || 0;
my $can_be_sold = $input->param('can_be_sold') || 0;

View File

@ -50,7 +50,7 @@ if ( $op eq 'add_form' ) {
}
$template->param( desk => $desk, );
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
my $desk_id = $input->param('desk_id');
my $desk_name = $input->param('desk_name');
my $branchcode = $input->param('branchcode');
@ -82,10 +82,10 @@ if ( $op eq 'add_form' ) {
}
$searchfield = q||;
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
my $desk = Koha::Desks->find($desk_id);
$template->param( desk => $desk, );
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
my $desk = Koha::Desks->find($desk_id);
my $deleted = eval { $desk->delete; };

View File

@ -63,12 +63,12 @@ if ( $op eq 'acct_form' ) {
$template->param( plugins => \@plugins );
}
}
elsif ( $op eq 'delete_confirm' ) {
elsif ( $op eq 'cud-delete_confirm' ) {
show_account($crypt);
$template->param( delete_confirm => 1 );
}
else {
if ( $op eq 'save' ) {
if ( $op eq 'cud-save' ) {
# validate & display
my $id = $input->param('id');
@ -105,7 +105,7 @@ else {
$schema->resultset('VendorEdiAccount')->create($fields);
}
}
elsif ( $op eq 'delete_confirmed' ) {
elsif ( $op eq 'cud-delete_confirmed' ) {
$schema->resultset('VendorEdiAccount')
->search( { id => scalar $input->param('id'), } )->delete_all;

View File

@ -54,7 +54,7 @@ if ( $op eq 'ean_form' ) {
ean => $e,
);
}
elsif ( $op eq 'delete_confirm' ) {
elsif ( $op eq 'cud-delete_confirm' ) {
my $e = $schema->resultset('EdifactEan')->find($id);
$template->param(
delete_confirm => 1,
@ -62,7 +62,7 @@ elsif ( $op eq 'delete_confirm' ) {
);
}
else {
if ( $op eq 'save' ) {
if ( $op eq 'cud-save' ) {
my $change = $id;
if ($change) {
$schema->resultset('EdifactEan')->find($id)->update(
@ -86,7 +86,7 @@ else {
$new_ean->insert();
}
}
elsif ( $op eq 'delete_confirmed' ) {
elsif ( $op eq 'cud-delete_confirmed' ) {
my $e = $schema->resultset('EdifactEan')->find($id);
$e->delete if $e;
}

View File

@ -50,7 +50,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
my @messages;
if ( !$domain_ops && $op eq 'add' ) {
if ( !$domain_ops && $op eq 'cud-add' ) {
# IdP configuration params
my $code = $input->param('code');
@ -113,7 +113,7 @@ if ( !$domain_ops && $op eq 'add' ) {
# list servers after adding
$op = 'list';
}
elsif ( $domain_ops && $op eq 'add' ) {
elsif ( $domain_ops && $op eq 'cud-add' ) {
my $allow_opac = $input->param('allow_opac');
my $allow_staff = $input->param('allow_staff');
@ -155,7 +155,7 @@ elsif ( $domain_ops && $op eq 'add' ) {
# list servers after adding
$op = 'list';
}
elsif ( !$domain_ops && $op eq 'edit_form' ) {
elsif ( !$domain_ops && $op eq 'cud-edit_form' ) {
if ( $identity_provider ) {
$template->param(
@ -171,7 +171,7 @@ elsif ( !$domain_ops && $op eq 'edit_form' ) {
};
}
}
elsif ( $domain_ops && $op eq 'edit_form' ) {
elsif ( $domain_ops && $op eq 'cud-edit_form' ) {
my $identity_provider_domain_id = $input->param('identity_provider_domain_id');
my $identity_provider_domain;
@ -192,7 +192,7 @@ elsif ( $domain_ops && $op eq 'edit_form' ) {
};
}
}
elsif ( !$domain_ops && $op eq 'edit_save' ) {
elsif ( !$domain_ops && $op eq 'cud-edit_save' ) {
if ( $identity_provider ) {
@ -243,7 +243,7 @@ elsif ( !$domain_ops && $op eq 'edit_save' ) {
};
}
}
elsif ( $domain_ops && $op eq 'edit_save' ) {
elsif ( $domain_ops && $op eq 'cud-edit_save' ) {
my $identity_provider_domain_id = $input->param('identity_provider_domain_id');
my $identity_provider_domain;

View File

@ -51,7 +51,7 @@ if ( $op eq 'add_form' ) {
if ($status) {
$template->param( status => $status );
}
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
my $name = $input->param('name');
my $code = $input->param('code');
@ -75,7 +75,7 @@ if ( $op eq 'add_form' ) {
push @messages, { type => 'error', code => 'error_on_saving' };
};
$op = 'list';
} elsif ( $op eq 'delete' ) {
} elsif ( $op eq 'cud-delete' ) {
try {
$status->delete_and_log;
push @messages, { code => 'success_on_delete', type => 'message' };

View File

@ -41,10 +41,10 @@ unless ($auth_status eq 'ok') {
}
my $authtypecode = $input->param('authtypecode') || 'default';
my $action = $input->param('action') || 'export';
my $action = $input->param('action') || 'cud-export';
## Exporting
if ($action eq 'export' && $input->request_method() eq 'GET') {
if ($action eq 'cud-export' && $input->request_method() eq 'GET') {
my $strXml = '';
my $format = $input->param('type_export_' . $authtypecode);
if ($authtypecode eq 'default') {

View File

@ -41,10 +41,10 @@ unless ($auth_status eq 'ok') {
}
my $frameworkcode = $input->param('frameworkcode') || 'default';
my $action = $input->param('action') || 'export';
my $action = $input->param('action') || 'cud-export';
## Exporting
if ($action eq 'export' && $input->request_method() eq 'GET') {
if ($action eq 'cud-export' && $input->request_method() eq 'GET') {
my $strXml = '';
my $format = $input->param('type_export_' . $frameworkcode);
if ($frameworkcode eq 'default') {

View File

@ -109,7 +109,7 @@ sub dispatch {
toggle => \&toggle,
);
my $input = CGI->new;
my $action = $input->param('action') || 'show';
my $action = $input->param('action') || 'cud-show';
if (not exists $handler{$action}) {
my $status = 400;
print $input->header(-status => $status);

View File

@ -36,7 +36,7 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({
my $op = $cgi->param('op') || '';
my $name = $cgi->param('name');
if ($op eq 'mod') {
if ($op eq 'cud-mod') {
my %vars = $cgi->Vars;
my $field = { name => $name };
my @params = qw(label tagfield tagsubfield authorised_values_category);
@ -48,7 +48,7 @@ if ($op eq 'mod') {
my $updated = ($field) ? 1 : 0;
print $cgi->redirect('/cgi-bin/koha/admin/items_search_fields.pl?updated=' . $updated);
exit;
} elsif ( $op eq 'add' ) {
} elsif ( $op eq 'cud-add' ) {
my %vars = $cgi->Vars;
my $field;
my @params = qw(name label tagfield tagsubfield authorised_values_category);

View File

@ -35,7 +35,7 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({
my $op = $cgi->param('op') || '';
if ($op eq 'del') {
if ($op eq 'cud-del') {
my $name = $cgi->param('name');
my $rv = DelItemSearchField($name);
if ($rv) {

View File

@ -70,7 +70,7 @@ if ( $op eq 'add_form' ) {
searchcategory => $searchcategory,
can_be_translated => ( scalar(@$translated_languages) > 1 ? 1 : 0 ),
);
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
my $is_a_modif = $input->param('is_a_modif');
my $itemtype = Koha::ItemTypes->find($itemtype_code);
my $parent_type = $input->param('parent_type') || undef;
@ -173,7 +173,7 @@ if ( $op eq 'add_form' ) {
$searchfield = '';
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
my $itemtype = Koha::ItemTypes->find($itemtype_code);
my $can_be_deleted = $itemtype->can_be_deleted();
if ($can_be_deleted == 0) {
@ -183,7 +183,7 @@ if ( $op eq 'add_form' ) {
$template->param( itemtype => $itemtype, );
}
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
my $itemtype = Koha::ItemTypes->find($itemtype_code);
my $deleted = eval { $itemtype->delete };

View File

@ -41,7 +41,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $action = $cgi->param('action') || q{};
my @messages;
if ( $action eq 'add' ) {
if ( $action eq 'cud-add' ) {
my $parent_id = $cgi->param('parent_id') || undef;
my $title = $cgi->param('title') || undef;
my $description = $cgi->param('description') || undef;
@ -81,7 +81,7 @@ if ( $action eq 'add' ) {
}
}
}
elsif ( $action eq 'edit' ) {
elsif ( $action eq 'cud-edit' ) {
my $id = $cgi->param('id') || undef;
my $title = $cgi->param('title') || undef;
my $description = $cgi->param('description') || undef;
@ -111,7 +111,7 @@ elsif ( $action eq 'edit' ) {
$template->param( edited => $group );
}
}
elsif ( $action eq 'delete' ) {
elsif ( $action eq 'cud-delete' ) {
my $id = $cgi->param('id');
my $group = Koha::Library::Groups->find($id);

View File

@ -37,11 +37,11 @@ my $rule_from_cgi = sub {
my %rule = map { $_ => scalar $cgi->param($_) } (
'tag',
'module',
'filter',
'add',
'cud-filter',
'cud-add',
'append',
'remove',
'delete'
'cud-delete'
);
my $id = $cgi->param('id');
@ -84,17 +84,17 @@ if ($op eq 'remove' || $op eq 'doremove') {
$rules = $get_rules->();
}
}
elsif ($op eq 'edit') {
elsif ($op eq 'cud-edit') {
$template->param( edit => 1 );
my $id = $input->param('id');
for my $rule(@{$rules}) {
if ($rule->{id} == $id) {
$rule->{'edit'} = 1;
$rule->{'cud-edit'} = 1;
last;
}
}
}
elsif ($op eq 'doedit' || $op eq 'add') {
elsif ($op eq 'doedit' || $op eq 'cud-add') {
my $rule_data = $rule_from_cgi->($input);
if (!@{$errors}) {
try {

View File

@ -214,7 +214,7 @@ if ( $op eq 'add_form' ) {
################## ADD_VALIDATE ##################################
# called by add_form, used to insert/modify data in DB
}
elsif ( $op eq 'add_validate' ) {
elsif ( $op eq 'cud-add_validate' ) {
my $dbh = C4::Context->dbh;
$template->param( tagfield => "$input->param('tagfield')" );
my $tagfield = $input->param('tagfield');
@ -312,7 +312,7 @@ elsif ( $op eq 'add_validate' ) {
################## DELETE_CONFIRM ##################################
# called by default form, used to confirm deletion of data in DB
}
elsif ( $op eq 'delete_confirm' ) {
elsif ( $op eq 'cud-delete_confirm' ) {
my $mss = Koha::MarcSubfieldStructures->find(
{
tagfield => $tagfield,
@ -329,7 +329,7 @@ elsif ( $op eq 'delete_confirm' ) {
################## DELETE_CONFIRMED ##################################
# called by delete_confirm, used to effectively confirm deletion of data in DB
}
elsif ( $op eq 'delete_confirmed' ) {
elsif ( $op eq 'cud-delete_confirmed' ) {
Koha::MarcSubfieldStructures->find(
{
tagfield => $tagfield,

View File

@ -63,7 +63,7 @@ my ($frameworkexist) = $sth->fetchrow;
unless ($frameworkexist) {
# if frameworkcode does not exists, then OP must be changed to "create framework" if we are not on the way to create it
# (op = itemtyp_create_confirm)
if ($op eq "framework_create_confirm") {
if ($op eq "cud-framework_create_confirm") {
duplicate_framework($frameworkcode, $existingframeworkcode);
$op = ""; # unset $op to go back to framework list
} else {
@ -110,7 +110,7 @@ if ($op eq 'add_form') {
# END $OP eq ADD_FORM
################## ADD_VALIDATE ##################################
# called by add_form, used to insert/modify data in DB
} elsif ($op eq 'add_validate') {
} elsif ($op eq 'cud-add_validate') {
my $tagfield = $input->param('tagfield');
my $liblibrarian = $input->param('liblibrarian');
my $libopac = $input->param('libopac');
@ -160,7 +160,7 @@ if ($op eq 'add_form') {
# END $OP eq ADD_VALIDATE
################## DELETE_CONFIRM ##################################
# called by default form, used to confirm deletion of data in DB
} elsif ($op eq 'delete_confirm') {
} elsif ($op eq 'cud-delete_confirm') {
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue from marc_tag_structure where tagfield=? and frameworkcode=?");
$sth->execute($searchfield, $frameworkcode);
my $data = $sth->fetchrow_hashref;
@ -171,7 +171,7 @@ if ($op eq 'add_form') {
# END $OP eq DELETE_CONFIRM
################## DELETE_CONFIRMED ##################################
# called by delete_confirm, used to effectively confirm deletion of data in DB
} elsif ($op eq 'delete_confirmed') {
} elsif ($op eq 'cud-delete_confirmed') {
my $sth1 = $dbh->prepare("DELETE FROM marc_tag_structure WHERE tagfield=? AND frameworkcode=?");
my $sth2 = $dbh->prepare("DELETE FROM marc_subfield_structure WHERE tagfield=? AND frameworkcode=?");
$sth1->execute($searchfield, $frameworkcode);
@ -198,7 +198,7 @@ if ($op eq 'add_form') {
################## DEFAULT ##################################
} else { # DEFAULT
# here, $op can be unset or set to "framework_create_confirm".
# here, $op can be unset or set to "cud-framework_create_confirm".
if ($searchfield ne '') {
$template->param(searchfield => $searchfield);
}

View File

@ -49,7 +49,7 @@ my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
my $id = $input->param('id');
my $op = $input->param('op');
if($op && $op eq "save") {
if($op && $op eq "cud-save") {
my @marcfields = $input->multi_param('marcfield');
my @marcsubfields = $input->multi_param('marcsubfield');
my @operators = $input->multi_param('operator');

View File

@ -46,7 +46,7 @@ my $op = $input->param('op');
if($op && $op eq "new") {
$template->param( op_new => 1 );
} elsif($op && $op eq "savenew") {
} elsif($op && $op eq "cud-savenew") {
my $spec = $input->param('spec');
my $name = $input->param('name');
my @descriptions = $input->multi_param('description');
@ -55,7 +55,7 @@ if($op && $op eq "new") {
name => $name,
descriptions => \@descriptions
});
} elsif($op && $op eq "mod") {
} elsif($op && $op eq "cud-mod") {
my $id = $input->param('id');
my $set = GetOAISet($id);
$template->param(
@ -65,7 +65,7 @@ if($op && $op eq "new") {
name => $set->{'name'},
descriptions => [ map { {description => $_} } @{ $set->{'descriptions'} } ],
);
} elsif($op && $op eq "savemod") {
} elsif($op && $op eq "cud-savemod") {
my $id = $input->param('id');
my $spec = $input->param('spec');
my $name = $input->param('name');
@ -76,7 +76,7 @@ if($op && $op eq "new") {
name => $name,
descriptions => \@descriptions
});
} elsif($op && $op eq "del") {
} elsif($op && $op eq "cud-del") {
my $id = $input->param('id');
DelOAISet($id);
}

View File

@ -39,7 +39,7 @@ our ( $template, $loggedinuser, $cookie ) = get_template_and_user(
}
);
if ( $op && $op eq 'update' ) {
if ( $op && $op eq 'cud-update' ) {
my %od_info;
@od_info{ @branchcodes } = @authnames;
while( my($branchcode,$authname) = each %od_info){

View File

@ -56,11 +56,11 @@ my $display_list = 0;
if ($op eq "edit_attribute_type") {
edit_attribute_type_form($template, $code);
} elsif ($op eq "edit_attribute_type_confirmed") {
$display_list = add_update_attribute_type('edit', $template, $code);
$display_list = add_update_attribute_type('cud-edit', $template, $code);
} elsif ($op eq "add_attribute_type") {
add_attribute_type_form($template);
} elsif ($op eq "add_attribute_type_confirmed") {
$display_list = add_update_attribute_type('add', $template, $code);
$display_list = add_update_attribute_type('cud-add', $template, $code);
} elsif ($op eq "delete_attribute_type") {
$display_list = delete_attribute_type_form($template, $code);
} elsif ($op eq "delete_attribute_type_confirmed") {
@ -126,7 +126,7 @@ sub add_update_attribute_type {
my $class = $input->param('class');
my $attr_type = Koha::Patron::Attribute::Types->find($code);
if ( $op eq 'edit' ) {
if ( $op eq 'cud-edit' ) {
$attr_type->description($description);
}
else {
@ -166,7 +166,7 @@ sub add_update_attribute_type {
my @branches = grep { ! /^\s*$/ } $input->multi_param('branches');
$attr_type->library_limits( \@branches );
if ( $op eq 'edit' ) {
if ( $op eq 'cud-edit' ) {
$template->param( edited_attribute_type => $attr_type->code() );
}
else {

View File

@ -75,8 +75,8 @@ sub _get_chunk {
if ( $options{'class'} && $options{'class'} eq 'password' ) {
$chunk->{'input_type'} = 'password';
} elsif ( $options{'class'} && $options{'class'} eq 'email' ) {
$chunk->{'input_type'} = 'email';
} elsif ( $options{'class'} && $options{'class'} eq 'cud-email' ) {
$chunk->{'input_type'} = 'cud-email';
} elsif ( $options{'class'} && $options{'class'} eq 'date' ) {
$chunk->{'dateinput'} = 1;
} elsif ( $options{'type'} && ( $options{'type'} eq 'opac-languages' || $options{'type'} eq 'staff-languages' ) ) {
@ -120,7 +120,7 @@ sub _get_chunk {
$value ||= 0;
$chunk->{'type'} = ( $options{class} && $options{class} eq 'multiple' ) ? 'multiple' : 'select';
$chunk->{'type'} = ( $options{class} && $options{class} eq 'multiple' ) ? 'multiple' : 'cud-select';
my @values;
@values = split /,/, $value if defined($value);
@ -143,7 +143,7 @@ sub _get_chunk {
unshift @{ $chunk->{CHOICES} }, {
text => '',
value => '',
} if $add_blank && $chunk->{type} eq 'select';
} if $add_blank && $chunk->{type} eq 'cud-select';
} elsif ( $options{'multiple'} ) {
my @values;
@ -358,7 +358,7 @@ $tab ||= 'accounting'; # Ideally this should be "local-use" but preferences.pl
my $highlighted;
if ( $op eq 'save' ) {
if ( $op eq 'cud-save' ) {
output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
foreach my $param ( $input->param() ) {
my ( $pref ) = ( $param =~ /pref_(.*)/ );
@ -376,7 +376,7 @@ if ( $op eq 'save' ) {
my @TABS;
if ( $op eq 'search' ) {
if ( $op eq 'cud-search' ) {
my $searchfield = $input->param( 'searchfield' );
$searchfield =~ s/\p{IsC}//g;

View File

@ -51,7 +51,7 @@ if ( $op eq 'add_form') {
restriction => scalar Koha::Patron::Restriction::Types->find($code)
);
}
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
my $display_text = $input->param('display_text');
my $lift_after_payment = $input->param('lift_after_payment');
@ -103,11 +103,11 @@ if ( $op eq 'add_form') {
my $restriction = Koha::Patron::Restriction::Types->find($code);
$restriction->make_default;
$op = 'list';
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
$template->param(
restriction => scalar Koha::Patron::Restriction::Types->find($code)
);
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
try {
Koha::Patron::Restriction::Types->find($code)->delete;
push @messages, { type => 'message', code => 'delete_success' };

View File

@ -38,7 +38,7 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({
my $op = $cgi->param('op') || '';
if ($op eq 'del') {
if ($op eq 'cud-del') {
my $id = $cgi->param('id');
my $sf = Koha::SearchFilters->find($id);
$template->param(filter_not_found => 1) unless $sf;

View File

@ -46,7 +46,7 @@ if ($mana_base) {
$bad_url = 1 unless (exists($result->{version}));
}
if ( $op eq 'save' ) {
if ( $op eq 'cud-save' ) {
my $auto_share = $query->param('autosharewithmana') || q{};
my $mana = $query->param('mana');
@ -59,13 +59,13 @@ if ( $op eq 'save' ) {
}
}
if ( $op eq 'reset' ) {
if ( $op eq 'cud-reset' ) {
C4::Context->set_preference('ManaToken', '');
}
if ( $op eq 'send' && not $bad_url ) {
if ( $op eq 'cud-send' && not $bad_url ) {
my $name = $query->param('name');
my $email = $query->param('email');
my $email = $query->param('cud-email');
my $content = to_json({name => $name,
email => $email});

View File

@ -67,7 +67,7 @@ my $language = C4::Languages::getlanguage();
my $cache = Koha::Caches->get_instance;
$cache->clear_from_cache( Koha::CirculationRules::GUESSED_ITEMTYPES_KEY );
if ($op eq 'delete') {
if ($op eq 'cud-delete') {
my $itemtype = $input->param('itemtype');
my $categorycode = $input->param('categorycode');
@ -252,7 +252,7 @@ elsif ($op eq 'delete-branch-item') {
}
}
# save the values entered
elsif ( $op eq 'add' ) {
elsif ( $op eq 'cud-add' ) {
my $br = $branch; # branch
my $bor = $input->param('categorycode'); # borrower category
my $itemtype = $input->param('itemtype'); # item type
@ -356,7 +356,7 @@ elsif ( $op eq 'add' ) {
);
}
elsif ($op eq "set-branch-defaults") {
elsif ($op eq "cud-set-branch-defaults") {
my $categorycode = $input->param('categorycode');
my $patron_maxissueqty = strip_non_numeric( scalar $input->param('patron_maxissueqty') );
my $patron_maxonsiteissueqty = $input->param('patron_maxonsiteissueqty');
@ -420,7 +420,7 @@ elsif ($op eq "set-branch-defaults") {
}
);
}
elsif ($op eq "add-branch-cat") {
elsif ($op eq "cud-add-branch-cat") {
my $categorycode = $input->param('categorycode');
my $patron_maxissueqty = strip_non_numeric( scalar $input->param('patron_maxissueqty') );
my $patron_maxonsiteissueqty = $input->param('patron_maxonsiteissueqty');
@ -480,7 +480,7 @@ elsif ($op eq "add-branch-cat") {
);
}
}
elsif ( $op eq "add-open-article-requests-limit" ) {
elsif ( $op eq "cud-add-open-article-requests-limit" ) {
my $categorycode = $input->param('categorycode');
my $open_article_requests_limit = strip_non_numeric( scalar $input->param('open_article_requests_limit') );
@ -553,7 +553,7 @@ elsif ( $op eq "add-open-article-requests-limit" ) {
);
}
}
elsif ( $op eq "set-article-request-fee" ) {
elsif ( $op eq "cud-set-article-request-fee" ) {
my $category = $input->param('article_request_fee_category');
my $fee = strip_non_numeric( scalar $input->param('article_request_fee') );
@ -580,7 +580,7 @@ elsif ( $op eq "set-article-request-fee" ) {
}
);
}
elsif ($op eq "add-branch-item") {
elsif ($op eq "cud-add-branch-item") {
my $itemtype = $input->param('itemtype');
my $holdallowed = $input->param('holdallowed');
my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy');
@ -638,7 +638,7 @@ elsif ($op eq "add-branch-item") {
);
}
}
elsif ( $op eq 'mod-refund-lost-item-fee-rule' ) {
elsif ( $op eq 'cud-mod-refund-lost-item-fee-rule' ) {
my $lostreturn = $input->param('lostreturn');
@ -689,7 +689,7 @@ elsif ( $op eq 'mod-refund-lost-item-fee-rule' ) {
}
);
}
} elsif ( $op eq "set-waiting-hold-cancellation" ) {
} elsif ( $op eq "cud-set-waiting-hold-cancellation" ) {
my $category = $input->param('waiting_hold_cancellation_category');
my $itemtype = $input->param('waiting_hold_cancellation_itemtype');
@ -730,9 +730,9 @@ my $refundProcessingFeeRule = Koha::CirculationRules->find({ branchcode => ($bra
my $defaultProcessingFeeRule = Koha::CirculationRules->find({ branchcode => undef, rule_name => 'processingreturn' });
$template->param(
refundLostItemFeeRule => $refundLostItemFeeRule,
defaultRefundRule => $defaultLostItemFeeRule ? $defaultLostItemFeeRule->rule_value : 'refund',
defaultRefundRule => $defaultLostItemFeeRule ? $defaultLostItemFeeRule->rule_value : 'cud-refund',
refundProcessingFeeRule => $refundProcessingFeeRule,
defaultProcessingRefundRule => $defaultProcessingFeeRule ? $defaultProcessingFeeRule->rule_value : 'refund',
defaultProcessingRefundRule => $defaultProcessingFeeRule ? $defaultProcessingFeeRule->rule_value : 'cud-refund',
);
my $patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description'] });

View File

@ -44,7 +44,7 @@ my $id = $cgi->param('id');
my $name = $cgi->param('name');
my $domain = $cgi->param('domain');
if ( $op eq 'add_update' ) {
if ( $op eq 'cud-add_update' ) {
if ( $name && $domain ) {
if ($id) {
my $provider = Koha::SMS::Providers->find($id);
@ -57,7 +57,7 @@ if ( $op eq 'add_update' ) {
}
}
}
elsif ( $op eq 'delete' ) {
elsif ( $op eq 'cud-delete' ) {
my $provider = Koha::SMS::Providers->find($id);
$provider->delete() if $provider;
}

View File

@ -44,7 +44,7 @@ my @messages;
my $smtp_servers = Koha::SMTP::Servers->search;
if ( $op eq 'add' ) {
if ( $op eq 'cud-add' ) {
my $name = $input->param('smtp_name');
my $host = $input->param('smtp_host');
@ -88,7 +88,7 @@ if ( $op eq 'add' ) {
# list servers after adding
$op = 'list';
}
elsif ( $op eq 'edit_form' ) {
elsif ( $op eq 'cud-edit_form' ) {
my $smtp_server_id = $input->param('smtp_server_id');
my $smtp_server;
@ -110,7 +110,7 @@ elsif ( $op eq 'edit_form' ) {
};
}
}
elsif ( $op eq 'edit_save' ) {
elsif ( $op eq 'cud-edit_save' ) {
my $smtp_server_id = $input->param('smtp_server_id');
my $smtp_server;

View File

@ -108,7 +108,7 @@ sub GetPrefParams {
if ( not defined( $data->{'type'} ) ) {
$params->{'type_free'} = 1;
$params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 );
} elsif ( $data->{'type'} eq 'Upload' ) {
} elsif ( $data->{'type'} eq 'cud-Upload' ) {
$params->{'type_upload'} = 1;
} elsif ( $data->{'type'} eq 'Choice' ) {
$params->{'type_choice'} = 1;
@ -302,7 +302,7 @@ if ( $op eq 'add_form' ) {
################## ADD_VALIDATE ##################################
# called by add_form, used to insert/modify data in DB
} elsif ( $op eq 'add_validate' ) {
} elsif ( $op eq 'cud-add_validate' ) {
output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
# to handle multiple values
my $value;
@ -328,7 +328,7 @@ if ( $op eq 'add_form' ) {
}
}
if ( $type eq 'Upload' ) {
if ( $type eq 'cud-Upload' ) {
my $lgtfh = $input->upload('value');
$value = join '', <$lgtfh>;
$value = encode_base64($value);
@ -339,7 +339,7 @@ if ( $op eq 'add_form' ) {
exit;
################## DELETE_CONFIRM ##################################
# called by default form, used to confirm deletion of data in DB
} elsif ( $op eq 'delete_confirm' ) {
} elsif ( $op eq 'cud-delete_confirm' ) {
my $value = C4::Context->preference($searchfield);
$template->param(
searchfield => $searchfield,
@ -349,7 +349,7 @@ if ( $op eq 'add_form' ) {
# END $OP eq DELETE_CONFIRM
################## DELETE_CONFIRMED ##################################
# called by delete_confirm, used to effectively confirm deletion of data in DB
} elsif ( $op eq 'delete_confirmed' ) {
} elsif ( $op eq 'cud-delete_confirmed' ) {
output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
C4::Context->delete_preference($searchfield);
# END $OP eq DELETE_CONFIRMED

View File

@ -37,7 +37,7 @@ my ($template, $loggedinuser, $cookie)
});
my $use_transport_cost_matrix = C4::Context->preference("UseTransportCostMatrix");
my $update = ( $input->param('op') // '' ) eq 'set-cost-matrix';
my $update = ( $input->param('op') // '' ) eq 'cud-set-cost-matrix';
my ($cost_matrix, $have_matrix);
unless ($update) {

View File

@ -35,7 +35,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $op = $query->param('op') || q||;
if ( $op eq 'update' ) {
if ( $op eq 'cud-update' ) {
my $UsageStats = $query->param('UsageStats');
my $UsageStatsCountry = $query->param('UsageStatsCountry');
my $UsageStatsLibraryName = $query->param('UsageStatsLibraryName');

View File

@ -54,7 +54,7 @@ my $schema = Koha::Database->new()->schema();
# Main code
# First process a confirmed delete, or save a validated record
if( $op eq 'delete_confirmed' && $id ) {
if( $op eq 'cud-delete_confirmed' && $id ) {
my $server = Koha::Z3950Servers->find($id);
if ( $server ) {
$server->delete;
@ -63,7 +63,7 @@ if( $op eq 'delete_confirmed' && $id ) {
$template->param( msg_notfound => 1, msg_add => $id );
}
$id = 0;
} elsif ( $op eq 'add_validated' ) {
} elsif ( $op eq 'cud-add_validated' ) {
my @fields=qw/host port db userid password rank syntax encoding timeout
recordtype checked servername servertype sru_options sru_fields attributes
add_xslt/;
@ -89,11 +89,11 @@ if( $op eq 'delete_confirmed' && $id ) {
# Now list multiple records, or edit one record
my $data = [];
if ( $op eq 'add' || $op eq 'edit' ) {
if ( $op eq 'cud-add' || $op eq 'cud-edit' ) {
$data = ServerSearch( $schema, $id, $searchfield ) if $searchfield || $id;
delete $data->[0]->{id} if @$data && $op eq 'add'; #cloning record
delete $data->[0]->{id} if @$data && $op eq 'cud-add'; #cloning record
$template->param( add_form => 1, server => @$data? $data->[0]: undef,
op => $op, type => $op eq 'add'? lc $type: '' );
op => $op, type => $op eq 'cud-add'? lc $type: '' );
} else {
$data = ServerSearch( $schema, $id, $searchfield );
$template->param( loop => \@$data, searchfield => $searchfield, id => $id,

View File

@ -38,7 +38,7 @@ my $relationship = $query->param('relationship') || '';
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => ( $op eq 'do_search' )
template_name => ( $op eq 'cud-do_search' )
? 'authorities/searchresultlist-auth.tt'
: 'authorities/auth_finder.tt',
query => $query,
@ -50,7 +50,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypetext'] } );
# If search form posted
if ( $op eq "do_search" ) {
if ( $op eq "cud-do_search" ) {
my @marclist = $query->multi_param('marclist');
my @and_or = $query->multi_param('and_or');
my @excluding = $query->multi_param('excluding');

View File

@ -47,7 +47,7 @@ my ( $template, $loggedinuser, $cookie );
my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypetext'] } );
my $pending_deletion_authid;
if ( $op eq "delete" ) {
if ( $op eq "cud-delete" ) {
( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "authorities/authorities-home.tt",
@ -63,13 +63,13 @@ if ( $op eq "delete" ) {
if ( $query->param('operator') ) {
# query contains search params so perform search
$op = "do_search";
$op = "cud-do_search";
}
else {
$op = '';
}
}
if ( $op eq "do_search" ) {
if ( $op eq "cud-do_search" ) {
my $marclist = $query->param('marclist') || '';
my $and_or = $query->param('and_or') || '';
my $excluding = $query->param('excluding') || '';

View File

@ -83,7 +83,7 @@ sub build_authorized_values_list {
}
return {
type => 'select',
type => 'cud-select',
id => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
name => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
values => \@authorised_values,
@ -585,7 +585,7 @@ if ($authid) {
}
$op ||= q{};
#------------------------------------------------------------------------------------------------------------------------------
if ($op eq "add") {
if ($op eq "cud-add") {
#------------------------------------------------------------------------------------------------------------------------------
# rebuild
my @tags = $input->multi_param('tag');
@ -597,7 +597,7 @@ if ($op eq "add") {
my $record = TransformHtmlToMarc($input, 0);
my ($duplicateauthid,$duplicateauthvalue);
($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode) if ($op eq "add") && (!$is_a_modif);
($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode) if ($op eq "cud-add") && (!$is_a_modif);
my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
if (!$duplicateauthid or $confirm_not_duplicate) {
@ -621,7 +621,7 @@ if ($op eq "add") {
duplicateauthvalue => $duplicateauthvalue->{'authorized'}->[0]->{'heading'},
);
}
} elsif ($op eq "delete") {
} elsif ($op eq "cud-delete") {
#------------------------------------------------------------------------------------------------------------------------------
DelAuthority({ authid => $authid });
if ($nonav){

View File

@ -20,7 +20,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $op = $query->param("op");
my $format = $query->param("format");
my $error = '';
if ( $op eq "export" ) {
if ( $op eq "cud-export" ) {
my $authid = $query->param("authid");
if ($authid) {

View File

@ -82,7 +82,7 @@ if ($email_add) {
tables => {
borrowers => $borrowernumber,
},
message_transport_type => 'email',
message_transport_type => 'cud-email',
loops => \%loops,
substitute => \%substitute,
);
@ -96,7 +96,7 @@ if ($email_add) {
my $message_id = C4::Letters::EnqueueLetter(
{
letter => $letter,
message_transport_type => 'email',
message_transport_type => 'cud-email',
to_address => $email_add,
reply_address => $user_email,
attachments => [$attachment],

View File

@ -21,7 +21,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
my $op=$query->param("op");
my $format=$query->param("format");
my $error = '';
if ($op eq "export") {
if ($op eq "cud-export") {
my $biblionumber = $query->param("bib");
if ($biblionumber){
my $file_id = $biblionumber;

View File

@ -39,7 +39,7 @@ my $action = $cgi->param('action') || q{list};
my $previous = $cgi->param('previous');
# Deleting search history
if ( $action eq 'delete' ) {
if ( $action eq 'cud-delete' ) {
my $sessionid = defined $previous
? $cgi->cookie("CGISESSID")
: q{};

View File

@ -150,7 +150,7 @@ if (!defined $op) {
# Return to items list
print $input->redirect("?biblionumber=" . $params{biblionumber});
} elsif ($op eq "add_item_to_rota") {
} elsif ($op eq "cud-add_item_to_rota") {
my $item = Koha::Items->find($params{item_id});

View File

@ -58,27 +58,27 @@ for ($damaged,$itemlost,$withdrawn) {
my $messages = q{};
# modify MARC item if input differs from items table.
if ( $op eq "set_non_public_note" ) {
if ( $op eq "cud-set_non_public_note" ) {
checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
if ((not defined $item_data_hashref->{'itemnotes_nonpublic'}) or $itemnotes_nonpublic ne $item_data_hashref->{'itemnotes_nonpublic'}) {
$item->itemnotes_nonpublic($itemnotes_nonpublic);
}
}
elsif ( $op eq "set_public_note" ) { # i.e., itemnotes parameter passed from form
elsif ( $op eq "cud-set_public_note" ) { # i.e., itemnotes parameter passed from form
checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
if ((not defined $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) {
$item->itemnotes($itemnotes);
}
} elsif ( $op eq "set_lost" && $itemlost ne $item_data_hashref->{'itemlost'}) {
} elsif ( $op eq "cud-set_lost" && $itemlost ne $item_data_hashref->{'itemlost'}) {
$item->itemlost($itemlost);
} elsif ( $op eq "set_withdrawn" && $withdrawn ne $item_data_hashref->{'withdrawn'}) {
} elsif ( $op eq "cud-set_withdrawn" && $withdrawn ne $item_data_hashref->{'withdrawn'}) {
$item->withdrawn($withdrawn);
} elsif ( $op eq "set_exclude_priority" && $exclude_from_local_holds_priority ne $item_data_hashref->{'exclude_from_local_holds_priority'}) {
} elsif ( $op eq "cud-set_exclude_priority" && $exclude_from_local_holds_priority ne $item_data_hashref->{'exclude_from_local_holds_priority'}) {
$item->exclude_from_local_holds_priority($exclude_from_local_holds_priority);
$messages = "updated_exclude_from_local_holds_priority=$exclude_from_local_holds_priority&";
} elsif ( $op eq "set_bookable" && $bookable ne $item_data_hashref->{'bookable'} ) {
} elsif ( $op eq "cud-set_bookable" && $bookable ne $item_data_hashref->{'bookable'} ) {
$item->bookable($bookable);
} elsif ( $op eq "set_damaged" && $damaged ne $item_data_hashref->{'damaged'}) {
} elsif ( $op eq "cud-set_damaged" && $damaged ne $item_data_hashref->{'damaged'}) {
$item->damaged($damaged);
} else {
#nothings changed, so do nothing.
@ -88,6 +88,6 @@ elsif ( $op eq "set_public_note" ) { # i.e., itemnotes parameter passed from for
$item->store;
LostItem($itemnumber, 'moredetail') if $op eq "set_lost";
LostItem($itemnumber, 'moredetail') if $op eq "cud-set_lost";
print $cgi->redirect("moredetail.pl?" . $messages . "biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");

View File

@ -517,7 +517,7 @@ my $userflags = 'edit_catalogue';
my $changed_framework = $input->param('changed_framework') // q{};
$frameworkcode = &GetFrameworkCode($biblionumber)
if ( $biblionumber and not( defined $frameworkcode) and $op ne 'addbiblio' );
if ( $biblionumber and not( defined $frameworkcode) and $op ne 'cud-addbiblio' );
if ($frameworkcode eq 'FA'){
$userflags = 'fast_cataloging';
@ -551,7 +551,7 @@ if ($frameworkcode eq 'FA'){
'stickyduedate' => $fa_stickyduedate,
'duedatespec' => $fa_duedatespec,
);
} elsif ( $op ne "delete" &&
} elsif ( $op ne "cud-delete" &&
C4::Context->preference('EnableAdvancedCatalogingEditor') &&
C4::Auth::haspermission(C4::Context->userenv->{id},{'editcatalogue'=>'advanced_editor'}) &&
$input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' &&
@ -657,7 +657,7 @@ if ($biblionumber) {
}
#-------------------------------------------------------------------------------------
if ( $op eq "addbiblio" ) {
if ( $op eq "cud-addbiblio" ) {
#-------------------------------------------------------------------------------------
$template->param(
biblionumberdata => $biblionumber,
@ -761,7 +761,7 @@ if ( $op eq "addbiblio" ) {
);
}
}
elsif ( $op eq "delete" ) {
elsif ( $op eq "cud-delete" ) {
my $error = &DelBiblio($biblionumber);
if ($error) {

View File

@ -58,7 +58,7 @@ my $srchany = $input->param('srchany');
# If replacing an existing record we want to initially populate the form with record info,
# however, we want to use entered inputs when searching
if ( $record && $op ne 'do_search' ) {
if ( $record && $op ne 'cud-do_search' ) {
$authorcorp ||=
$record->subfield( $authfields_mapping->{'authorcorp'}, 'a' );
$authorpersonal ||=
@ -98,13 +98,13 @@ $template->param(
index => $index,
);
if ( $op ne "do_search" ) {
if ( $op ne "cud-do_search" ) {
my $sth = $dbh->prepare("SELECT id,host,servername,checked FROM z3950servers WHERE recordtype = 'authority' ORDER BY `rank`, servername");
$sth->execute();
my $serverloop = $sth->fetchall_arrayref( {} );
$template->param(
serverloop => $serverloop,
opsearch => "search",
opsearch => "cud-search",
index => $index,
);
output_html_with_http_headers $input, $cookie, $template->output;

View File

@ -71,7 +71,7 @@ $template->param(
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(
{
@ -84,7 +84,7 @@ if ( $op ne "do_search" ) {
);
$template->param(
serverloop => [ $rs->all ],
opsearch => "search",
opsearch => "cud-search",
);
output_html_with_http_headers $input, $cookie, $template->output;
exit;

View File

@ -83,7 +83,7 @@ foreach my $num (@getoverdues) {
$overdueforbranch{'borrowersurname'} = $num->{'surname'};
$overdueforbranch{'borrowerfirstname'} = $num->{'firstname'};
$overdueforbranch{'borrowerphone'} = $num->{'phone'};
$overdueforbranch{'borroweremail'} = $num->{'email'};
$overdueforbranch{'borroweremail'} = $num->{'cud-email'};
$overdueforbranch{'homebranch'} = $num->{'homebranch'};
$overdueforbranch{'itemcallnumber'} = $num->{'itemcallnumber'};
$overdueforbranch{'borrowernumber'} = $num->{'borrowernumber'};

View File

@ -76,7 +76,7 @@ my $reqmessage;
my $cancelled;
my $settransit;
my $request = $query->param('request') || '';
my $request = $query->param('cud-request') || '';
my $borrowernumber = $query->param('borrowernumber') || 0;
my $tobranchcd = $query->param('tobranchcd') || '';
my $trigger = 'Manual';

View File

@ -65,7 +65,7 @@ if ( $op eq 'find-patron' ) {
existing_curbside_pickups => $existing_curbside_pickups,
);
}
elsif ( $op eq 'create-pickup' ) {
elsif ( $op eq 'cud-create-pickup' ) {
my $borrowernumber = $input->param('borrowernumber');
my $scheduled_pickup_datetime = $input->param('pickup_time');
my $notes = $input->param('notes');
@ -122,27 +122,27 @@ elsif ( $op eq 'create-pickup' ) {
}
}
}
elsif ( $op eq 'cancel' ) {
elsif ( $op eq 'cud-cancel' ) {
my $id = $input->param('id');
my $curbside_pickup = Koha::CurbsidePickups->find($id);
$curbside_pickup->delete() if $curbside_pickup;
}
elsif ( $op eq 'mark-as-staged' ) {
elsif ( $op eq 'cud-mark-as-staged' ) {
my $id = $input->param('id');
my $curbside_pickup = Koha::CurbsidePickups->find($id);
$curbside_pickup->mark_as_staged if $curbside_pickup;
}
elsif ( $op eq 'mark-as-unstaged' ) {
elsif ( $op eq 'cud-mark-as-unstaged' ) {
my $id = $input->param('id');
my $curbside_pickup = Koha::CurbsidePickups->find($id);
$curbside_pickup->mark_as_unstaged if $curbside_pickup;
}
elsif ( $op eq 'mark-patron-has-arrived' ) {
elsif ( $op eq 'cud-mark-patron-has-arrived' ) {
my $id = $input->param('id');
my $curbside_pickup = Koha::CurbsidePickups->find($id);
$curbside_pickup->mark_patron_has_arrived if $curbside_pickup;
}
elsif ( $op eq 'mark-as-delivered' ) {
elsif ( $op eq 'cud-mark-as-delivered' ) {
my $id = $input->param('id');
my $curbside_pickup = Koha::CurbsidePickups->find($id);
# FIXME Add a try-catch here

View File

@ -53,7 +53,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
my @messages;
if ( $op eq 'cancel_reserve' and $reserve_id ) {
if ( $op eq 'cud-cancel_reserve' and $reserve_id ) {
my $hold = Koha::Holds->find( $reserve_id );
if ( $hold ) {
my $cancellation_reason = $input->param('cancellation-reason');
@ -67,7 +67,7 @@ if ( $op eq 'cancel_reserve' and $reserve_id ) {
if ( $item and C4::Context->preference('CanMarkHoldsToPullAsLost') =~ m|^allow| ) {
my $patron = $hold->borrower;
C4::Circulation::LostItem( $item->itemnumber, "pendingreserves" );
if ( $op eq 'mark_as_lost_and_notify' and C4::Context->preference('CanMarkHoldsToPullAsLost') eq 'allow_and_notify' ) {
if ( $op eq 'cud-mark_as_lost_and_notify' and C4::Context->preference('CanMarkHoldsToPullAsLost') eq 'allow_and_notify' ) {
my $library = $hold->branch;
my $letter = C4::Letters::GetPreparedLetter(
module => 'reserves',
@ -89,7 +89,7 @@ if ( $op eq 'cancel_reserve' and $reserve_id ) {
C4::Letters::EnqueueLetter(
{ letter => $letter,
borrowernumber => $patron->borrowernumber,
message_transport_type => 'email',
message_transport_type => 'cud-email',
from_address => $from_address,
}
);

View File

@ -146,7 +146,7 @@ if ( $query->param('reserve_id') ) {
my $borrowernumber = $query->param('borrowernumber');
my $reserve_id = $query->param('reserve_id');
my $diffBranchReturned = $query->param('diffBranch');
my $cancel_reserve = $query->param('cancel_reserve');
my $cancel_reserve = $query->param('cud-cancel_reserve');
my $cancel_reason = $query->param('cancel_reason');
# fix up item type for display

View File

@ -56,7 +56,7 @@ else {
$template->param(
slip => $slip,
plain => !$is_html,
caller => 'transfer',
caller => 'cud-transfer',
stylesheet => C4::Context->preference("SlipCSS"),
);

View File

@ -123,7 +123,7 @@ if ( $action eq 'lookup' and $item ) {
return => $return,
);
} elsif ( $action eq 'add' ) {
} elsif ( $action eq 'cud-add' ) {
my $itype = scalar $cgi->param('itype');
my $ccode = scalar $cgi->param('ccode');
my $homebranch = $cgi->param('homebranch');

View File

@ -66,7 +66,7 @@ if ( $course_id && $course ) {
if ( !$action ) {
$template->param( action => 'display_form' );
}
elsif ( $action eq 'add' ) {
elsif ( $action eq 'cud-add' ) {
my @barcodes = uniq( split( /\s\n/, $barcodes ) );
my @biblionumbers = uniq( split( /\s\n/, $biblionumbers ) );

View File

@ -34,7 +34,7 @@ checkauth($cgi, 0, { coursereserves => 'manage_courses' }, 'intranet');
my $action = $cgi->param('action') || '';
my $course_id = $cgi->param('course_id');
if ( $action eq 'del' ) {
if ( $action eq 'cud-del' ) {
DelCourse( $course_id );
print $cgi->redirect("/cgi-bin/koha/course_reserves/course-reserves.pl");
} else {

View File

@ -201,8 +201,8 @@ if ( $backends_available ) {
# handle special commit rules & update type
handle_commit_maybe($backend_result, $request);
} elsif ( $op eq 'cancel' ) {
# Backend 'cancel' method
} elsif ( $op eq 'cud-cancel' ) {
# Backend 'cud-cancel' method
# cancel requires a specific request, so first, find it.
my $request = Koha::Illrequests->find($params->{illrequest_id});
my $backend_result = $request->backend_cancel($params);
@ -270,14 +270,14 @@ if ( $backends_available ) {
# Currently still needs to be implemented.
redirect_to_list();
} elsif ( $op eq 'delete_confirm') {
} elsif ( $op eq 'cud-delete_confirm') {
my $request = Koha::Illrequests->find($params->{illrequest_id});
$template->param(
request => $request
);
} elsif ( $op eq 'delete' ) {
} elsif ( $op eq 'cud-delete' ) {
# Check if the request is confirmed, if not, redirect
# to the confirmation view
@ -530,7 +530,7 @@ sub get_metadata_enrichment {
my @services = ();
foreach my $plugin(@candidates) {
my $supported = $plugin->provides_api();
if ($supported->{type} eq 'search') {
if ($supported->{type} eq 'cud-search') {
push @services, $supported;
}
}

View File

@ -237,7 +237,7 @@ elsif ( $step && $step == 3 ) {
print $query->redirect("/cgi-bin/koha/mainpage.pl");
exit;
}
elsif ( $op && $op eq 'finish' ) {
elsif ( $op && $op eq 'cud-finish' ) {
$installer->set_version_syspref();
my $langchoice = $query->param('fwklanguage');
@ -252,7 +252,7 @@ elsif ( $step && $step == 3 ) {
$template->param( "$op" => 1 );
}
elsif ( $op && $op eq 'addframeworks' ) {
elsif ( $op && $op eq 'cud-addframeworks' ) {
# 1ST install, 3rd sub-step : insert the SQL files the user has selected
my $langchoice = $query->param('fwklanguage');
@ -270,7 +270,7 @@ elsif ( $step && $step == 3 ) {
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings;
$template->param( "$op" => 1 );
}
elsif ( $op && $op eq 'selectframeworks' ) {
elsif ( $op && $op eq 'cud-selectframeworks' ) {
#
#
# 1ST install, 2nd sub-step : show the user the sql datas they can insert in the database.
@ -313,7 +313,7 @@ elsif ( $step && $step == 3 ) {
$template->param( "$op" => 1 );
}
elsif ( $op && $op eq 'choosemarc' ) {
elsif ( $op && $op eq 'cud-choosemarc' ) {
#
#
# 1ST install, 2nd sub-step : show the user the marcflavour available.
@ -367,7 +367,7 @@ elsif ( $step && $step == 3 ) {
$template->param( "flavourloop" => \@flavourlist );
$template->param( "$op" => 1 );
}
elsif ( $op && $op eq 'importdatastructure' ) {
elsif ( $op && $op eq 'cud-importdatastructure' ) {
#
#
# 1st install, 1st "sub-step" : import kohastructure

View File

@ -57,7 +57,7 @@ my @messages;
if ( $step == 1 ) {
if ( $op eq 'add_validate_library' ) {
if ( $op eq 'cud-add_validate_library' ) {
my $branchcode = $input->param('branchcode');
$branchcode = uc($branchcode);
@ -84,7 +84,7 @@ if ( $step == 1 ) {
$step++ if Koha::Libraries->count;
}
if ( $step == 2 ) {
if ( $op eq "add_validate_category" ) {
if ( $op eq "cud-add_validate_category" ) {
my $searchfield = $input->param('description') // q||;
my $categorycode = $input->param('categorycode');
@ -125,7 +125,7 @@ if ( $step == 2 ) {
$step++ if Koha::Patron::Categories->count;
}
if ( $step == 3 ) {
if ( $op eq 'add_validate_patron' ) {
if ( $op eq 'cud-add_validate_patron' ) {
#Create a patron
my $firstpassword = $input->param('password') || '';
@ -199,7 +199,7 @@ if ( $step == 3 ) {
$step++ if Koha::Patrons->search( { flags => 1 } )->count;
}
if ( $step == 4 ) {
if ( $op eq 'add_validate_itemtype' ) {
if ( $op eq 'cud-add_validate_itemtype' ) {
my $description = $input->param('description');
my $itemtype_code = $input->param('itemtype');
$itemtype_code = uc($itemtype_code);
@ -224,7 +224,7 @@ if ( $step == 4 ) {
}
if ( $step == 5 ) {
if ( $op eq 'add_validate_circ_rule' ) {
if ( $op eq 'cud-add_validate_circ_rule' ) {
#If no libraries exist then set the $branch value to *
my $branch = $input->param('branch') || '*';

View File

@ -158,7 +158,7 @@
<form name="f" action="batchMod.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-[% op | html %]" />
<input type="hidden" name="op" value="[% op | html %]" />
<input type="hidden" name="searchid" value="[% searchid | html %]" />
<input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
<input type="hidden" name="src" id="src" value="[% src | html %]" />

View File

@ -54,7 +54,7 @@ my $display_columns = [ {_label_number => {label => 'Label number', link_field
{_delete => {label => 'Actions', link_field => 0}},
{select => {label => 'Select', value => '_label_id'}},
];
my $op = $cgi->param('op') || 'edit';
my $op = $cgi->param('op') || 'cud-edit';
my @label_ids;
my @item_numbers;
my $number_list;
@ -77,11 +77,11 @@ if ($op eq 'remove') {
# print $cgi->redirect("label-edit-batch.pl?op=edit&batch_id=$batch_id");
# exit;
}
elsif ($op eq 'delete') {
elsif ($op eq 'cud-delete') {
$err = C4::Labels::Batch::delete(batch_id => $batch_id, branch_code => $branch_code);
$errtype = 'BATCH_NOT_DELETED' if $err;
}
elsif ($op eq 'add') {
elsif ($op eq 'cud-add') {
if ($number_list) {
my @numbers_list = split /\n/, $number_list; # Entries are effectively passed in as a <cr> separated list
foreach my $number (@numbers_list) {

Some files were not shown because too many files have changed in this diff Show More