From 18e808240febf817544f21eb84020a270761c9a5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Dec 2023 16:43:08 +0100 Subject: [PATCH] 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 --- acqui/addorderiso2709.pl | 2 +- acqui/basket.pl | 10 ++-- acqui/basketgroup.pl | 10 ++-- acqui/basketheader.pl | 2 +- acqui/duplicate_orders.pl | 8 +-- acqui/edifactmsgs.pl | 2 +- acqui/histsearch.pl | 2 +- acqui/invoice-files.pl | 4 +- acqui/invoice.pl | 6 +- acqui/invoices.pl | 4 +- acqui/lateorders.pl | 2 +- acqui/moddeliverydate.pl | 2 +- acqui/modordernotes.pl | 2 +- acqui/orderreceive.pl | 2 +- acqui/parcels.pl | 2 +- acqui/supplier.pl | 2 +- acqui/transferorder.pl | 2 +- acqui/uncertainprice.pl | 2 +- acqui/vendor_issues.pl | 8 +-- acqui/z3950_search.pl | 4 +- admin/additional-fields.pl | 12 ++-- admin/adveditorshortcuts.pl | 2 +- admin/aqbudgetperiods.pl | 10 ++-- admin/aqbudgets.pl | 6 +- admin/aqcontract.pl | 6 +- admin/aqplan.pl | 2 +- admin/audio_alerts.pl | 2 +- admin/auth_subfields_structure.pl | 6 +- admin/auth_tag_structure.pl | 14 ++--- admin/authorised_values.pl | 8 +-- admin/authtypes.pl | 6 +- admin/background_jobs.pl | 2 +- admin/biblio_framework.pl | 6 +- admin/branches.pl | 2 +- admin/cash_registers.pl | 2 +- admin/categories.pl | 8 +-- admin/check_parent_total.pl | 2 +- admin/cities.pl | 6 +- admin/classsources.pl | 6 +- admin/columns_settings.pl | 2 +- admin/credit_types.pl | 2 +- admin/curbside_pickup.pl | 2 +- admin/currency.pl | 6 +- admin/debit_types.pl | 2 +- admin/desks.pl | 6 +- admin/edi_accounts.pl | 6 +- admin/edi_ean_accounts.pl | 6 +- admin/identity_providers.pl | 12 ++-- admin/ill_batch_statuses.pl | 4 +- admin/import_export_authtype.pl | 4 +- admin/import_export_framework.pl | 4 +- admin/item_circulation_alerts.pl | 2 +- admin/items_search_field.pl | 4 +- admin/items_search_fields.pl | 2 +- admin/itemtypes.pl | 6 +- admin/library_groups.pl | 6 +- admin/marc-overlay-rules.pl | 12 ++-- admin/marc_subfields_structure.pl | 6 +- admin/marctagstructure.pl | 10 ++-- admin/oai_set_mappings.pl | 2 +- admin/oai_sets.pl | 8 +-- admin/overdrive.pl | 2 +- admin/patron-attr-types.pl | 8 +-- admin/preferences.pl | 12 ++-- admin/restrictions.pl | 6 +- admin/search_filters.pl | 2 +- admin/share_content.pl | 8 +-- admin/smart-rules.pl | 22 ++++---- admin/sms_providers.pl | 4 +- admin/smtp_servers.pl | 6 +- admin/systempreferences.pl | 10 ++-- admin/transport-cost-matrix.pl | 2 +- admin/usage_statistics.pl | 2 +- admin/z3950servers.pl | 10 ++-- authorities/auth_finder.pl | 4 +- authorities/authorities-home.pl | 6 +- authorities/authorities.pl | 8 +-- authorities/export.pl | 2 +- basket/sendbasket.pl | 4 +- catalogue/export.pl | 2 +- catalogue/search-history.pl | 2 +- catalogue/stockrotation.pl | 2 +- catalogue/updateitem.pl | 16 +++--- cataloguing/addbiblio.pl | 8 +-- cataloguing/z3950_auth_search.pl | 6 +- cataloguing/z3950_search.pl | 4 +- circ/branchoverdues.pl | 2 +- circ/branchtransfers.pl | 2 +- circ/curbside_pickups.pl | 12 ++-- circ/pendingreserves.pl | 6 +- circ/returns.pl | 2 +- circ/transfer-slip.pl | 2 +- course_reserves/add_items.pl | 2 +- course_reserves/batch_add_items.pl | 2 +- course_reserves/mod_course.pl | 2 +- ill/ill-requests.pl | 10 ++-- installer/install.pl | 10 ++-- installer/onboarding.pl | 10 ++-- .../prog/en/modules/tools/batchMod-edit.tt | 2 +- labels/label-edit-batch.pl | 6 +- labels/label-edit-layout.pl | 4 +- labels/label-edit-profile.pl | 4 +- labels/label-edit-template.pl | 4 +- labels/label-item-search.pl | 2 +- labels/label-manage.pl | 2 +- labels/label-print.pl | 2 +- members/apikeys.pl | 8 +-- members/boraccount.pl | 6 +- members/deletemem.pl | 8 +-- members/files.pl | 4 +- members/mancredit.pl | 2 +- members/maninvoice.pl | 2 +- members/memberentry.pl | 56 +++++++++---------- members/merge-patrons.pl | 4 +- members/mod_debarment.pl | 4 +- members/notices.pl | 4 +- members/search.pl | 4 +- members/two_factor_auth.pl | 4 +- members/update-child.pl | 2 +- misc/add_statistics_borrowers_categorycode.pl | 2 +- misc/recreateIssueStatistics.pl | 4 +- misc/sip_cli_emulator.pl | 6 +- offline_circ/process.pl | 2 +- opac/opac-alert-subscribe.pl | 4 +- opac/opac-authorities-home.pl | 2 +- opac/opac-browser.pl | 2 +- opac/opac-curbside-pickups.pl | 6 +- opac/opac-discharge.pl | 2 +- opac/opac-illrequests.pl | 4 +- opac/opac-issue-note.pl | 2 +- opac/opac-memberentry.pl | 36 ++++++------ opac/opac-messaging.pl | 2 +- opac/opac-passwd.pl | 2 +- opac/opac-password-recovery.pl | 2 +- opac/opac-privacy.pl | 4 +- opac/opac-recall.pl | 4 +- opac/opac-registration-verify.pl | 2 +- opac/opac-renew.pl | 2 +- opac/opac-reportproblem.pl | 4 +- opac/opac-reset-password.pl | 2 +- opac/opac-search-history.pl | 4 +- opac/opac-sendbasket.pl | 4 +- opac/opac-sendshelf.pl | 6 +- opac/opac-shareshelf.pl | 4 +- opac/opac-shelves.pl | 20 +++---- opac/opac-suggestions.pl | 8 +-- opac/opac-tags.pl | 2 +- opac/opac-topissues.pl | 2 +- patroncards/edit-batch.pl | 6 +- patroncards/edit-layout.pl | 4 +- patroncards/edit-profile.pl | 4 +- patroncards/edit-template.pl | 4 +- patroncards/image-manage.pl | 4 +- patroncards/manage.pl | 2 +- patroncards/print.pl | 2 +- plugins/plugins-upload.pl | 4 +- pos/pay.pl | 6 +- pos/register.pl | 2 +- recalls/recalls_overdue.pl | 2 +- recalls/recalls_queue.pl | 2 +- recalls/recalls_to_pull.pl | 2 +- recalls/recalls_waiting.pl | 2 +- recalls/request.pl | 2 +- reports/acquisitions_stats.pl | 2 +- reports/bor_issues_top.pl | 2 +- reports/borrowers_out.pl | 2 +- reports/borrowers_stats.pl | 2 +- reports/cash_register_stats.pl | 2 +- reports/cat_issues_top.pl | 2 +- reports/catalogue_out.pl | 2 +- reports/catalogue_stats.pl | 2 +- reports/guided_reports.pl | 6 +- reports/issues_avg_stats.pl | 2 +- reports/issues_stats.pl | 2 +- reports/itemslost.pl | 2 +- reports/manager.pl | 2 +- reports/reserves_stats.pl | 2 +- reports/serials_stats.pl | 2 +- reserve/request.pl | 2 +- reviews/reviewswaiting.pl | 2 +- rotating_collections/editCollections.pl | 6 +- serials/routing-preview.pl | 4 +- serials/routing.pl | 6 +- serials/serials-collection.pl | 6 +- serials/serials-edit.pl | 2 +- serials/subscription-add.pl | 20 +++---- serials/subscription-bib-search.pl | 6 +- serials/subscription-detail.pl | 4 +- serials/subscription-frequencies.pl | 10 ++-- serials/subscription-history.pl | 2 +- serials/subscription-numberpatterns.pl | 12 ++-- serials/subscription-renew.pl | 2 +- suggestion/suggestion.pl | 10 ++-- tags/list.pl | 2 +- tools/additional-contents.pl | 4 +- tools/automatic_item_modification_by_age.pl | 6 +- tools/batchMod.pl | 6 +- tools/batch_delete_records.pl | 2 +- tools/batch_extend_due_dates.pl | 4 +- tools/batch_record_modification.pl | 2 +- tools/csv-profiles.pl | 6 +- tools/exceptionHolidays.pl | 4 +- tools/export.pl | 4 +- tools/letter.pl | 8 +-- tools/manage-marc-import.pl | 10 ++-- tools/marc_modification_templates.pl | 4 +- tools/modborrowers.pl | 16 +++--- tools/overduerules.pl | 2 +- tools/picture-upload.pl | 4 +- tools/quotes.pl | 2 +- tools/scheduler.pl | 4 +- tools/stockrotation.pl | 8 +-- tools/upload.pl | 6 +- tools/viewlog.pl | 2 +- virtualshelves/sendshelf.pl | 6 +- virtualshelves/shelves.pl | 16 +++--- 216 files changed, 552 insertions(+), 552 deletions(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index e79a0ae447..f77543bfff 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -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 diff --git a/acqui/basket.pl b/acqui/basket.pl index 33253aad47..21055a4b89 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -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({ diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 38f7b6b44c..58fdb57630 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -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&basketgroupid='.$basketgroupid.'&booksellerid='.$booksellerid : '/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=' .$booksellerid.'&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 # diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl index 4cf1736715..70a424941f 100755 --- a/acqui/basketheader.pl +++ b/acqui/basketheader.pl @@ -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( diff --git a/acqui/duplicate_orders.pl b/acqui/duplicate_orders.pl index d37b3f3240..7f36f544a9 100755 --- a/acqui/duplicate_orders.pl +++ b/acqui/duplicate_orders.pl @@ -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; diff --git a/acqui/edifactmsgs.pl b/acqui/edifactmsgs.pl index 72b429f585..47a1316eb5 100755 --- a/acqui/edifactmsgs.pl +++ b/acqui/edifactmsgs.pl @@ -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); diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index 571cbeb132..4b51e27aa8 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -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( diff --git a/acqui/invoice-files.pl b/acqui/invoice-files.pl index d4e43cfc83..a026a00a5d 100755 --- a/acqui/invoice-files.pl +++ b/acqui/invoice-files.pl @@ -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') ); } diff --git a/acqui/invoice.pl b/acqui/invoice.pl index b9d1bf5d0b..6e7724c749 100755 --- a/acqui/invoice.pl +++ b/acqui/invoice.pl @@ -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' } ); diff --git a/acqui/invoices.pl b/acqui/invoices.pl index 5cf2e338aa..dce1a4d668 100755 --- a/acqui/invoices.pl +++ b/acqui/invoices.pl @@ -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, diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index 6e8dbb9269..479fe47fa5 100755 --- a/acqui/lateorders.pl +++ b/acqui/lateorders.pl @@ -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 { diff --git a/acqui/moddeliverydate.pl b/acqui/moddeliverydate.pl index 975fccdb95..f90cfb552e 100755 --- a/acqui/moddeliverydate.pl +++ b/acqui/moddeliverydate.pl @@ -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); diff --git a/acqui/modordernotes.pl b/acqui/modordernotes.pl index 258fb63c6a..eabfa123f1 100755 --- a/acqui/modordernotes.pl +++ b/acqui/modordernotes.pl @@ -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; diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index d8192292f2..550e41e810 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -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; diff --git a/acqui/parcels.pl b/acqui/parcels.pl index 985947ef56..d8ab1f499e 100755 --- a/acqui/parcels.pl +++ b/acqui/parcels.pl @@ -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'); diff --git a/acqui/supplier.pl b/acqui/supplier.pl index bd988551de..2de890d08f 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -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) { diff --git a/acqui/transferorder.pl b/acqui/transferorder.pl index 1fa15be7b8..36a71ee47e 100755 --- a/acqui/transferorder.pl +++ b/acqui/transferorder.pl @@ -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' } } ); diff --git a/acqui/uncertainprice.pl b/acqui/uncertainprice.pl index 770f8fc22f..f03dea0562 100755 --- a/acqui/uncertainprice.pl +++ b/acqui/uncertainprice.pl @@ -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++) { diff --git a/acqui/vendor_issues.pl b/acqui/vendor_issues.pl index bee05028a7..143ef0d9e6 100755 --- a/acqui/vendor_issues.pl +++ b/acqui/vendor_issues.pl @@ -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' }; diff --git a/acqui/z3950_search.pl b/acqui/z3950_search.pl index d596cbf227..6913adecee 100755 --- a/acqui/z3950_search.pl +++ b/acqui/z3950_search.pl @@ -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; diff --git a/admin/additional-fields.pl b/admin/additional-fields.pl index 35dd1a97b1..dcc26ae02f 100755 --- a/admin/additional-fields.pl +++ b/admin/additional-fields.pl @@ -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'; diff --git a/admin/adveditorshortcuts.pl b/admin/adveditorshortcuts.pl index 0fbe51c160..8ca9969a90 100755 --- a/admin/adveditorshortcuts.pl +++ b/admin/adveditorshortcuts.pl @@ -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; diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl index 861f303da3..35a5522ac2 100755 --- a/admin/aqbudgetperiods.pl +++ b/admin/aqbudgetperiods.pl @@ -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( diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl index 4ed48d47d1..e32b3533a3 100755 --- a/admin/aqbudgets.pl +++ b/admin/aqbudgets.pl @@ -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); diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl index def0339d28..46954ea026 100755 --- a/admin/aqcontract.pl +++ b/admin/aqcontract.pl @@ -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 ) { diff --git a/admin/aqplan.pl b/admin/aqplan.pl index cbded1ca64..899791b269 100755 --- a/admin/aqplan.pl +++ b/admin/aqplan.pl @@ -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) { diff --git a/admin/audio_alerts.pl b/admin/audio_alerts.pl index e28151b8d7..9dad284db4 100755 --- a/admin/audio_alerts.pl +++ b/admin/audio_alerts.pl @@ -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( { diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl index e052d023ba..9433b0aa0d 100755 --- a/admin/auth_subfields_structure.pl +++ b/admin/auth_subfields_structure.pl @@ -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, diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl index 1c952d58a5..d4b0662588 100755 --- a/admin/auth_tag_structure.pl +++ b/admin/auth_tag_structure.pl @@ -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); diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index 2130e86819..c40158f15d 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -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}; diff --git a/admin/authtypes.pl b/admin/authtypes.pl index 3fea873e0d..5445c5b7f0 100755 --- a/admin/authtypes.pl +++ b/admin/authtypes.pl @@ -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); diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl index 6eb05b0f82..6eb4b066c6 100755 --- a/admin/background_jobs.pl +++ b/admin/background_jobs.pl @@ -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 diff --git a/admin/biblio_framework.pl b/admin/biblio_framework.pl index d8988e0ecd..40f5ac83dc 100755 --- a/admin/biblio_framework.pl +++ b/admin/biblio_framework.pl @@ -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; }; diff --git a/admin/branches.pl b/admin/branches.pl index 7a6429b08f..59d5a107db 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -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 => { diff --git a/admin/cash_registers.pl b/admin/cash_registers.pl index db55b2aadc..78abf749ad 100755 --- a/admin/cash_registers.pl +++ b/admin/cash_registers.pl @@ -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'); diff --git a/admin/categories.pl b/admin/categories.pl index 8b436f7463..b928b0649c 100755 --- a/admin/categories.pl +++ b/admin/categories.pl @@ -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 ); diff --git a/admin/check_parent_total.pl b/admin/check_parent_total.pl index 649f0d6000..95a38328c2 100755 --- a/admin/check_parent_total.pl +++ b/admin/check_parent_total.pl @@ -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 diff --git a/admin/cities.pl b/admin/cities.pl index f8a4df6a13..05b9d9670a 100755 --- a/admin/cities.pl +++ b/admin/cities.pl @@ -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; }; diff --git a/admin/classsources.pl b/admin/classsources.pl index 59828be04e..65a55d5b88 100755 --- a/admin/classsources.pl +++ b/admin/classsources.pl @@ -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 diff --git a/admin/columns_settings.pl b/admin/columns_settings.pl index 7fd2c1b18c..b0498d6ad2 100755 --- a/admin/columns_settings.pl +++ b/admin/columns_settings.pl @@ -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; diff --git a/admin/credit_types.pl b/admin/credit_types.pl index c4a4920257..8f3be0604c 100755 --- a/admin/credit_types.pl +++ b/admin/credit_types.pl @@ -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; diff --git a/admin/curbside_pickup.pl b/admin/curbside_pickup.pl index c4ccf467d9..b5abb0e1ec 100755 --- a/admin/curbside_pickup.pl +++ b/admin/curbside_pickup.pl @@ -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; diff --git a/admin/currency.pl b/admin/currency.pl index 28dc2d2673..b706ae0291 100755 --- a/admin/currency.pl +++ b/admin/currency.pl @@ -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; }; diff --git a/admin/debit_types.pl b/admin/debit_types.pl index ba14a23010..79a500593f 100755 --- a/admin/debit_types.pl +++ b/admin/debit_types.pl @@ -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; diff --git a/admin/desks.pl b/admin/desks.pl index 8f6bc7911d..02ec4e5115 100755 --- a/admin/desks.pl +++ b/admin/desks.pl @@ -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; }; diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl index 65e3b4e1a2..3048086fb1 100755 --- a/admin/edi_accounts.pl +++ b/admin/edi_accounts.pl @@ -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; diff --git a/admin/edi_ean_accounts.pl b/admin/edi_ean_accounts.pl index 87ebe458c7..dd305bda13 100755 --- a/admin/edi_ean_accounts.pl +++ b/admin/edi_ean_accounts.pl @@ -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; } diff --git a/admin/identity_providers.pl b/admin/identity_providers.pl index d663d82890..27622ae8dc 100755 --- a/admin/identity_providers.pl +++ b/admin/identity_providers.pl @@ -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; diff --git a/admin/ill_batch_statuses.pl b/admin/ill_batch_statuses.pl index b6b9721fc2..b46b5d0a13 100755 --- a/admin/ill_batch_statuses.pl +++ b/admin/ill_batch_statuses.pl @@ -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' }; diff --git a/admin/import_export_authtype.pl b/admin/import_export_authtype.pl index e12bcc7887..a30b2ce411 100755 --- a/admin/import_export_authtype.pl +++ b/admin/import_export_authtype.pl @@ -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') { diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl index 9973eb9c08..47b5a037d0 100755 --- a/admin/import_export_framework.pl +++ b/admin/import_export_framework.pl @@ -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') { diff --git a/admin/item_circulation_alerts.pl b/admin/item_circulation_alerts.pl index 8e79982928..7a9b32243f 100755 --- a/admin/item_circulation_alerts.pl +++ b/admin/item_circulation_alerts.pl @@ -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); diff --git a/admin/items_search_field.pl b/admin/items_search_field.pl index 35ee482091..caaefe6a28 100755 --- a/admin/items_search_field.pl +++ b/admin/items_search_field.pl @@ -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); diff --git a/admin/items_search_fields.pl b/admin/items_search_fields.pl index c9e7d9380c..1cfc051d9b 100755 --- a/admin/items_search_fields.pl +++ b/admin/items_search_fields.pl @@ -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) { diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index 44e9ad5445..698a0c00dc 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -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 }; diff --git a/admin/library_groups.pl b/admin/library_groups.pl index 239f3ead76..be46eacb99 100755 --- a/admin/library_groups.pl +++ b/admin/library_groups.pl @@ -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); diff --git a/admin/marc-overlay-rules.pl b/admin/marc-overlay-rules.pl index 6c737b49a7..73ac254d30 100755 --- a/admin/marc-overlay-rules.pl +++ b/admin/marc-overlay-rules.pl @@ -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 { diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 10f16e182f..5317da5bb4 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -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, diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index fbb955db41..1d48076f0f 100755 --- a/admin/marctagstructure.pl +++ b/admin/marctagstructure.pl @@ -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); } diff --git a/admin/oai_set_mappings.pl b/admin/oai_set_mappings.pl index a47dadee4a..cdd9bb3f61 100755 --- a/admin/oai_set_mappings.pl +++ b/admin/oai_set_mappings.pl @@ -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'); diff --git a/admin/oai_sets.pl b/admin/oai_sets.pl index 015d713604..fe611953a0 100755 --- a/admin/oai_sets.pl +++ b/admin/oai_sets.pl @@ -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); } diff --git a/admin/overdrive.pl b/admin/overdrive.pl index a961b89337..27e2c175cb 100755 --- a/admin/overdrive.pl +++ b/admin/overdrive.pl @@ -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){ diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl index ca5d2fca47..233ea2e189 100755 --- a/admin/patron-attr-types.pl +++ b/admin/patron-attr-types.pl @@ -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 { diff --git a/admin/preferences.pl b/admin/preferences.pl index 108aaf41d1..e60a7a86de 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -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; diff --git a/admin/restrictions.pl b/admin/restrictions.pl index 8b3a164036..5ae01ad6f2 100755 --- a/admin/restrictions.pl +++ b/admin/restrictions.pl @@ -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' }; diff --git a/admin/search_filters.pl b/admin/search_filters.pl index cdfee223eb..d49ca621fc 100755 --- a/admin/search_filters.pl +++ b/admin/search_filters.pl @@ -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; diff --git a/admin/share_content.pl b/admin/share_content.pl index 89dd4e0cdb..2035db9dff 100755 --- a/admin/share_content.pl +++ b/admin/share_content.pl @@ -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}); diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index fd20484c9f..e1aea66aa8 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -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'] }); diff --git a/admin/sms_providers.pl b/admin/sms_providers.pl index 1677576d94..859712af46 100755 --- a/admin/sms_providers.pl +++ b/admin/sms_providers.pl @@ -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; } diff --git a/admin/smtp_servers.pl b/admin/smtp_servers.pl index 54af62db73..636b4ccaad 100755 --- a/admin/smtp_servers.pl +++ b/admin/smtp_servers.pl @@ -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; diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index d2d1369223..609a06eda4 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -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 diff --git a/admin/transport-cost-matrix.pl b/admin/transport-cost-matrix.pl index 4af34aa9c5..1930e45a26 100755 --- a/admin/transport-cost-matrix.pl +++ b/admin/transport-cost-matrix.pl @@ -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) { diff --git a/admin/usage_statistics.pl b/admin/usage_statistics.pl index 582e92aa1e..5288d6327d 100755 --- a/admin/usage_statistics.pl +++ b/admin/usage_statistics.pl @@ -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'); diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl index d7dd4161c5..e5f564f8b3 100755 --- a/admin/z3950servers.pl +++ b/admin/z3950servers.pl @@ -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, diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl index c4e3a74664..851195153d 100755 --- a/authorities/auth_finder.pl +++ b/authorities/auth_finder.pl @@ -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'); diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl index 2d73a6a280..50e9a50213 100755 --- a/authorities/authorities-home.pl +++ b/authorities/authorities-home.pl @@ -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') || ''; diff --git a/authorities/authorities.pl b/authorities/authorities.pl index bd20fd6374..91ea5d9d2a 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -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){ diff --git a/authorities/export.pl b/authorities/export.pl index 0703da840b..70a5157140 100755 --- a/authorities/export.pl +++ b/authorities/export.pl @@ -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) { diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 352e90c7ae..d172cb3418 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -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], diff --git a/catalogue/export.pl b/catalogue/export.pl index ff02cea67f..d432e17836 100755 --- a/catalogue/export.pl +++ b/catalogue/export.pl @@ -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; diff --git a/catalogue/search-history.pl b/catalogue/search-history.pl index 42bef7cfd4..883cfcf6a1 100755 --- a/catalogue/search-history.pl +++ b/catalogue/search-history.pl @@ -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{}; diff --git a/catalogue/stockrotation.pl b/catalogue/stockrotation.pl index 27813c02e8..344e0317d7 100755 --- a/catalogue/stockrotation.pl +++ b/catalogue/stockrotation.pl @@ -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}); diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl index 6987cacbd0..5b092763df 100755 --- a/catalogue/updateitem.pl +++ b/catalogue/updateitem.pl @@ -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"); diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index e84c542092..69c6d6e303 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -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) { diff --git a/cataloguing/z3950_auth_search.pl b/cataloguing/z3950_auth_search.pl index ce6a3bd324..2534e23e1f 100755 --- a/cataloguing/z3950_auth_search.pl +++ b/cataloguing/z3950_auth_search.pl @@ -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; diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl index 8acc92c25d..1152a2f13c 100755 --- a/cataloguing/z3950_search.pl +++ b/cataloguing/z3950_search.pl @@ -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; diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl index bce79d8cf8..c96e6e75a2 100755 --- a/circ/branchoverdues.pl +++ b/circ/branchoverdues.pl @@ -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'}; diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index cb10b5b0f1..c8f7eb691c 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -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'; diff --git a/circ/curbside_pickups.pl b/circ/curbside_pickups.pl index 2003197df3..9b4985cd3f 100755 --- a/circ/curbside_pickups.pl +++ b/circ/curbside_pickups.pl @@ -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 diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 21016bc354..4a6ab964d9 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -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, } ); diff --git a/circ/returns.pl b/circ/returns.pl index c0df061139..63422018ab 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -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 diff --git a/circ/transfer-slip.pl b/circ/transfer-slip.pl index 1bd013d854..6c61e2cde2 100755 --- a/circ/transfer-slip.pl +++ b/circ/transfer-slip.pl @@ -56,7 +56,7 @@ else { $template->param( slip => $slip, plain => !$is_html, - caller => 'transfer', + caller => 'cud-transfer', stylesheet => C4::Context->preference("SlipCSS"), ); diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index d430cf58da..85eaa9fa5f 100755 --- a/course_reserves/add_items.pl +++ b/course_reserves/add_items.pl @@ -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'); diff --git a/course_reserves/batch_add_items.pl b/course_reserves/batch_add_items.pl index c71ce46f47..15394be470 100755 --- a/course_reserves/batch_add_items.pl +++ b/course_reserves/batch_add_items.pl @@ -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 ) ); diff --git a/course_reserves/mod_course.pl b/course_reserves/mod_course.pl index e04072384b..48d7d1c3bc 100755 --- a/course_reserves/mod_course.pl +++ b/course_reserves/mod_course.pl @@ -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 { diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index a8c59f7fb0..8f1b6551e4 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -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; } } diff --git a/installer/install.pl b/installer/install.pl index 8f53d212a2..508290a16b 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -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 diff --git a/installer/onboarding.pl b/installer/onboarding.pl index 306e891d35..d5b8bee041 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -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') || '*'; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt index ad6a892384..1b442b5fcf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt @@ -158,7 +158,7 @@
[% INCLUDE 'csrf-token.inc' %] - + diff --git a/labels/label-edit-batch.pl b/labels/label-edit-batch.pl index 230291e3a4..23bd9e77d4 100755 --- a/labels/label-edit-batch.pl +++ b/labels/label-edit-batch.pl @@ -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 separated list foreach my $number (@numbers_list) { diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl index 56c7d4a8ee..1904a49e33 100755 --- a/labels/label-edit-layout.pl +++ b/labels/label-edit-layout.pl @@ -86,12 +86,12 @@ sub _select_format_string { # generate field table based on format_string return (\@fields, $field_count); } -if ($op eq 'edit') { +if ($op eq 'cud-edit') { warn sprintf("Error performing '%s': No 'layout_id' passed in.", $op) unless ($layout_id); $layout = C4::Labels::Layout->retrieve(layout_id => $layout_id); } -elsif ($op eq 'save') { +elsif ($op eq 'cud-save') { my $format_string = ''; if ($layout_choice eq 'layout_table') { # translate the field table into a format_string my %layout_table; diff --git a/labels/label-edit-profile.pl b/labels/label-edit-profile.pl index 257bf4382d..fa315fc637 100755 --- a/labels/label-edit-profile.pl +++ b/labels/label-edit-profile.pl @@ -45,11 +45,11 @@ my @label_template = (); my $units = get_unit_values(); -if ($op eq 'edit') { +if ($op eq 'cud-edit') { $profile = C4::Labels::Profile->retrieve(profile_id => $profile_id); $template_list = get_all_templates( { fields => [ qw( template_id template_code profile_id) ] } ); } -elsif ($op eq 'save') { +elsif ($op eq 'cud-save') { my @params = ( printer_name => scalar $cgi->param('printer_name') || 'DEFAULT PRINTER', paper_bin => scalar $cgi->param('paper_bin') || 'Tray 1', diff --git a/labels/label-edit-template.pl b/labels/label-edit-template.pl index 5765c2e47f..a6865f0f28 100755 --- a/labels/label-edit-template.pl +++ b/labels/label-edit-template.pl @@ -44,7 +44,7 @@ my $profile_list = undef; my $units = get_unit_values(); -if ($op eq 'edit') { +if ($op eq 'cud-edit') { $label_template = C4::Labels::Template->retrieve(template_id => $template_id); $profile_list = get_all_profiles({ fields => [ qw( profile_id printer_name paper_bin ) ], filters => { template_id => [ $template_id, '' ], creator => 'Labels'} } ); push @$profile_list, {paper_bin => 'N/A', profile_id => 0, printer_name => 'No Profile'}; @@ -57,7 +57,7 @@ if ($op eq 'edit') { } } } -elsif ($op eq 'save') { +elsif ($op eq 'cud-save') { my @params = ( profile_id => scalar $cgi->param('profile_id'), template_code => scalar $cgi->param('template_code') || 'DEFAULT_TEMPLATE', template_desc => scalar $cgi->param('template_desc') || 'Default description', diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl index 4dba30276d..b949e026be 100755 --- a/labels/label-item-search.pl +++ b/labels/label-item-search.pl @@ -55,7 +55,7 @@ my $display_columns = [ {_add => {label => "Add Item", link_fi {select => {label => "Select", value => "_item_number"}}, ]; -if ( $op eq "do_search" ) { +if ( $op eq "cud-do_search" ) { $idx = $query->param('idx'); $ccl_textbox = $query->param('ccl_textbox'); if ( $ccl_textbox && $idx ) { diff --git a/labels/label-manage.pl b/labels/label-manage.pl index 01a7d5babe..329a390118 100755 --- a/labels/label-manage.pl +++ b/labels/label-manage.pl @@ -81,7 +81,7 @@ my $error = $cgi->param('error') || 0; my $branch_code = ($label_element eq 'batch' ? C4::Context->userenv->{'branch'} : ''); -if ($op eq 'delete') { +if ($op eq 'cud-delete') { if ($label_element eq 'layout') {$error = C4::Labels::Layout::delete(layout_id => $element_id);} elsif ($label_element eq 'template') {$error = C4::Labels::Template::delete(template_id => $element_id);} elsif ($label_element eq 'profile') {$error = C4::Labels::Profile::delete(profile_id => $element_id);} diff --git a/labels/label-print.pl b/labels/label-print.pl index f3dd120f18..74e358c048 100755 --- a/labels/label-print.pl +++ b/labels/label-print.pl @@ -68,7 +68,7 @@ my $multi_batch_count = scalar(@batch_ids) || ($from && $to) ? 1 : 0; my $label_count = scalar(@label_ids); my $item_count = scalar(@item_numbers); -if ($op eq 'export') { +if ($op eq 'cud-export') { if (@label_ids) { my $label_id_param = '&label_id='; $label_id_param .= join ('&label_id=',@label_ids); diff --git a/members/apikeys.pl b/members/apikeys.pl index 3aa4fa925c..f02300d0db 100755 --- a/members/apikeys.pl +++ b/members/apikeys.pl @@ -60,7 +60,7 @@ if( $patron_id != $loggedinuser && !C4::Context->IsSuperLibrarian() ) { my $op = $cgi->param('op') // ''; if ($op) { - if ( $op eq 'generate' ) { + if ( $op eq 'cud-generate' ) { my $description = $cgi->param('description') // ''; my $api_key = Koha::ApiKey->new( { patron_id => $patron_id, @@ -75,7 +75,7 @@ if ($op) { ); } - if ( $op eq 'delete' ) { + if ( $op eq 'cud-delete' ) { my $api_key_id = $cgi->param('key'); my $key = Koha::ApiKeys->find({ patron_id => $patron_id, client_id => $api_key_id }); if ($key) { @@ -85,7 +85,7 @@ if ($op) { exit; } - if ( $op eq 'revoke' ) { + if ( $op eq 'cud-revoke' ) { my $api_key_id = $cgi->param('key'); my $key = Koha::ApiKeys->find({ patron_id => $patron_id, client_id => $api_key_id }); if ($key) { @@ -96,7 +96,7 @@ if ($op) { exit; } - if ( $op eq 'activate' ) { + if ( $op eq 'cud-activate' ) { my $api_key_id = $cgi->param('key'); my $key = Koha::ApiKeys->find({ patron_id => $patron_id, client_id => $api_key_id }); if ($key) { diff --git a/members/boraccount.pl b/members/boraccount.pl index 086198d4d1..7a2f129def 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -122,7 +122,7 @@ if ( $action eq 'payout' ) { } } -if ( $action eq 'refund' ) { +if ( $action eq 'cud-refund' ) { output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' }); my $charge_id = scalar $input->param('accountlines_id'); my $charge = Koha::Account::Lines->find($charge_id); @@ -187,7 +187,7 @@ if ( $action eq 'send_receipt' ) { my $letter = C4::Letters::GetPreparedLetter( module => 'circulation', letter_code => uc( "ACCOUNT_" . $credit->credit_type_code ), - message_transport_type => 'email', + message_transport_type => 'cud-email', lang => $patron->lang, tables => { borrowers => $patron->borrowernumber, @@ -204,7 +204,7 @@ if ( $action eq 'send_receipt' ) { { letter => $letter, borrowernumber => $patron->borrowernumber, - message_transport_type => 'email', + message_transport_type => 'cud-email', } ); C4::Letters::SendQueuedMessages( { message_id => $message_id } ) if $message_id; diff --git a/members/deletemem.pl b/members/deletemem.pl index aedc5a6a4a..4b2b5b6190 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -92,7 +92,7 @@ if ( my $anonymous_patron = C4::Context->preference("AnonymousPatron") ) { } } -my $op = $input->param('op') || 'delete_confirm'; +my $op = $input->param('op') || 'cud-delete_confirm'; my $dbh = C4::Context->dbh; my $is_guarantor = $patron->guarantee_relationships->count; my $countholds = $dbh->selectrow_array("SELECT COUNT(*) FROM reserves WHERE borrowernumber=?", undef, $member); @@ -111,12 +111,12 @@ $template->param( ItemsOnHold => $countholds, ); -if ( $op eq 'delete_confirm' or $countissues > 0 or $debits or $is_guarantor ) { +if ( $op eq 'cud-delete_confirm' or $countissues > 0 or $debits or $is_guarantor ) { $template->param( - op => 'delete_confirm', + op => 'cud-delete_confirm', ); -} elsif ( $op eq 'delete_confirmed' ) { +} elsif ( $op eq 'cud-delete_confirmed' ) { output_and_exit( $input, $cookie, $template, 'wrong_csrf_token' ) unless Koha::Token->new->check_csrf( { session_id => $input->cookie('CGISESSID'), diff --git a/members/files.pl b/members/files.pl index 2abfbc71de..c09658a2d2 100755 --- a/members/files.pl +++ b/members/files.pl @@ -69,7 +69,7 @@ else { my %errors; - if ( $op eq 'upload' ) { + if ( $op eq 'cud-upload' ) { my $uploaded_file = $cgi->upload('uploadfile'); if ($uploaded_file) { @@ -98,7 +98,7 @@ else { else { $errors{'no_file'} = 1; } - } elsif ( $op eq 'delete' ) { + } elsif ( $op eq 'cud-delete' ) { $bf->DelFile( id => scalar $cgi->param('file_id') ); } diff --git a/members/mancredit.pl b/members/mancredit.pl index 12b11a9575..d91c9ef912 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -66,7 +66,7 @@ output_and_exit_if_error( my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; -my $add = $input->param('add'); +my $add = $input->param('cud-add'); if ($add) { # Note: If the logged in user is not allowed to see this patron an invoice can be forced diff --git a/members/maninvoice.pl b/members/maninvoice.pl index 959035751b..a7d12fd4fb 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -88,7 +88,7 @@ $template->param( barcode => $barcode ); -my $add = $input->param('add'); +my $add = $input->param('cud-add'); if ($add) { # Note: If the logged in user is not allowed to see this patron an invoice can be forced # Here we are trusting librarians not to hack the system diff --git a/members/memberentry.pl b/members/memberentry.pl index 714cb01377..8ddceacca9 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -74,8 +74,8 @@ if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) { } my $actionType = $input->param('actionType') || ''; -my $modify = $input->param('modify'); -my $delete = $input->param('delete'); +my $modify = $input->param('cud-modify'); +my $delete = $input->param('cud-delete'); my $op = $input->param('op'); my $destination = $input->param('destination'); my $cardnumber = $input->param('cardnumber'); @@ -83,7 +83,7 @@ my $check_member = $input->param('check_member'); my $nodouble = $input->param('nodouble'); my $duplicate = $input->param('duplicate'); my $quickadd = $input->param('quickadd'); -$nodouble = 1 if ($op eq 'modify' or $op eq 'duplicate'); # FIXME hack to represent fact that if we're +$nodouble = 1 if ($op eq 'cud-modify' or $op eq 'duplicate'); # FIXME hack to represent fact that if we're # modifying an existing patron, it ipso facto # isn't a duplicate. Marking FIXME because this # script needs to be refactored. @@ -163,11 +163,11 @@ foreach (@field_check) { next unless m/\w/o; $template->param( "no$_" => 1 ); } -$template->param( "add" => 1 ) if ( $op eq 'add' ); +$template->param( "cud-add" => 1 ) if ( $op eq 'cud-add' ); $template->param( "quickadd" => 1 ) if ( $quickadd ); $template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' ); $template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 ); -if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) { +if ( $op eq 'cud-modify' or $op eq 'cud-save' or $op eq 'duplicate' ) { my $logged_in_user = Koha::Patrons->find( $loggedinuser ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); @@ -191,8 +191,8 @@ $template->param( patron_category => $category ); # initialize %newdata my %newdata; # comes from $input->param() -if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) { - my @names = ( $borrower_data && $op ne 'save' ) ? keys %$borrower_data : $input->param(); +if ( $op eq 'cud-insert' || $op eq 'cud-modify' || $op eq 'cud-save' || $op eq 'duplicate' ) { + my @names = ( $borrower_data && $op ne 'cud-save' ) ? keys %$borrower_data : $input->param(); foreach my $key (@names) { if (defined $input->param($key)) { $newdata{$key} = $input->param($key); @@ -244,7 +244,7 @@ if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) } # Test uniqueness of surname, firstname and dateofbirth -if ( ( $op eq 'insert' ) and !$nodouble ) { +if ( ( $op eq 'cud-insert' ) and !$nodouble ) { my @dup_fields = split '\|', C4::Context->preference('PatronDuplicateMatchingAddFields'); my $conditions; for my $f ( @dup_fields ) { @@ -275,7 +275,7 @@ if (@delete_guarantor) { #Check if guarantor requirements are met my $valid_guarantor = @guarantors ? @guarantors : $newdata{'contactname'}; -if ( ( $op eq 'save' || $op eq 'insert' ) +if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) && C4::Context->preference('ChildNeedsGuarantor') && ( $category->category_type eq 'C' || $category->can_be_guarantee ) && !$valid_guarantor ) @@ -284,7 +284,7 @@ if ( ( $op eq 'save' || $op eq 'insert' ) } foreach my $guarantor (@guarantors) { - if ( ( $op eq 'save' || $op eq 'insert' ) && $guarantor->is_child || $guarantor->category->can_be_guarantee ) { + if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) && $guarantor->is_child || $guarantor->category->can_be_guarantee ) { push @errors, 'ERROR_guarantor_is_guarantee'; } } @@ -300,7 +300,7 @@ $newdata{'lang'} = $input->param('lang') if defined($input->param('lang')) # Bug 32426 removed the fake_patron code here that filled $newdata{userid}. We should leave it now to patron->store. my $extended_patron_attributes; -if ($op eq 'save' || $op eq 'insert'){ +if ($op eq 'cud-save' || $op eq 'cud-insert'){ # If the cardnumber is blank, treat it as null. $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/; @@ -323,7 +323,7 @@ if ($op eq 'save' || $op eq 'insert'){ } my $dateofbirth; - if ($op eq 'save' && $step == 3) { + if ($op eq 'cud-save' && $step == 3) { $dateofbirth = $patron->dateofbirth; } else { @@ -365,7 +365,7 @@ if ($op eq 'save' || $op eq 'insert'){ } # Validate emails - my $emailprimary = $input->param('email'); + my $emailprimary = $input->param('cud-email'); my $emailsecondary = $input->param('emailpro'); my $emailalt = $input->param('B_email'); @@ -400,7 +400,7 @@ elsif ( $borrowernumber ) { $extended_patron_attributes = Koha::Patrons->find($borrowernumber)->extended_attributes->unblessed; } -if ( ($op eq 'modify' || $op eq 'insert' || $op eq 'save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){ +if ( ($op eq 'cud-modify' || $op eq 'cud-insert' || $op eq 'cud-save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){ unless ($newdata{'dateexpiry'}){ $newdata{'dateexpiry'} = $category->get_expiry_date( $newdata{dateenrolled} ) if $category; } @@ -414,9 +414,9 @@ if ( defined $sms ) { ### Error checks should happen before this line. $nok = $nok || scalar(@errors); -if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ +if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ my $success; - if ($op eq 'insert'){ + if ($op eq 'cud-insert'){ # we know it's not a duplicate borrowernumber or there would already be an error delete $newdata{password2}; $success = 1; @@ -433,7 +433,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ warn "Patron creation failed! - $@"; # Maybe we must die instead of just warn push @messages, {error => 'error_on_insert_patron'}; } - $op = "add"; + $op = "cud-add"; return; }; @@ -468,7 +468,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ letter => $letter, borrowernumber => $patron->id, to_address => $emailaddr, - message_transport_type => 'email' + message_transport_type => 'cud-email' } ); SendQueuedMessages( { message_id => $message_id } ) if $message_id; @@ -497,7 +497,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ })->store; } - } elsif ($op eq 'save') { + } elsif ($op eq 'cud-save') { if ($NoUpdateLogin) { delete $newdata{'password'}; @@ -507,7 +507,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ $patron = Koha::Patrons->find( $borrowernumber ); if ($NoUpdateEmail) { - delete $newdata{'email'}; + delete $newdata{'cud-email'}; delete $newdata{'emailpro'}; delete $newdata{'B_email'}; } @@ -527,7 +527,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ warn "Patron modification failed! - $@"; # Maybe we must die instead of just warn push @messages, {error => 'error_on_update_patron'}; } - $op = "modify"; + $op = "cud-modify"; }; if ( $success ) { @@ -597,10 +597,10 @@ if ($delete){ } if ($nok or !$nodouble){ - $op="add" if ($op eq "insert"); - $op="modify" if ($op eq "save"); + $op="cud-add" if ($op eq "cud-insert"); + $op="cud-modify" if ($op eq "cud-save"); %data=%newdata; - $template->param( updtype => ($op eq 'add' ?'I':'M')); # used to check for $op eq "insert"... but we just changed $op! + $template->param( updtype => ($op eq 'cud-add' ?'I':'M')); # used to check for $op eq "cud-insert"... but we just changed $op! unless ($step){ $template->param( step_1 => 1,step_2 => 1,step_3 => 1, step_4 => 1, step_5 => 1, step_6 => 1, step_7 => 1 ); } @@ -619,7 +619,7 @@ if (C4::Context->preference("IndependentBranches")) { my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField"); my @prefill_fields=split(/\,/,$prefillguarantorfields); -if ($op eq 'add'){ +if ($op eq 'cud-add'){ if ($guarantor_id) { foreach (@prefill_fields) { $newdata{$_} = $guarantor->$_; @@ -627,7 +627,7 @@ if ($op eq 'add'){ } $template->param( updtype => 'I', step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1); } -if ($op eq "modify") { +if ($op eq "cud-modify") { $template->param( updtype => 'M',modify => 1 ); $template->param( step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1) unless $step; if ( $step == 4 ) { @@ -708,7 +708,7 @@ if (C4::Context->userenv && C4::Context->userenv->{'branch'}) { $userbranch = C4::Context->userenv->{'branch'}; } -if (defined ($data{'branchcode'}) and ( $op eq 'modify' || $op eq 'duplicate' || ( $op eq 'add' && $category->category_type eq 'C' ) )) { +if (defined ($data{'branchcode'}) and ( $op eq 'cud-modify' || $op eq 'duplicate' || ( $op eq 'cud-add' && $category->category_type eq 'C' ) )) { $userbranch = $data{'branchcode'}; } $template->param( userbranch => $userbranch ); @@ -768,7 +768,7 @@ if ( C4::Context->preference('ExtendedPatronAttributes') ) { } if (C4::Context->preference('EnhancedMessagingPreferences')) { - if ($op eq 'add') { + if ($op eq 'cud-add') { C4::Form::MessagingPreferences::set_form_values({ categorycode => $categorycode }, $template); } else { C4::Form::MessagingPreferences::set_form_values({ borrowernumber => $borrowernumber }, $template); diff --git a/members/merge-patrons.pl b/members/merge-patrons.pl index 5318ff6ff5..8109e1c44a 100755 --- a/members/merge-patrons.pl +++ b/members/merge-patrons.pl @@ -37,10 +37,10 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( } ); -my $action = $cgi->param('action') || 'show'; +my $action = $cgi->param('action') || 'cud-show'; my @ids = $cgi->multi_param('id'); -if ( $action eq 'show' ) { +if ( $action eq 'cud-show' ) { my $patrons = Koha::Patrons->search({ borrowernumber => { -in => \@ids } }); $template->param( patrons => $patrons ); } elsif ( $action eq 'merge' ) { diff --git a/members/mod_debarment.pl b/members/mod_debarment.pl index e9a99eec8c..5e9febb0d9 100755 --- a/members/mod_debarment.pl +++ b/members/mod_debarment.pl @@ -40,9 +40,9 @@ my $patron = Koha::Patrons->find($borrowernumber); # But a librarian is not supposed to hack the system $action = '' unless $logged_in_user->can_see_patron_infos( $patron ); -if ( $action eq 'del' ) { +if ( $action eq 'cud-del' ) { DelDebarment( scalar $cgi->param('borrower_debarment_id') ); -} elsif ( $action eq 'add' ) { +} elsif ( $action eq 'cud-add' ) { my $expiration = $cgi->param('expiration'); my $type = $cgi->param('debarred_type') // 'MANUAL'; if ($expiration) { diff --git a/members/notices.pl b/members/notices.pl index 019b1430ff..8cef24c453 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -51,7 +51,7 @@ output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log # Allow resending of messages in Notices tab my $op = $input->param('op') || q{}; -if ( $op eq 'resend_notice' ) { +if ( $op eq 'cud-resend_notice' ) { my $message_id = $input->param('message_id'); my $message = C4::Letters::GetMessage( $message_id ); if ( $message->{borrowernumber} = $borrowernumber ) { @@ -84,7 +84,7 @@ if ( $op eq 'send_welcome' ) { letter => $letter, borrowernumber => $patron->id, to_address => $emailaddr, - message_transport_type => 'email' + message_transport_type => 'cud-email' } ); }; diff --git a/members/search.pl b/members/search.pl index 05752ae13d..ec7c38f09e 100755 --- a/members/search.pl +++ b/members/search.pl @@ -37,8 +37,8 @@ my $referer = $input->referer(); my @columns = split ',', $input->param('columns'); my $callback = $input->param('callback'); -my $selection_type = $input->param('selection_type') || 'select'; -my $filter = $input->param('filter'); +my $selection_type = $input->param('selection_type') || 'cud-select'; +my $filter = $input->param('cud-filter'); $template->param( view => ( $input->request_method() eq "GET" ) ? "show_form" : "show_results", diff --git a/members/two_factor_auth.pl b/members/two_factor_auth.pl index 7ebd23ab47..70449c5ac1 100755 --- a/members/two_factor_auth.pl +++ b/members/two_factor_auth.pl @@ -55,7 +55,7 @@ else { token => scalar $cgi->param('csrf_token'), }; - if ( $op eq 'disable-2FA' ) { + if ( $op eq 'cud-disable-2FA' ) { my $auth = Koha::Auth::TwoFactorAuth->new( { patron => $logged_in_user } ); $logged_in_user->secret(undef); @@ -73,7 +73,7 @@ else { borrowers => $logged_in_user->id }, }, - message_transports => ['email'], + message_transports => ['cud-email'], } ); } diff --git a/members/update-child.pl b/members/update-child.pl index 765687f128..50ae505d1c 100755 --- a/members/update-child.pl +++ b/members/update-child.pl @@ -65,7 +65,7 @@ if ( $op eq 'multi' ) { ); output_html_with_http_headers $input, $cookie, $template->output; } -elsif ( $op eq 'update' ) { +elsif ( $op eq 'cud-update' ) { my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/misc/add_statistics_borrowers_categorycode.pl b/misc/add_statistics_borrowers_categorycode.pl index 4099a9cafe..3870c568d5 100755 --- a/misc/add_statistics_borrowers_categorycode.pl +++ b/misc/add_statistics_borrowers_categorycode.pl @@ -21,7 +21,7 @@ my $dbh = C4::Context->dbh; my $sthDelBor = $dbh->prepare("SELECT * FROM deletedborrowers WHERE borrowernumber = ? "); my $sthUpdateStat = $dbh->prepare("UPDATE statistics SET categorycode = ? WHERE datetime = ? AND branch = ? AND type = ? AND itemnumber = ? "); -my $query2 = "SELECT * FROM statistics WHERE type = 'issue' OR type = 'renew' OR type = 'localuse'"; +my $query2 = "SELECT * FROM statistics WHERE type = 'issue' OR type = 'cud-renew' OR type = 'localuse'"; my $sth2 = $dbh->prepare($query2); $sth2->execute(); my $stats = $sth2->fetchall_arrayref({}); diff --git a/misc/recreateIssueStatistics.pl b/misc/recreateIssueStatistics.pl index 8032019440..c9222418b2 100755 --- a/misc/recreateIssueStatistics.pl +++ b/misc/recreateIssueStatistics.pl @@ -96,7 +96,7 @@ if ($issues == 1) { # This is the not-so accurate part : # We assume that there are missing renewals, based on the last renewal date # Maybe should this be deactivated by default ? - my $ctnquery = "SELECT count(*) as cnt FROM statistics WHERE borrowernumber = ? AND itemnumber = ? AND DATE(datetime) = ? AND type = 'renew'"; + my $ctnquery = "SELECT count(*) as cnt FROM statistics WHERE borrowernumber = ? AND itemnumber = ? AND DATE(datetime) = ? AND type = 'cud-renew'"; my $substh = $dbh->prepare($ctnquery); $substh->execute($hashref->{'borrowernumber'}, $hashref->{'itemnumber'}, $hashref->{'lastreneweddate'}); @@ -115,7 +115,7 @@ if ($issues == 1) { $hashref->{'lastreneweddate'}, $hashref->{'branchcode'}, 0, - 'renew', + 'cud-renew', '', $hashref->{'itemnumber'}, $itemtype, diff --git a/misc/sip_cli_emulator.pl b/misc/sip_cli_emulator.pl index dbb56537fe..f8a2e26001 100755 --- a/misc/sip_cli_emulator.pl +++ b/misc/sip_cli_emulator.pl @@ -194,7 +194,7 @@ my $handlers = { 'item_properties', 'patron_password', 'fee_acknowledged', - 'cancel', + 'cud-cancel', ], }, checkin => { @@ -215,7 +215,7 @@ my $handlers = { 'return_date', # defaults to transaction date 'item_properties', 'patron_password', - 'cancel', + 'cud-cancel', ], }, renew => { @@ -301,7 +301,7 @@ my $handlers = { }, }; -my $data = run_command_message('login'); +my $data = run_command_message('cud-login'); if ( $data =~ '^941' ) { ## we are logged in foreach my $m (@messages) { diff --git a/offline_circ/process.pl b/offline_circ/process.pl index 09520a1cae..6203857416 100755 --- a/offline_circ/process.pl +++ b/offline_circ/process.pl @@ -40,7 +40,7 @@ my $result; if ( $action eq 'process' ) { my $operation = GetOfflineOperation( $operationid ); $result = ProcessOfflineOperation( $operation ); -} elsif ( $action eq 'delete' ) { +} elsif ( $action eq 'cud-delete' ) { $result = DeleteOfflineOperation( $operationid ); } diff --git a/opac/opac-alert-subscribe.pl b/opac/opac-alert-subscribe.pl index 63c3c679b5..97ef88b133 100755 --- a/opac/opac-alert-subscribe.pl +++ b/opac/opac-alert-subscribe.pl @@ -46,7 +46,7 @@ my $biblionumber = $query->param('biblionumber'); my $subscription = Koha::Subscriptions->find($subscriptionid); my $logged_in_patron = Koha::Patrons->find($loggedinuser); -if ( $op eq 'alert_confirmed' ) { +if ( $op eq 'cud-alert_confirmed' ) { $subscription->add_subscriber($logged_in_patron); if ( $referer eq 'serial' ) { print $query->redirect("opac-serial-issues.pl?biblionumber=$biblionumber"); @@ -55,7 +55,7 @@ if ( $op eq 'alert_confirmed' ) { print $query->redirect("opac-detail.pl?biblionumber=$biblionumber"); exit; } -} elsif ( $op eq 'cancel_confirmed' ) { +} elsif ( $op eq 'cud-cancel_confirmed' ) { $subscription->remove_subscriber($logged_in_patron); warn "CANCEL confirmed : $loggedinuser, $subscriptionid"; if ( $referer eq 'serial' ) { diff --git a/opac/opac-authorities-home.pl b/opac/opac-authorities-home.pl index 9e617485d2..8b57bac299 100755 --- a/opac/opac-authorities-home.pl +++ b/opac/opac-authorities-home.pl @@ -48,7 +48,7 @@ my ( $template, $loggedinuser, $cookie ); my $authority_types = Koha::Authority::Types->search({}, { order_by => ['authtypetext']}); -if ( $op eq "do_search" ) { +if ( $op eq "cud-do_search" ) { my @input_marclist = $query->multi_param('marclist'); my @and_or = $query->multi_param('and_or'); my @excluding = $query->multi_param('excluding'); diff --git a/opac/opac-browser.pl b/opac/opac-browser.pl index aad5940f5c..4de1737f9a 100755 --- a/opac/opac-browser.pl +++ b/opac/opac-browser.pl @@ -47,7 +47,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( # the level of browser to display my $level = $query->param('level') || 0; -my $filter = $query->param('filter'); +my $filter = $query->param('cud-filter'); $filter = '' unless defined $filter; $level++; # the level passed is the level of the PREVIOUS list, not the current one. Thus the ++ diff --git a/opac/opac-curbside-pickups.pl b/opac/opac-curbside-pickups.pl index f5b4790ae7..13450a0744 100755 --- a/opac/opac-curbside-pickups.pl +++ b/opac/opac-curbside-pickups.pl @@ -49,7 +49,7 @@ my $logged_in_patron = Koha::Patrons->find($borrowernumber); my $branchcode = $input->param('pickup_branch'); my @messages; -if ( $op eq 'create-pickup' ) { +if ( $op eq 'cud-create-pickup' ) { my $scheduled_pickup_datetime = $input->param('pickup_time'); my $notes = $input->param('notes'); @@ -105,7 +105,7 @@ if ( $op eq 'create-pickup' ) { } } } -elsif ( $op eq 'cancel-pickup' ) { +elsif ( $op eq 'cud-cancel-pickup' ) { my $id = $input->param('pickup_id'); my $curbside_pickup = Koha::CurbsidePickups->search( { borrowernumber => $borrowernumber } )->find($id); @@ -113,7 +113,7 @@ elsif ( $op eq 'cancel-pickup' ) { if $curbside_pickup && !$curbside_pickup->delivered_datetime; } -elsif ( $op eq 'arrival-alert' ) { +elsif ( $op eq 'cud-arrival-alert' ) { my $id = $input->param('pickup_id'); my $curbside_pickup = Koha::CurbsidePickups->search( { borrowernumber => $borrowernumber } )->find($id); diff --git a/opac/opac-discharge.pl b/opac/opac-discharge.pl index 991ebae5e0..d232ea5722 100755 --- a/opac/opac-discharge.pl +++ b/opac/opac-discharge.pl @@ -54,7 +54,7 @@ my $pending = Koha::Patron::Discharge::count({ }); my $available = Koha::Patron::Discharge::is_discharged({borrowernumber => $loggedinuser}); -if ( $op eq 'request' ) { +if ( $op eq 'cud-request' ) { if ($pending || $available) { # Request already done print $input->redirect("/cgi-bin/koha/opac-discharge.pl"); diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl index 5173b8da6c..4ad18ca42a 100755 --- a/opac/opac-illrequests.pl +++ b/opac/opac-illrequests.pl @@ -72,7 +72,7 @@ if ( $illrequest_id = $params->{illrequest_id} ) { } } -if ( ( $op eq 'create' || $op eq 'cancreq' || $op eq 'update' ) && !$patron->_result->categorycode->can_place_ill_in_opac ) { +if ( ( $op eq 'create' || $op eq 'cancreq' || $op eq 'cud-update' ) && !$patron->_result->categorycode->can_place_ill_in_opac ) { print $query->redirect('/cgi-bin/koha/errors/403.pl'); exit; } @@ -92,7 +92,7 @@ if ( $op eq 'list' ) { request => $request ); -} elsif ( $op eq 'update') { +} elsif ( $op eq 'cud-update') { $request->notesopac($params->{notesopac})->store; # Send a notice to staff alerting them of the update $request->send_staff_notice('ILL_REQUEST_MODIFIED'); diff --git a/opac/opac-issue-note.pl b/opac/opac-issue-note.pl index b59e838b06..681674f600 100755 --- a/opac/opac-issue-note.pl +++ b/opac/opac-issue-note.pl @@ -91,7 +91,7 @@ if ( $action eq 'issuenote' && C4::Context->preference('AllowCheckoutNotes') && C4::Letters::EnqueueLetter({ letter => $letter, - message_transport_type => 'email', + message_transport_type => 'cud-email', borrowernumber => $patron->borrowernumber, to_address => $to_address, reply_address => $reply_address, diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 4934085d00..6446024fcd 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -64,7 +64,7 @@ if ( $borrowernumber && ( $action eq 'create' || $action eq 'new' ) ) { if ( $action eq q{} ) { if ($borrowernumber) { - $action = 'edit'; + $action = 'cud-edit'; } else { $action = 'new'; @@ -189,7 +189,7 @@ if ( $action eq 'create' ) { authnotrequired => 1, } ); - $template->param( 'email' => $borrower{'email'} ); + $template->param( 'cud-email' => $borrower{'cud-email'} ); my $verification_token = md5_hex( time().{}.rand().{}.$$ ); while ( Koha::Patron::Modifications->search( { verification_token => $verification_token } )->count() ) { @@ -215,8 +215,8 @@ if ( $action eq 'create' ) { my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'email', - to_address => $borrower{'email'}, + message_transport_type => 'cud-email', + to_address => $borrower{'cud-email'}, from_address => C4::Context->preference('KohaAdminEmailAddress'), } @@ -288,7 +288,7 @@ if ( $action eq 'create' ) { letter => $letter, borrowernumber => $patron->id, to_address => $emailaddr, - message_transport_type => 'email' + message_transport_type => 'cud-email' } ); SendQueuedMessages( { message_id => $message_id } ) if $message_id; @@ -311,7 +311,7 @@ if ( $action eq 'create' ) { } } } -elsif ( $action eq 'update' ) { +elsif ( $action eq 'cud-update' ) { my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed; @@ -333,7 +333,7 @@ elsif ( $action eq 'update' ) { ); $template->param( patron_attribute_classes => GeneratePatronAttributesForm( $borrowernumber, $attributes ) ); - $template->param( action => 'edit' ); + $template->param( action => 'cud-edit' ); } else { my %borrower_changes = DelUnchangedFields( $borrowernumber, %borrower ); @@ -371,7 +371,7 @@ elsif ( $action eq 'update' ) { else { my $patron = Koha::Patrons->find( $borrowernumber ); $template->param( - action => 'edit', + action => 'cud-edit', nochanges => 1, borrower => $patron->unblessed, patron_attribute_classes => GeneratePatronAttributesForm( $borrowernumber, $attributes ), @@ -379,13 +379,13 @@ elsif ( $action eq 'update' ) { } } } -elsif ( $action eq 'edit' ) { #Display logged in borrower's data +elsif ( $action eq 'cud-edit' ) { #Display logged in borrower's data my $patron = Koha::Patrons->find( $borrowernumber ); my $borrower = $patron->unblessed; $template->param( borrower => $borrower, - hidden => GetHiddenFields( $mandatory, 'edit' ), + hidden => GetHiddenFields( $mandatory, 'cud-edit' ), ); if (C4::Context->preference('OPACpatronimages')) { @@ -416,7 +416,7 @@ sub GetHiddenFields { my ( $mandatory, $action ) = @_; my %hidden_fields; - my $BorrowerUnwantedField = $action eq 'edit' || $action eq 'update' ? + my $BorrowerUnwantedField = $action eq 'cud-edit' || $action eq 'cud-update' ? C4::Context->preference( "PatronSelfModificationBorrowerUnwantedField" ) : C4::Context->preference( "PatronSelfRegistrationBorrowerUnwantedField" ); @@ -436,7 +436,7 @@ sub GetMandatoryFields { my %mandatory_fields; - my $BorrowerMandatoryField = $action eq 'edit' || $action eq 'update' ? + my $BorrowerMandatoryField = $action eq 'cud-edit' || $action eq 'cud-update' ? C4::Context->preference("PatronSelfModificationMandatoryField") : C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField"); @@ -448,7 +448,7 @@ sub GetMandatoryFields { } if ( $action eq 'create' || $action eq 'new' ) { - $mandatory_fields{'email'} = 1 + $mandatory_fields{'cud-email'} = 1 if C4::Context->preference( 'PatronSelfRegistrationVerifyByEmail'); } @@ -489,9 +489,9 @@ sub CheckMandatoryAttributes{ sub CheckForInvalidFields { my $borrower = shift; my @invalidFields; - if ($borrower->{'email'}) { + if ($borrower->{'cud-email'}) { unless ( Koha::Email->is_valid($borrower->{email}) ) { - push(@invalidFields, "email"); + push(@invalidFields, "cud-email"); } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited? { @@ -508,7 +508,7 @@ sub CheckForInvalidFields { push @invalidFields, "duplicate_email"; } } elsif ( C4::Context->preference("PatronSelfRegistrationConfirmEmail") - && $borrower->{'email'} ne $borrower->{'repeat_email'} + && $borrower->{'cud-email'} ne $borrower->{'repeat_email'} && !defined $borrower->{borrowernumber} ) { push @invalidFields, "email_match"; } @@ -569,11 +569,11 @@ sub ParseCgiForBorrower { sub DelUnchangedFields { my ( $borrowernumber, %new_data ) = @_; # get the mandatory fields so we can get the hidden fields - my $mandatory = GetMandatoryFields('edit'); + my $mandatory = GetMandatoryFields('cud-edit'); my $patron = Koha::Patrons->find( $borrowernumber ); my $current_data = $patron->unblessed; # get the hidden fields so we don't obliterate them should they have data patrons aren't allowed to modify - my $hidden_fields = GetHiddenFields($mandatory, 'edit'); + my $hidden_fields = GetHiddenFields($mandatory, 'cud-edit'); foreach my $key ( keys %new_data ) { diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 7553bd73d0..dac74addc4 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -51,7 +51,7 @@ my $patron = Koha::Patrons->find( $borrowernumber ); # FIXME and if borrowernumb my $messaging_options; $messaging_options = C4::Members::Messaging::GetMessagingOptions() if $opac_messaging; -if ( defined $query->param('modify') && $query->param('modify') eq 'yes' ) { +if ( defined $query->param('cud-modify') && $query->param('cud-modify') eq 'yes' ) { if( $opac_messaging ) { my $sms = $query->param('SMSnumber'); diff --git a/opac/opac-passwd.pl b/opac/opac-passwd.pl index 23ff92ab7e..666e359a1b 100755 --- a/opac/opac-passwd.pl +++ b/opac/opac-passwd.pl @@ -46,7 +46,7 @@ if ( $patron->category->effective_change_password ) { && $query->param('Newkey') && $query->param('Confirm') ) { - die "op must be set" unless $op eq 'change_password'; + die "op must be set" unless $op eq 'cud-change_password'; my $error; my $new_password = $query->param('Newkey'); my $confirm_password = $query->param('Confirm'); diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl index 0c0824c674..934aa77458 100755 --- a/opac/opac-password-recovery.pl +++ b/opac/opac-password-recovery.pl @@ -28,7 +28,7 @@ my ( $template, $dummy, $cookie ) = get_template_and_user( } ); -my $email = $query->param('email') // q{}; +my $email = $query->param('cud-email') // q{}; my $password = $query->param('newPassword'); my $repeatPassword = $query->param('repeatPassword'); my $id = $query->param('id'); diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl index 81d5958512..1b4e41ac30 100755 --- a/opac/opac-privacy.pl +++ b/opac/opac-privacy.pl @@ -47,7 +47,7 @@ my $privacy_guarantor_fines = $query->param("privacy_guarantor_fines"); my $patron = Koha::Patrons->find( $borrowernumber ); -if ( $op eq "update_privacy" ) { +if ( $op eq "cud-update_privacy" ) { if ( $patron ) { $patron->set({ privacy => $privacy, @@ -57,7 +57,7 @@ if ( $op eq "update_privacy" ) { $template->param( 'privacy_updated' => 1 ); } } -elsif ( $op eq "delete_record" ) { +elsif ( $op eq "cud-delete_record" ) { my $holds = $query->param('holds'); my $checkouts = $query->param('checkouts'); diff --git a/opac/opac-recall.pl b/opac/opac-recall.pl index 2a8b2497c0..e7085a4e59 100755 --- a/opac/opac-recall.pl +++ b/opac/opac-recall.pl @@ -60,7 +60,7 @@ if ( C4::Context->preference('UseRecalls') ) { } # submitting recall request - if ($op eq 'request'){ + if ($op eq 'cud-request'){ if ( defined $error and $error eq 'unavailable' ){ # no items available for recall @@ -112,7 +112,7 @@ if ( C4::Context->preference('UseRecalls') ) { $error = 'failed'; } } - } elsif ($op eq 'cancel'){ + } elsif ($op eq 'cud-cancel'){ my $recall_id = $query->param('recall_id'); Koha::Recalls->find( $recall_id )->set_cancelled; print $query->redirect('/cgi-bin/koha/opac-user.pl'); diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl index 7acbd9d229..f57c99719b 100755 --- a/opac/opac-registration-verify.pl +++ b/opac/opac-registration-verify.pl @@ -141,7 +141,7 @@ elsif ( $rego_found letter => $letter, borrowernumber => $patron->id, to_address => $emailaddr, - message_transport_type => 'email' + message_transport_type => 'cud-email' } ); SendQueuedMessages( { message_id => $message_id } ) if $message_id; diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl index dff4d5b21f..078fbef2be 100755 --- a/opac/opac-renew.pl +++ b/opac/opac-renew.pl @@ -33,7 +33,7 @@ use Koha::Patrons; my $query = CGI->new; my $op = $query->param('op') || q{}; -die "op must be set" unless $op eq 'renew'; +die "op must be set" unless $op eq 'cud-renew'; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { diff --git a/opac/opac-reportproblem.pl b/opac/opac-reportproblem.pl index 2cb1ff340b..5ef7e6c374 100755 --- a/opac/opac-reportproblem.pl +++ b/opac/opac-reportproblem.pl @@ -63,7 +63,7 @@ $template->param( ); my $op = $input->param('op') || ''; -if ( $op eq 'addreport' ) { +if ( $op eq 'cud-addreport' ) { my $subject = $input->param('subject'); my $message = $input->param('message'); @@ -97,7 +97,7 @@ if ( $op eq 'addreport' ) { } ); - my $transport = 'email'; + my $transport = 'cud-email'; my $reply_address = $patron->email || $patron->emailpro || $patron->B_email; if ( $recipient eq 'library' and defined($library->inbound_email_address) and $library->inbound_email_address ne C4::Context->preference('KohaAdminEmailAddress') ) { diff --git a/opac/opac-reset-password.pl b/opac/opac-reset-password.pl index 2090ddae93..969e10f517 100755 --- a/opac/opac-reset-password.pl +++ b/opac/opac-reset-password.pl @@ -39,7 +39,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $op = $query->param('op'); -if ( $op eq 'update' ) { +if ( $op eq 'cud-update' ) { my $userid = $query->param('userid'); my $currentpassword = $query->param('currentpassword'); my $newpassword = $query->param('newpassword'); diff --git a/opac/opac-search-history.pl b/opac/opac-search-history.pl index 8ef23062e7..b5a53c6011 100755 --- a/opac/opac-search-history.pl +++ b/opac/opac-search-history.pl @@ -51,7 +51,7 @@ my $previous = $cgi->param('previous'); # If the user is not logged in, we deal with the session unless ( $loggedinuser ) { # Deleting search history - if ( $action eq 'delete') { + if ( $action eq 'cud-delete') { # Deleting session's search history my @id = $cgi->multi_param('id'); my $all = not scalar( @id ); @@ -96,7 +96,7 @@ unless ( $loggedinuser ) { my $dbh = C4::Context->dbh; # Deleting search history - if ( $action eq 'delete' ) { + if ( $action eq 'cud-delete' ) { my @id = $cgi->multi_param('id'); if ( @id ) { C4::Search::History::delete( diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index abbec91115..2235968d41 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -81,7 +81,7 @@ if ( $email_add ) { tables => { borrowers => $borrowernumber, }, - message_transport_type => 'email', + message_transport_type => 'cud-email', loops => \%loops, substitute => \%substitute, ); @@ -95,7 +95,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], diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index e08b474cb1..33e01d48d2 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -53,7 +53,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $shelfid = $query->param('shelfid'); -my $email = $query->param('email'); +my $email = $query->param('cud-email'); my $shelf = Koha::Virtualshelves->find($shelfid); if ( $shelf and $shelf->can_be_viewed($borrowernumber) ) { @@ -96,7 +96,7 @@ if ( $shelf and $shelf->can_be_viewed($borrowernumber) ) { tables => { borrowers => $borrowernumber, }, - message_transport_type => 'email', + message_transport_type => 'cud-email', loops => \%loops, substitute => \%substitute, ); @@ -110,7 +110,7 @@ if ( $shelf and $shelf->can_be_viewed($borrowernumber) ) { my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'email', + message_transport_type => 'cud-email', borrowernumber => $patron->borrowernumber, to_address => $email, reply_address => $user_email, diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl index 29edd82293..34354b88d6 100755 --- a/opac/opac-shareshelf.pl +++ b/opac/opac-shareshelf.pl @@ -180,7 +180,7 @@ sub notify_owner { C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'email', + message_transport_type => 'cud-email', from_address => C4::Context->preference('KohaAdminEmailAddress'), to_address => $toaddr, } @@ -249,7 +249,7 @@ sub send_invitekey { C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'email', + message_transport_type => 'cud-email', from_address => $fromaddr, to_address => $a, } diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 5cecfc7b96..74fa85be21 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -96,7 +96,7 @@ my ( $shelf, $shelfnumber, @messages ); if ( $op eq 'add_form' ) { # Only pass default $shelf = { allow_change_from_owner => 1 }; -} elsif ( $op eq 'edit_form' ) { +} elsif ( $op eq 'cud-edit_form' ) { $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); @@ -111,7 +111,7 @@ if ( $op eq 'add_form' ) { } else { push @messages, { type => 'error', code => 'does_not_exist' }; } -} elsif ( $op eq 'add' ) { +} elsif ( $op eq 'cud-add' ) { if ( $loggedinuser ) { my $allow_changes_from = $query->param('allow_changes_from'); eval { @@ -141,7 +141,7 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'error', code => 'unauthorized_on_insert' }; $op = 'list'; } -} elsif ( $op eq 'edit' ) { +} elsif ( $op eq 'cud-edit' ) { $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); if ( $shelf ) { @@ -161,7 +161,7 @@ if ( $op eq 'add_form' ) { if ($@) { push @messages, { type => 'error', code => 'error_on_update' }; - $op = 'edit_form'; + $op = 'cud-edit_form'; } else { push @messages, { type => 'message', code => 'success_on_update' }; } @@ -171,7 +171,7 @@ if ( $op eq 'add_form' ) { } else { push @messages, { type => 'error', code => 'does_not_exist' }; } -} elsif ( $op eq 'delete' ) { +} elsif ( $op eq 'cud-delete' ) { $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); if ($shelf) { @@ -189,7 +189,7 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'error', code => 'does_not_exist' }; } $op = $referer; -} elsif ( $op eq 'remove_share' ) { +} elsif ( $op eq 'cud-remove_share' ) { $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); if ($shelf) { @@ -206,7 +206,7 @@ if ( $op eq 'add_form' ) { } $op = $referer; -} elsif ( $op eq 'add_biblio' ) { +} elsif ( $op eq 'cud-add_biblio' ) { $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); if ($shelf) { @@ -233,7 +233,7 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'error', code => 'does_not_exist' }; } $op = $referer; -} elsif ( $op eq 'remove_biblios' ) { +} elsif ( $op eq 'cud-remove_biblios' ) { $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); my @biblionumber = $query->multi_param('biblionumber'); @@ -261,7 +261,7 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'error', code => 'does_not_exist' }; } $op = 'view'; -} elsif( $op eq 'transfer' ) { +} elsif( $op eq 'cud-transfer' ) { $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber) if $shelfnumber; my $new_owner = $query->param('new_owner'); # borrowernumber or undef @@ -278,7 +278,7 @@ if ( $op eq 'add_form' ) { } if( @$patrons ) { $template->param( shared_users => $patrons ); - $op = 'transfer'; + $op = 'cud-transfer'; } else { push @messages, { type => 'error', code => 'no_email_found' }; } diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index 84866326ac..8a81e01b52 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -138,8 +138,8 @@ $suggestion = { }; $suggestion->{suggestedby} = $borrowernumber; -if ( $op eq "add_validate" && not $biblionumber ) { # If we are creating the suggestion from an existing record we do not want to search for duplicates - $op = 'add_confirm'; +if ( $op eq "cud-add_validate" && not $biblionumber ) { # If we are creating the suggestion from an existing record we do not want to search for duplicates + $op = 'cud-add_confirm'; my $biblio = MarcRecordFromNewSuggestion($suggestion); if ( my ($duplicatebiblionumber, $duplicatetitle) = FindDuplicate($biblio) ) { push @messages, { type => 'error', code => 'biblio_exists', id => $duplicatebiblionumber, title => $duplicatetitle }; @@ -161,7 +161,7 @@ if ( $borrowernumber ){ } } -if ( $op eq "add_confirm" ) { +if ( $op eq "cud-add_confirm" ) { my $suggestions = Koha::Suggestions->search($suggestion); if ( C4::Context->preference("MaxTotalSuggestions") ne '' && $patrons_total_suggestions_count >= C4::Context->preference("MaxTotalSuggestions") ) { @@ -232,7 +232,7 @@ my $suggestions = [ Koha::Suggestions->search_limited( } )->as_list ]; -if ( $op eq "delete_confirm" ) { +if ( $op eq "cud-delete_confirm" ) { my @delete_field = $input->multi_param("delete_field"); foreach my $delete_field (@delete_field) { &DelSuggestion( $borrowernumber, $delete_field ); diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index 43f156d31b..d62977200c 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -122,7 +122,7 @@ unless ( C4::Context->preference('TagsEnabled') ) { if ($add_op) { unless ($loggedinuser) { - push @errors, {+'login' => 1 }; + push @errors, {+'cud-login' => 1 }; push @globalErrorIndexes, $#errors; %newtags=(); # zero out any attempted additions @deltags=(); # zero out any attempted deletions diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index 43830ccfd5..ee8be6fa99 100755 --- a/opac/opac-topissues.pl +++ b/opac/opac-topissues.pl @@ -54,7 +54,7 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user( ); my $dbh = C4::Context->dbh; # Displaying results -my $do_it = $input->param('do_it') || 0; # as form been posted +my $do_it = $input->param('cud-do_it') || 0; # as form been posted my $limit = $input->param('limit'); $limit = 10 unless ($limit && $limit =~ /^\d+$/); # control user input for SQL query $limit = 100 if $limit > 100; diff --git a/patroncards/edit-batch.pl b/patroncards/edit-batch.pl index dbb3d9cc87..0ebd821507 100755 --- a/patroncards/edit-batch.pl +++ b/patroncards/edit-batch.pl @@ -78,14 +78,14 @@ if ($op eq 'remove') { exit; } } -elsif ($op eq 'delete') { +elsif ($op eq 'cud-delete') { $err = C4::Creators::Batch::delete(batch_id => $batch_id, branch_code => $branch_code); if ($err) { print $cgi->redirect("edit-batch.pl?op=edit&batch_id=$batch_id&error=404"); exit; } } -elsif ($op eq 'add') { +elsif ($op eq 'cud-add') { if ($bor_num_list) { my @bor_nums_unchecked = split /\n/, $bor_num_list; # $bor_num_list is effectively passed in as a separated list foreach my $number (@bor_nums_unchecked) { @@ -123,7 +123,7 @@ elsif ($op eq 'de_duplicate') { exit; } } -elsif ($op eq 'edit') { +elsif ($op eq 'cud-edit') { $batch = C4::Patroncards::Batch->retrieve(batch_id => $batch_id); $template->param( description => $batch->{'description'} ); } diff --git a/patroncards/edit-layout.pl b/patroncards/edit-layout.pl index 233bfac349..544ee4421e 100755 --- a/patroncards/edit-layout.pl +++ b/patroncards/edit-layout.pl @@ -80,7 +80,7 @@ sub _set_selected { return \@select_list; } -if ($op eq 'edit') { +if ($op eq 'cud-edit') { warn sprintf("Error performing '%s': No 'layout_id' passed in.", $op) unless ($layout_id); $layout = C4::Patroncards::Layout->retrieve(layout_id => $layout_id); $layout_xml = XMLin($layout->get_attr('layout_xml'), ForceArray => 1); @@ -169,7 +169,7 @@ if ($op eq 'edit') { output_html_with_http_headers $cgi, $cookie, $template->output; exit; } -elsif ($op eq 'save') { +elsif ($op eq 'cud-save') { my $format_string = undef; my $layout = {}; my $layout_name = undef; diff --git a/patroncards/edit-profile.pl b/patroncards/edit-profile.pl index e5517dad97..f89d3fea9f 100755 --- a/patroncards/edit-profile.pl +++ b/patroncards/edit-profile.pl @@ -45,11 +45,11 @@ my @label_template = (); my $units = get_unit_values(); -if ($op eq 'edit') { +if ($op eq 'cud-edit') { $profile = C4::Patroncards::Profile->retrieve(profile_id => $profile_id); $template_list = get_all_templates({ fields => [ qw( template_id template_code profile_id ) ] }); } -elsif ($op eq 'save') { +elsif ($op eq 'cud-save') { my @params = ( printer_name => scalar $cgi->param('printer_name'), paper_bin => scalar $cgi->param('paper_bin'), diff --git a/patroncards/edit-template.pl b/patroncards/edit-template.pl index 1c7a2cd411..847323f581 100755 --- a/patroncards/edit-template.pl +++ b/patroncards/edit-template.pl @@ -45,11 +45,11 @@ my $profile_list = undef; my $units = get_unit_values(); -if ($op eq 'edit') { +if ($op eq 'cud-edit') { $card_template = C4::Patroncards::Template->retrieve(template_id => $template_id); $profile_list = get_all_profiles({ fields => [ qw( profile_id printer_name paper_bin ) ], filters => {template_id => [ $template_id, 0 ], creator => 'Patroncards'} } ); } -elsif ($op eq 'save') { +elsif ($op eq 'cud-save') { my @params = ( profile_id => scalar $cgi->param('profile_id') || 0, template_code => scalar $cgi->param('template_code'), template_desc => scalar $cgi->param('template_desc'), diff --git a/patroncards/image-manage.pl b/patroncards/image-manage.pl index 3a6365653c..c018cda753 100755 --- a/patroncards/image-manage.pl +++ b/patroncards/image-manage.pl @@ -47,7 +47,7 @@ my $table = html_table($display_columns->{'image'}, get_image(undef, "image_id, my $image_limit = C4::Context->preference('ImageLimit') || ''; my $errstr = ''; # NOTE: For error codes see error-messages.inc -if ($op eq 'upload') { +if ($op eq 'cud-upload') { # Checking for duplicate image name my $dbh = C4::Context->dbh; my $query = "SELECT COUNT(*) FROM creator_images WHERE image_name=?"; @@ -118,7 +118,7 @@ if ($op eq 'upload') { } } } -elsif ($op eq 'delete') { +elsif ($op eq 'cud-delete') { my $err = ''; my $errstr = ''; if (@image_ids) { diff --git a/patroncards/manage.pl b/patroncards/manage.pl index 4366955d87..4cb37f1f83 100755 --- a/patroncards/manage.pl +++ b/patroncards/manage.pl @@ -88,7 +88,7 @@ my $display_columns = { layout => [ # db column => {col label my $errstr = ($cgi->param('error') ? $cgi->param('error') : ''); my $branch_code = ($card_element eq 'batch' ? C4::Context->userenv->{'branch'} : ''); -if ($op eq 'delete') { +if ($op eq 'cud-delete') { my $err = 0; my @element_ids = split(/,/, $element_id); foreach my $element_id (@element_ids) { diff --git a/patroncards/print.pl b/patroncards/print.pl index ea154ea8e4..dc7e0ee421 100755 --- a/patroncards/print.pl +++ b/patroncards/print.pl @@ -56,7 +56,7 @@ my $multi_batch_count = scalar(@batch_ids); my $card_count = scalar(@label_ids); my $borrower_count = scalar(@borrower_numbers); -if ($op eq 'export') { +if ($op eq 'cud-export') { if (@label_ids) { my $label_id_param = '&label_id='; $label_id_param .= join ('&label_id=',@label_ids); diff --git a/plugins/plugins-upload.pl b/plugins/plugins-upload.pl index 02fd2548c7..88bc9d7c90 100755 --- a/plugins/plugins-upload.pl +++ b/plugins/plugins-upload.pl @@ -66,7 +66,7 @@ my ( $tempfile, $tfh ); my %errors; -if ( ( $op eq 'Upload' ) && ( $uploadfile || $uploadlocation ) ) { +if ( ( $op eq 'cud-Upload' ) && ( $uploadfile || $uploadlocation ) ) { my $plugins_dir = C4::Context->config("pluginsdir"); $plugins_dir = ref($plugins_dir) eq 'ARRAY' ? $plugins_dir->[0] : $plugins_dir; @@ -126,7 +126,7 @@ if ( ( $op eq 'Upload' ) && ( $uploadfile || $uploadlocation ) ) { Koha::Plugins->new()->InstallPlugins(); } -} elsif ( ( $op eq 'Upload' ) && !$uploadfile && !$uploadlocation ) { +} elsif ( ( $op eq 'cud-Upload' ) && !$uploadfile && !$uploadlocation ) { warn "Problem uploading file or no file uploaded."; } diff --git a/pos/pay.pl b/pos/pay.pl index 495ffcdeec..202cea6197 100755 --- a/pos/pay.pl +++ b/pos/pay.pl @@ -84,7 +84,7 @@ if ( $total_paid and $total_paid ne '0.00' ) { ); } -if ( $action eq 'send' ) { +if ( $action eq 'cud-send' ) { my $payment_id = $input->param('payment_id'); my $change = $input->param('change'); my $collected = $input->param('collected'); @@ -95,7 +95,7 @@ if ( $action eq 'send' ) { module => 'pos', letter_code => 'RECEIPT', branchcode => C4::Context->userenv->{'branch'}, - message_transport_type => 'email', + message_transport_type => 'cud-email', tables => { credits => $payment_id, }, @@ -109,7 +109,7 @@ if ( $action eq 'send' ) { my $message_id = EnqueueLetter( { letter => $letter, - message_transport_type => 'email', + message_transport_type => 'cud-email', from_address => C4::Context->preference('KohaAdminEmailAddress'), to_address => $toaddr, } diff --git a/pos/register.pl b/pos/register.pl index aa9f8fd029..53bb5d2325 100755 --- a/pos/register.pl +++ b/pos/register.pl @@ -117,7 +117,7 @@ else { $template->param( error_cashup_permission => 1 ); } } - elsif ( $op eq 'refund' ) { + elsif ( $op eq 'cud-refund' ) { if ( $logged_in_user->has_permission( { cash_management => 'anonymous_refund' } ) ) { my $amount = $input->param('amount'); my $quantity = $input->param('quantity'); diff --git a/recalls/recalls_overdue.pl b/recalls/recalls_overdue.pl index f6db6cfa43..b4ca7e10ed 100755 --- a/recalls/recalls_overdue.pl +++ b/recalls/recalls_overdue.pl @@ -37,7 +37,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( my $op = $query->param('op') || 'list'; my @recall_ids = $query->multi_param('recall_ids'); -if ( $op eq 'cancel_multiple_recalls' ) { +if ( $op eq 'cud-cancel_multiple_recalls' ) { foreach my $id ( @recall_ids ) { Koha::Recalls->find( $id )->set_cancelled; } diff --git a/recalls/recalls_queue.pl b/recalls/recalls_queue.pl index 51a56b7168..9d07894b4b 100755 --- a/recalls/recalls_queue.pl +++ b/recalls/recalls_queue.pl @@ -35,7 +35,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( my $op = $query->param('op') || 'list'; my @recall_ids = $query->multi_param('recall_ids'); -if ( $op eq 'cancel_multiple_recalls' ) { +if ( $op eq 'cud-cancel_multiple_recalls' ) { foreach my $id ( @recall_ids ) { Koha::Recalls->find( $id )->set_cancelled; } diff --git a/recalls/recalls_to_pull.pl b/recalls/recalls_to_pull.pl index 42e2b89d23..5548027e34 100755 --- a/recalls/recalls_to_pull.pl +++ b/recalls/recalls_to_pull.pl @@ -37,7 +37,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( my $op = $query->param('op') || 'list'; my $recall_id = $query->param('recall_id'); -if ( $op eq 'cancel' ) { +if ( $op eq 'cud-cancel' ) { my $recall = Koha::Recalls->find( $recall_id ); if ( $recall->in_transit ) { C4::Items::ModItemTransfer( diff --git a/recalls/recalls_waiting.pl b/recalls/recalls_waiting.pl index a485e3a8c2..d8d51d1725 100755 --- a/recalls/recalls_waiting.pl +++ b/recalls/recalls_waiting.pl @@ -38,7 +38,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( my $op = $query->param('op') || 'list'; -if ( $op eq 'modify' ) { +if ( $op eq 'cud-modify' ) { my $expire = $query->param('expire') || ''; my $revert = $query->param('revert') || ''; my $recall_id = $query->param('recall_id'); diff --git a/recalls/request.pl b/recalls/request.pl index 222f7ab38b..b3cb7a3d97 100755 --- a/recalls/request.pl +++ b/recalls/request.pl @@ -41,7 +41,7 @@ my $biblionumber = $input->param('biblionumber'); my $recalls = Koha::Recalls->search({ biblio_id => $biblionumber, completed => 0 }); my $biblio = Koha::Biblios->find( $biblionumber ); -if ( $op eq 'cancel_multiple_recalls' ) { +if ( $op eq 'cud-cancel_multiple_recalls' ) { foreach my $id ( @recall_ids ) { Koha::Recalls->find( $id )->set_cancelled; } diff --git a/reports/acquisitions_stats.pl b/reports/acquisitions_stats.pl index 2c90fe32cc..6254896ac1 100755 --- a/reports/acquisitions_stats.pl +++ b/reports/acquisitions_stats.pl @@ -40,7 +40,7 @@ Plugin that shows a stats on borrowers =cut my $input = CGI->new; -my $do_it = $input->param('do_it'); +my $do_it = $input->param('cud-do_it'); my $fullreportname = "reports/acquisitions_stats.tt"; my $line = $input->param("Line"); my $column = $input->param("Column"); diff --git a/reports/bor_issues_top.pl b/reports/bor_issues_top.pl index 439db23810..cfbd23bc0a 100755 --- a/reports/bor_issues_top.pl +++ b/reports/bor_issues_top.pl @@ -38,7 +38,7 @@ plugin that shows a stats on borrowers my $input = CGI->new; my $fullreportname = "reports/bor_issues_top.tt"; -my $do_it = $input->param('do_it'); +my $do_it = $input->param('cud-do_it'); my $limit = $input->param("Limit"); my $column = $input->param("Criteria"); my @filters = $input->multi_param("Filter"); diff --git a/reports/borrowers_out.pl b/reports/borrowers_out.pl index b5271d98a5..d6314cb091 100755 --- a/reports/borrowers_out.pl +++ b/reports/borrowers_out.pl @@ -38,7 +38,7 @@ Plugin that shows a stats on borrowers =cut my $input = CGI->new; -my $do_it=$input->param('do_it'); +my $do_it=$input->param('cud-do_it'); my $fullreportname = "reports/borrowers_out.tt"; my $limit = $input->param("Limit"); my $column = $input->param("Criteria"); diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl index 4e0f645999..fc460f30dc 100755 --- a/reports/borrowers_stats.pl +++ b/reports/borrowers_stats.pl @@ -42,7 +42,7 @@ plugin that shows a stats on borrowers =cut my $input = CGI->new; -my $do_it=$input->param('do_it'); +my $do_it=$input->param('cud-do_it'); my $fullreportname = "reports/borrowers_stats.tt"; my $line = $input->param("Line"); my $column = $input->param("Column"); diff --git a/reports/cash_register_stats.pl b/reports/cash_register_stats.pl index 1dde63b114..e2bbceffdb 100755 --- a/reports/cash_register_stats.pl +++ b/reports/cash_register_stats.pl @@ -39,7 +39,7 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({ flagsrequired => {reports => '*'}, }); -my $do_it = $input->param('do_it'); +my $do_it = $input->param('cud-do_it'); my $output = $input->param("output"); my $basename = $input->param("basename"); my $transaction_type = $input->param("transaction_type") || 'ACT'; diff --git a/reports/cat_issues_top.pl b/reports/cat_issues_top.pl index d3d1e067b9..550466bc64 100755 --- a/reports/cat_issues_top.pl +++ b/reports/cat_issues_top.pl @@ -36,7 +36,7 @@ plugin that shows a stats on borrowers =cut my $input = CGI->new; -my $do_it=$input->param('do_it'); +my $do_it=$input->param('cud-do_it'); my $fullreportname = "reports/cat_issues_top.tt"; my $limit = $input->param("Limit"); my $column = $input->param("Criteria"); diff --git a/reports/catalogue_out.pl b/reports/catalogue_out.pl index c03dcb2d80..c4b9f26b29 100755 --- a/reports/catalogue_out.pl +++ b/reports/catalogue_out.pl @@ -32,7 +32,7 @@ Report that shows unborrowed items. =cut my $input = CGI->new; -my $do_it = $input->param('do_it'); +my $do_it = $input->param('cud-do_it'); my $limit = $input->param("Limit") || 10; my $column = $input->param("Criteria"); my @filters = $input->multi_param("Filter"); diff --git a/reports/catalogue_stats.pl b/reports/catalogue_stats.pl index b4d72a384b..7b5f2cfd4f 100755 --- a/reports/catalogue_stats.pl +++ b/reports/catalogue_stats.pl @@ -42,7 +42,7 @@ plugin that shows a stats on borrowers our $debug = 0; my $input = CGI->new; my $fullreportname = "reports/catalogue_stats.tt"; -my $do_it = $input->param('do_it'); +my $do_it = $input->param('cud-do_it'); my $line = $input->param("Line"); my $column = $input->param("Column"); my $cellvalue = $input->param("Cellvalue"); # one of 'items', 'biblios', 'deleteditems' diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 85b42c4efb..7a06585697 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -452,7 +452,7 @@ elsif ( $phase eq 'Choose these criteria' ) { foreach my $col (@columns) { my %total = (name => $col); my @selects = map {+{ value => $_ }} (qw(sum min max avg count)); - $total{'select'} = \@selects; + $total{'cud-select'} = \@selects; push @total_by, \%total; } @@ -493,7 +493,7 @@ elsif ( $phase eq 'Choose these operations' ) { foreach my $col (@columns) { my %order = (name => $col); my @selects = map {+{ value => $_ }} (qw(asc desc)); - $order{'select'} = \@selects; + $order{'cud-select'} = \@selects; push @order_by, \%order; } @@ -544,7 +544,7 @@ elsif ( $phase eq 'Save' ) { my $sql = $input->param('sql'); my $type = $input->param('type'); $template->param( - 'save' => 1, + 'cud-save' => 1, 'area' => $area, 'sql' => $sql, 'type' => $type, diff --git a/reports/issues_avg_stats.pl b/reports/issues_avg_stats.pl index e1270c9b7c..d29cc6565a 100755 --- a/reports/issues_avg_stats.pl +++ b/reports/issues_avg_stats.pl @@ -37,7 +37,7 @@ plugin that shows a stats on borrowers =cut my $input = CGI->new; -my $do_it=$input->param('do_it'); +my $do_it=$input->param('cud-do_it'); my $fullreportname = "reports/issues_avg_stats.tt"; my $line = $input->param("Line"); my $column = $input->param("Column"); diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index 52e904ed5f..b6a3d7e84c 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -43,7 +43,7 @@ Plugin that shows circulation stats my $input = CGI->new; my $fullreportname = "reports/issues_stats.tt"; -my $do_it = $input->param('do_it'); +my $do_it = $input->param('cud-do_it'); my $line = $input->param("Line"); my $column = $input->param("Column"); my @filters = $input->multi_param("Filter"); diff --git a/reports/itemslost.pl b/reports/itemslost.pl index f9d633251d..9f1a990f47 100755 --- a/reports/itemslost.pl +++ b/reports/itemslost.pl @@ -49,7 +49,7 @@ my $params = $query->Vars; my $get_items = $params->{'get_items'}; my $op = $query->param('op') || ''; -if ( $op eq 'export' ) { +if ( $op eq 'cud-export' ) { my @itemnumbers = $query->multi_param('itemnumber'); my $csv_profile_id = $query->param('csv_profile_id'); my @rows; diff --git a/reports/manager.pl b/reports/manager.pl index ff174f00d3..324a3b5af9 100755 --- a/reports/manager.pl +++ b/reports/manager.pl @@ -26,7 +26,7 @@ use C4::Output qw( output_html_with_http_headers ); my $input = CGI->new; my $report_name=$input->param("report_name"); -my $do_it=$input->param('do_it'); +my $do_it=$input->param('cud-do_it'); my $fullreportname = "reports/".$report_name.".tt"; my @values = $input->multi_param("value"); my ($template, $borrowernumber, $cookie) diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl index 103ab62356..43329e00e5 100755 --- a/reports/reserves_stats.pl +++ b/reports/reserves_stats.pl @@ -45,7 +45,7 @@ Plugin that shows reserve stats my $input = CGI->new; my $fullreportname = "reports/reserves_stats.tt"; -my $do_it = $input->param('do_it'); +my $do_it = $input->param('cud-do_it'); my $line = $input->param("Line"); my $column = $input->param("Column"); my $calc = $input->param("Cellvalue"); diff --git a/reports/serials_stats.pl b/reports/serials_stats.pl index c6254241c1..59f4920e59 100755 --- a/reports/serials_stats.pl +++ b/reports/serials_stats.pl @@ -35,7 +35,7 @@ plugin that shows a stats on serials my $input = CGI->new; my $templatename = "reports/serials_stats.tt"; -my $do_it = $input->param("do_it"); +my $do_it = $input->param("cud-do_it"); my $bookseller = $input->param("bookseller"); my $branchcode = $input->param("branchcode"); my $expired = $input->param("expired"); diff --git a/reserve/request.pl b/reserve/request.pl index 186b3faff5..11d9854f77 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -110,7 +110,7 @@ if ( $action eq 'move' ) { ); } } -elsif ( $action eq 'cancel' ) { +elsif ( $action eq 'cud-cancel' ) { my $reserve_id = $input->param('reserve_id'); my $cancellation_reason = $input->param("cancellation-reason"); my $hold = Koha::Holds->find($reserve_id); diff --git a/reviews/reviewswaiting.pl b/reviews/reviewswaiting.pl index 6d50443618..f6bd5ff29d 100755 --- a/reviews/reviewswaiting.pl +++ b/reviews/reviewswaiting.pl @@ -50,7 +50,7 @@ elsif ( $op eq 'unapprove' ) { my $review = Koha::Reviews->find( $reviewid ); $review->unapprove if $review; } -elsif ( $op eq 'delete' ) { +elsif ( $op eq 'cud-delete' ) { my $review = Koha::Reviews->find( $reviewid ); $review->delete if $review; } diff --git a/rotating_collections/editCollections.pl b/rotating_collections/editCollections.pl index 28a23e5867..6433e0106c 100755 --- a/rotating_collections/editCollections.pl +++ b/rotating_collections/editCollections.pl @@ -63,7 +63,7 @@ if ( $action eq 'create' ) { } ## Delete a club or service -elsif ( $action eq 'delete' ) { +elsif ( $action eq 'cud-delete' ) { my $colId = $query->param('colId'); my ( $success, $errorCode, $errorMessage ) = DeleteCollection($colId); @@ -78,7 +78,7 @@ elsif ( $action eq 'delete' ) { } ## Edit a club or service: grab data, put in form. -elsif ( $action eq 'edit' ) { +elsif ( $action eq 'cud-edit' ) { my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection( $query->param('colId') ); $template->param( @@ -90,7 +90,7 @@ elsif ( $action eq 'edit' ) { } # Update a Club or Service -elsif ( $action eq 'update' ) { +elsif ( $action eq 'cud-update' ) { my $colId = $query->param('colId'); my $title = $query->param('title'); my $description = $query->param('description'); diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index 462ad307bc..ab19aefcef 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -37,8 +37,8 @@ my $subscriptionid = $query->param('subscriptionid'); my $issue = $query->param('issue'); my $routingid; my $ok = $query->param('ok'); -my $edit = $query->param('edit'); -my $delete = $query->param('delete'); +my $edit = $query->param('cud-edit'); +my $delete = $query->param('cud-delete'); my $dbh = C4::Context->dbh; if($delete){ diff --git a/serials/routing.pl b/serials/routing.pl index 2e3122d3b5..13f86fad35 100755 --- a/serials/routing.pl +++ b/serials/routing.pl @@ -62,14 +62,14 @@ my $subs = GetSubscription($subscriptionid); output_and_exit( $query, $cookie, $template, 'unknown_subscription') unless $subs; -if($op eq 'delete'){ +if($op eq 'cud-delete'){ delroutingmember($routingid,$subscriptionid); } -if($op eq 'add'){ +if($op eq 'cud-add'){ addroutingmember($borrowernumber,$subscriptionid); } -if($op eq 'save'){ +if($op eq 'cud-save'){ my $sth = $dbh->prepare('UPDATE serial SET routingnotes = ? WHERE subscriptionid = ?'); $sth->execute($notes,$subscriptionid); my $urldate = URI::Escape::uri_escape_utf8($date_selected); diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl index 2179b83069..93db64f105 100755 --- a/serials/serials-collection.pl +++ b/serials/serials-collection.pl @@ -110,11 +110,11 @@ my $countitems = 0; my @serialsid = $query->multi_param('serialid'); my $subscriptionid = $subscriptionid[0]; -if($op eq 'delete_confirm'){ +if($op eq 'cud-delete_confirm'){ foreach my $serialid (@serialsid){ $countitems += Koha::Serial::Items->search({serialid => $serialid})->count(); } -}elsif($op eq 'delete_confirmed'){ +}elsif($op eq 'cud-delete_confirmed'){ if($query->param('delitems') eq "Yes"){ my @itemnumbers; foreach my $serialid (@serialsid){ @@ -205,7 +205,7 @@ $template->param( callnumber => $callnumber, uc(C4::Context->preference("marcflavour")) => 1, serialsadditems => $subscriptiondescs->[0]{'serialsadditems'}, - delete => ($op eq 'delete_confirm'), + delete => ($op eq 'cud-delete_confirm'), subscriptionid => $subscriptionid, countitems => $countitems, serialnumber => scalar @serialsid, diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 060bfbb19f..6acefa5918 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -197,7 +197,7 @@ foreach my $subscriptionid (@subscriptionids) { $template->param( newserialloop => \@newserialloop ); $template->param( subscriptions => \@subscriptionloop ); -if ( $op and $op eq 'serialchangestatus' ) { +if ( $op and $op eq 'cud-serialchangestatus' ) { # Convert serialseqs to UTF-8 to prevent encoding problems foreach my $seq (@serialseqs) { diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index f8cbc572f2..0d99d43b70 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -46,7 +46,7 @@ my $sub_length; # Permission needed if it is a modification : edit_subscription # Permission needed otherwise (nothing or dup) : create_subscription my $permission = - ( $op eq 'modify' || $op eq 'modsubscription' ) ? "edit_subscription" : "create_subscription"; + ( $op eq 'cud-modify' || $op eq 'cud-modsubscription' ) ? "edit_subscription" : "create_subscription"; our ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "serials/subscription-add.tt", @@ -66,7 +66,7 @@ my $mana_url = C4::Context->config('mana_config'); $template->param( 'mana_url' => $mana_url ); my $subscriptionid = $query->param('subscriptionid'); -if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { +if ($op eq 'cud-modify' || $op eq 'dup' || $op eq 'cud-modsubscription') { $subs = GetSubscription($subscriptionid); @@ -74,7 +74,7 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { unless $subs; ## FIXME : Check rights to edit if mod. Could/Should display an error message. - if ($subs->{'cannotedit'} && $op eq 'modify'){ + if ($subs->{'cannotedit'} && $op eq 'cud-modify'){ carp "Attempt to modify subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); } @@ -84,8 +84,8 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { } my $nextexpected = GetNextExpected($subscriptionid); $nextexpected->{'isfirstissue'} = $nextexpected->{planneddate} eq $firstissuedate ; - $subs->{nextacquidate} = $nextexpected->{planneddate} if($op eq 'modify'); - unless($op eq 'modsubscription') { + $subs->{nextacquidate} = $nextexpected->{planneddate} if($op eq 'cud-modify'); + unless($op eq 'cud-modsubscription') { foreach my $length_unit (qw(numberlength weeklength monthlength)) { if ($subs->{$length_unit}) { $sub_length=$subs->{$length_unit}; @@ -99,11 +99,11 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { $op => 1, "subtype_$sub_on" => 1, sublength =>$sub_length, - history => ($op eq 'modify'), + history => ($op eq 'cud-modify'), firstacquiyear => substr($firstissuedate,0,4), ); - if($op eq 'modify') { + if($op eq 'cud-modify') { my ($serials_number) = GetSerials($subscriptionid); if($serials_number > 1) { $template->param(more_than_one_serial => 1); @@ -167,9 +167,9 @@ if ($op!~/^mod/) { $template->param( letterloop => $letters ); } -if ($op eq 'addsubscription') { +if ($op eq 'cud-addsubscription') { redirect_add_subscription(); -} elsif ($op eq 'modsubscription') { +} elsif ($op eq 'cud-modsubscription') { redirect_mod_subscription(); } else { @@ -178,7 +178,7 @@ if ($op eq 'addsubscription') { subtype => $sub_on, ); - if ( $op ne 'modsubscription' && $op ne 'dup' && $op ne 'modify' ) { + if ( $op ne 'cud-modsubscription' && $op ne 'dup' && $op ne 'cud-modify' ) { my $letters = get_letter_loop(); $template->param( letterloop => $letters ); } diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl index e8f576a209..1f2b46b3f8 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -74,7 +74,7 @@ my $itype_or_itemtype = my $query = $input->param('q'); # don't run the search if no search term ! -if ( $op eq "do_search" && $query ) { +if ( $op eq "cud-do_search" && $query ) { ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -180,7 +180,7 @@ if ( $op eq "do_search" && $query ) { to => $to, numbers => \@numbers, ); -} # end of if ($op eq "do_search" & $query) +} # end of if ($op eq "cud-do_search" & $query) else { ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -225,7 +225,7 @@ else { $template->param( itemtypeloop => \@itemtypesloop, ccodeloop => \@ccodesloop, - no_query => $op eq "do_search" ? 1 : 0, + no_query => $op eq "cud-do_search" ? 1 : 0, ); } diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index 74a0ee8aab..fbb4f8bbbb 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -50,7 +50,7 @@ if ( $op and $op eq "close" ) { # Permission needed if it is a deletion (del) : delete_subscription # Permission needed otherwise : * -my $permission = ($op eq "del") ? "delete_subscription" : "*"; +my $permission = ($op eq "cud-del") ? "delete_subscription" : "*"; my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "serials/subscription-detail.tt", @@ -69,7 +69,7 @@ $subs->{enddate} ||= GetExpirationDate($subscriptionid); my ($totalissues,@serialslist) = GetSerials($subscriptionid); $totalissues-- if $totalissues; # the -1 is to have 0 if this is a new subscription (only 1 issue) -if ($op eq 'del') { +if ($op eq 'cud-del') { if ($$subs{'cannotedit'}){ carp "Attempt to delete subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); diff --git a/serials/subscription-frequencies.pl b/serials/subscription-frequencies.pl index 86d14fccd2..138fd66878 100755 --- a/serials/subscription-frequencies.pl +++ b/serials/subscription-frequencies.pl @@ -46,11 +46,11 @@ my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { my $op = $input->param('op'); -if($op && ($op eq 'new' || $op eq 'modify')) { +if($op && ($op eq 'new' || $op eq 'cud-modify')) { my @units_loop; push @units_loop, {val => $_} for (qw/ day week month year /); - if($op eq 'modify') { + if($op eq 'cud-modify') { my $frequencyid = $input->param('frequencyid'); my $frequency = GetSubscriptionFrequency($frequencyid); foreach (@units_loop) { @@ -70,7 +70,7 @@ if($op && ($op eq 'new' || $op eq 'modify')) { exit; } -if($op && ($op eq 'savenew' || $op eq 'savemod')) { +if($op && ($op eq 'cud-savenew' || $op eq 'cud-savemod')) { my $frequency; foreach (qw/ description unit issuesperunit unitsperissue displayorder /) { $frequency->{$_} = $input->param($_); @@ -82,13 +82,13 @@ if($op && ($op eq 'savenew' || $op eq 'savemod')) { $frequency->{issuesperunit} = 1 if $frequency->{issuesperunit} < 1; $frequency->{unitsperissue} = 1 if $frequency->{issuesperunit} != 1; - if($op eq 'savemod') { + if($op eq 'cud-savemod') { $frequency->{id} = $input->param('id'); ModSubscriptionFrequency($frequency); } else { AddSubscriptionFrequency($frequency); } -} elsif($op && $op eq 'del') { +} elsif($op && $op eq 'cud-del') { my $frequencyid = $input->param('frequencyid'); if ($frequencyid) { diff --git a/serials/subscription-history.pl b/serials/subscription-history.pl index acaf307016..101ef6f07e 100755 --- a/serials/subscription-history.pl +++ b/serials/subscription-history.pl @@ -53,7 +53,7 @@ if(!defined $subscriptionid || $subscriptionid eq '') { exit; } -if($op && $op eq 'mod') { +if($op && $op eq 'cud-mod') { my $histstartdate = $input->param('histstartdate'); my $histenddate = $input->param('histenddate'); my $receivedlist = $input->param('receivedlist'); diff --git a/serials/subscription-numberpatterns.pl b/serials/subscription-numberpatterns.pl index 1669b4d66f..1c38537b32 100755 --- a/serials/subscription-numberpatterns.pl +++ b/serials/subscription-numberpatterns.pl @@ -59,7 +59,7 @@ my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { my $op = $input->param('op'); -if($op && $op eq 'savenew') { +if($op && $op eq 'cud-savenew') { my $label = $input->param('label'); my $numberpattern; foreach(@NUMBERPATTERN_FIELDS) { @@ -77,7 +77,7 @@ if($op && $op eq 'savenew') { $template->param(error_existing_numberpattern => 1); $template->param(%$numberpattern); } -} elsif ($op && $op eq 'savemod') { +} elsif ($op && $op eq 'cud-savemod') { my $id = $input->param('id'); my $label = $input->param('label'); my $numberpattern = GetSubscriptionNumberpattern($id); @@ -97,13 +97,13 @@ if($op && $op eq 'savenew') { } ModSubscriptionNumberpattern($numberpattern); } else { - $op = 'modify'; + $op = 'cud-modify'; $template->param(error_existing_numberpattern => 1); } } -if($op && ($op eq 'new' || $op eq 'modify')) { - if($op eq 'modify') { +if($op && ($op eq 'new' || $op eq 'cud-modify')) { + if($op eq 'cud-modify') { my $id = $input->param('id'); if(defined $id) { my $numberpattern = GetSubscriptionNumberpattern($id); @@ -129,7 +129,7 @@ if($op && ($op eq 'new' || $op eq 'modify')) { exit; } -if($op && $op eq 'del') { +if($op && $op eq 'cud-del') { my $id = $input->param('id'); if ($id) { my $confirm = $input->param('confirm'); diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl index 5da15363c1..e653b284df 100755 --- a/serials/subscription-renew.pl +++ b/serials/subscription-renew.pl @@ -75,7 +75,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( flagsrequired => { serials => 'renew_subscription' }, } ); -if ( $op eq "renew" ) { +if ( $op eq "cud-renew" ) { # Do not use this script with op=renew and @subscriptionids > 1! my $subscriptionid = $subscriptionids[0]; # Make sure the subscription exists diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index cb6da835f3..987e103a4d 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -220,7 +220,7 @@ if ( $op =~ /save/i ) { { letter => $letter, borrowernumber => $patron->borrowernumber, - message_transport_type => 'email' + message_transport_type => 'cud-email' } ); } @@ -253,7 +253,7 @@ if ( $op =~ /save/i ) { elsif ($op=~/add/) { #Adds suggestion Init($suggestion_ref); - $op ='save'; + $op ='cud-save'; } elsif ($op=~/edit/) { #Edit suggestion @@ -269,7 +269,7 @@ elsif ($op=~/edit/) { $other_reason = 0 unless $suggestion_ref->{reason}; $template->param(other_reason => $other_reason); Init($suggestion_ref); - $op ='save'; + $op ='cud-save'; } elsif ($op eq "update_status" ) { output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' }); @@ -308,7 +308,7 @@ elsif ($op eq "update_status" ) { &ModSuggestion($suggestion); } redirect_with_params($input); -}elsif ($op eq "delete" ) { +}elsif ($op eq "cud-delete" ) { output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' }); foreach my $delete_field (@editsuggestions) { &DelSuggestion( $borrowernumber, $delete_field,'intranet' ); @@ -341,7 +341,7 @@ elsif ( $op eq 'update_manager' ) { } redirect_with_params($input); } -elsif ( $op eq 'show' ) { +elsif ( $op eq 'cud-show' ) { $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'}); my $budget = GetBudget $$suggestion_ref{budgetid}; $$suggestion_ref{budgetname} = $$budget{budget_name}; diff --git a/tags/list.pl b/tags/list.pl index e92b3b207b..62111e0f7e 100755 --- a/tags/list.pl +++ b/tags/list.pl @@ -46,7 +46,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); -if ( $op eq "del" ) { +if ( $op eq "cud-del" ) { remove_tag($tag_id); print $query->redirect("/cgi-bin/koha/tags/list.pl?tag=$tag"); } diff --git a/tools/additional-contents.pl b/tools/additional-contents.pl index dfb96fcb00..8cfdd34ab5 100755 --- a/tools/additional-contents.pl +++ b/tools/additional-contents.pl @@ -76,7 +76,7 @@ if ( $op eq 'add_form' ) { translated_contents => $translated_contents, ); } -elsif ( $op eq 'add_validate' ) { +elsif ( $op eq 'cud-add_validate' ) { output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } ); my $location = $cgi->param('location'); my $code = $cgi->param('code'); @@ -188,7 +188,7 @@ elsif ( $op eq 'add_validate' ) { $op = 'list'; } } -elsif ( $op eq 'delete_confirmed' ) { +elsif ( $op eq 'cud-delete_confirmed' ) { output_and_exit_if_error($cgi, $cookie, $template, { check => 'csrf_token' }); my @ids = $cgi->multi_param('ids'); diff --git a/tools/automatic_item_modification_by_age.pl b/tools/automatic_item_modification_by_age.pl index ed3b84611a..59c37712b2 100755 --- a/tools/automatic_item_modification_by_age.pl +++ b/tools/automatic_item_modification_by_age.pl @@ -56,10 +56,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $op = $cgi->param('op') // 'show'; +my $op = $cgi->param('op') // 'cud-show'; my $syspref_name = q|automatic_item_modification_by_age_configuration|; -if ( $op eq 'update' ) { +if ( $op eq 'cud-update' ) { my @rules; my @unique_ids = $cgi->multi_param('unique_id'); for my $unique_id ( @unique_ids ) { @@ -96,7 +96,7 @@ if ( $op eq 'update' ) { my $syspref_content = to_json( \@rules ); C4::Context->set_preference($syspref_name, $syspref_content); - $op = 'show'; + $op = 'cud-show'; } my @messages; diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 97a9396c0e..4cccf9072d 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -47,7 +47,7 @@ my $error = $input->param('error'); my @itemnumbers = $input->multi_param('itemnumber'); my $biblionumber = $input->param('biblionumber'); my $op = $input->param('op'); -my $del = $input->param('del'); +my $del = $input->param('cud-del'); my $del_records = $input->param('del_records'); my $src = $input->param('src'); my $use_default_values = $input->param('use_default_values'); @@ -206,7 +206,7 @@ $template->param( # build screen with existing items. and "new" one #------------------------------------------------------------------------------- -if ($op eq "show"){ +if ($op eq "cud-show"){ my $filefh = $input->upload('uploadfile'); my $filecontent = $input->param('filecontent'); my ( @notfoundbarcodes, @notfounditemnumbers); @@ -295,7 +295,7 @@ if ($op eq "show"){ notfounditemnumbers => \@notfounditemnumbers ); $nextop="action" -} # -- End action="show" +} # -- End action="cud-show" if ( $display_items ) { my $items_table = diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl index a1781802b8..0ebc53df37 100755 --- a/tools/batch_delete_records.pl +++ b/tools/batch_delete_records.pl @@ -131,7 +131,7 @@ if ( $op eq 'form' ) { records => \@records, op => 'list', ); -} elsif ( $op eq 'delete' ) { +} elsif ( $op eq 'cud-delete' ) { # We want to delete selected records! my @record_ids = $input->multi_param('record_id'); diff --git a/tools/batch_extend_due_dates.pl b/tools/batch_extend_due_dates.pl index 199097ebfa..d6b0e84fc8 100755 --- a/tools/batch_extend_due_dates.pl +++ b/tools/batch_extend_due_dates.pl @@ -138,11 +138,11 @@ elsif ( $op eq 'list' ) { view => 'list', ); } else { - $op = 'modify'; + $op = 'cud-modify'; } } -if ( $op eq 'modify' ) { +if ( $op eq 'cud-modify' ) { # We want to modify selected checkouts! my $new_hard_due_date = $input->param('new_hard_due_date'); diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl index 1cbda22785..ec3b339e40 100755 --- a/tools/batch_record_modification.pl +++ b/tools/batch_record_modification.pl @@ -152,7 +152,7 @@ if ( $op eq 'form' ) { mmtid => $mmtid, view => 'list', ); -} elsif ( $op eq 'modify' ) { +} elsif ( $op eq 'cud-modify' ) { # We want to modify selected records! my @record_ids = $input->multi_param('record_id'); diff --git a/tools/csv-profiles.pl b/tools/csv-profiles.pl index 2883f71d49..1a447e44f9 100755 --- a/tools/csv-profiles.pl +++ b/tools/csv-profiles.pl @@ -65,7 +65,7 @@ if ( $op eq 'add_form' ) { $csv_profile = Koha::CsvProfiles->find($export_format_id); } $template->param( csv_profile => $csv_profile, ); -} elsif ( $op eq 'add_validate' ) { +} elsif ( $op eq 'cud-add_validate' ) { my $profile = $input->param("profile"); my $description = $input->param("description"); my $type = $input->param("type"); @@ -125,10 +125,10 @@ if ( $op eq 'add_form' ) { } } $op = 'list'; -} elsif ( $op eq 'delete_confirm' ) { +} elsif ( $op eq 'cud-delete_confirm' ) { my $csv_profile = Koha::CsvProfiles->find($export_format_id); $template->param( csv_profile => $csv_profile, ); -} elsif ( $op eq 'delete_confirmed' ) { +} elsif ( $op eq 'cud-delete_confirmed' ) { my $csv_profile = Koha::CsvProfiles->find($export_format_id); my $deleted = eval { $csv_profile->delete; }; diff --git a/tools/exceptionHolidays.pl b/tools/exceptionHolidays.pl index bdfd6d2313..42d4d6348d 100755 --- a/tools/exceptionHolidays.pl +++ b/tools/exceptionHolidays.pl @@ -85,7 +85,7 @@ sub edit_holiday { ); } } - } elsif ($showoperation eq 'edit') { + } elsif ($showoperation eq 'cud-edit') { if ( $holidaytype eq 'weekday' ) { my $isHoliday = $calendar->isHoliday( $day, $month, $year ); if ($isHoliday) { @@ -164,7 +164,7 @@ sub edit_holiday { ); } } - } elsif ($showoperation eq 'delete') { + } elsif ($showoperation eq 'cud-delete') { $calendar->delete_holiday(weekday => $weekday, day => $day, month => $month, diff --git a/tools/export.pl b/tools/export.pl index 3fc79d7a5c..0c1a8fc184 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -73,7 +73,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( my @branch = $query->multi_param("branch"); my @messages; -if ( $op eq 'export' ) { +if ( $op eq 'cud-export' ) { my $filename = $query->param('id_list_file'); if ( $filename ) { my $mimetype = $query->uploadInfo($filename)->{'Content-Type'}; @@ -85,7 +85,7 @@ if ( $op eq 'export' ) { } } -if ( $op eq "export" ) { +if ( $op eq "cud-export" ) { my $export_remove_fields = $query->param("export_remove_fields") || q||; my @biblionumbers = $query->multi_param("biblionumbers"); diff --git a/tools/letter.pl b/tools/letter.pl index 0e3ece1363..59f0ae476c 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -100,7 +100,7 @@ $template->param( action => $script_name ); -if ( $op eq 'add_validate' or $op eq 'copy_validate' ) { +if ( $op eq 'cud-add_validate' or $op eq 'cud-copy_validate' ) { add_validate(); if( $redirect eq "just_save" ){ print $input->redirect("/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=$branchcode&module=$module&code=$code&redirect=done§ion=$section&langtab=$langtab"); @@ -109,7 +109,7 @@ if ( $op eq 'add_validate' or $op eq 'copy_validate' ) { $op = q{}; # we return to the default screen for the next operation } } -if ($op eq 'copy_form') { +if ($op eq 'cud-copy_form') { my $oldbranchcode = $input->param('oldbranchcode') || q||; my $branchcode = $input->param('branchcode'); add_form($oldbranchcode, $module, $code); @@ -123,10 +123,10 @@ if ($op eq 'copy_form') { elsif ( $op eq 'add_form' ) { add_form($branchcode, $module, $code); } -elsif ( $op eq 'delete_confirm' ) { +elsif ( $op eq 'cud-delete_confirm' ) { delete_confirm($branchcode, $module, $code); } -elsif ( $op eq 'delete_confirmed' ) { +elsif ( $op eq 'cud-delete_confirmed' ) { delete_confirmed($branchcode, $module, $code); $op = q{}; # next operation is to return to default screen } diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index e74d9255ab..c36c7cb0f8 100755 --- a/tools/manage-marc-import.pl +++ b/tools/manage-marc-import.pl @@ -87,7 +87,7 @@ if ($op eq "") { } else { import_records_list($template, $import_batch_id, $offset, $results_per_page); } -} elsif ($op eq "commit-batch") { +} elsif ($op eq "cud-commit-batch") { my $frameworkcode = $input->param('framework'); my $overlay_framework = $input->param('overlay_framework'); $overlay_framework = undef if $overlay_framework eq '_USE_ORIG_'; @@ -115,7 +115,7 @@ if ($op eq "") { error => $_, }; }; -} elsif ($op eq "revert-batch") { +} elsif ($op eq "cud-revert-batch") { try { my $job_id = Koha::BackgroundJob::MARCImportRevertBatch->new->enqueue( { import_batch_id => $import_batch_id } ); @@ -135,20 +135,20 @@ if ($op eq "") { error => $_, }; }; -} elsif ($op eq "clean-batch") { +} elsif ($op eq "cud-clean-batch") { CleanBatch($import_batch_id); import_batches_list($template, $offset, $results_per_page); $template->param( did_clean => 1, import_batch_id => $import_batch_id, ); -} elsif ($op eq "delete-batch") { +} elsif ($op eq "cud-delete-batch") { DeleteBatch($import_batch_id); import_batches_list($template, $offset, $results_per_page); $template->param( did_delete => 1, ); -} elsif ($op eq "redo-matching") { +} elsif ($op eq "cud-redo-matching") { my $new_matcher_id = $input->param('new_matcher_id'); my $current_matcher_id = $input->param('current_matcher_id'); my $overlay_action = $input->param('overlay_action'); diff --git a/tools/marc_modification_templates.pl b/tools/marc_modification_templates.pl index b802d508a3..3517a8a8a0 100755 --- a/tools/marc_modification_templates.pl +++ b/tools/marc_modification_templates.pl @@ -46,7 +46,7 @@ my ($template, $loggedinuser, $cookie) flagsrequired => { tools => 'marc_modification_templates' }, }); -if ( $op eq "create_template" ) { +if ( $op eq "cud-create_template" ) { $template_id = '' unless $cgi->param('duplicate_current_template'); $template_id = AddModificationTemplate( scalar $cgi->param('template_name'), $template_id ); @@ -55,7 +55,7 @@ if ( $op eq "create_template" ) { DelModificationTemplate( $template_id ); $template_id = ''; -} elsif ( $op eq "add_action" ) { +} elsif ( $op eq "cud-add_action" ) { my $mmta_id = $cgi->param('mmta_id'); my $action = $cgi->param('action'); diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index 9eceff6402..1afaa3e21a 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -56,7 +56,7 @@ $template->param( CanUpdatePasswordExpiration => 1 ) if $logged_in_user->is_supe my $dbh = C4::Context->dbh; # Show borrower informations -if ( $op eq 'show' ) { +if ( $op eq 'cud-show' ) { my @borrowers; my @patronidnumbers; my @notfoundcardnumbers; @@ -155,7 +155,7 @@ if ( $op eq 'show' ) { attribute_code => $attr_type->code, attribute_lib => $attr_type->description, category_lib => $category_lib, - type => $attr_type->authorised_value_category ? 'select' : 'text', + type => $attr_type->authorised_value_category ? 'cud-select' : 'text', }; } @@ -206,14 +206,14 @@ if ( $op eq 'show' ) { , { name => "branchcode", - type => "select", + type => "cud-select", option => \@branches_option, mandatory => ( grep /branchcode/, @mandatoryFields ) ? 1 : 0, } , { name => "categorycode", - type => "select", + type => "cud-select", option => \@categories_option, mandatory => ( grep /categorycode/, @mandatoryFields ) ? 1 : 0, } @@ -261,7 +261,7 @@ if ( $op eq 'show' ) { } , { - name => "email", + name => "cud-email", type => "text", mandatory => ( grep /email/, @mandatoryFields ) ? 1 : 0, } @@ -280,14 +280,14 @@ if ( $op eq 'show' ) { , { name => "sort1", - type => @sort1_option ? "select" : "text", + type => @sort1_option ? "cud-select" : "text", option => \@sort1_option, mandatory => ( grep /sort1/, @mandatoryFields ) ? 1 : 0, } , { name => "sort2", - type => @sort2_option ? "select" : "text", + type => @sort2_option ? "cud-select" : "text", option => \@sort2_option, mandatory => ( grep /sort2/, @mandatoryFields ) ? 1 : 0, } @@ -338,7 +338,7 @@ if ( $op eq 'show' ) { } # Process modifications -if ( $op eq 'do' ) { +if ( $op eq 'cud-do' ) { my @disabled = $input->multi_param('disable_input'); my $infos; diff --git a/tools/overduerules.pl b/tools/overduerules.pl index 1e5d920a07..4ebc6d44f5 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -83,7 +83,7 @@ my $err=0; # save the values entered into tables my %temphash; my $input_saved = 0; -if ($op eq 'save') { +if ($op eq 'cud-save') { my @names=$input->multi_param(); my $sth_search = $dbh->prepare("SELECT count(*) AS total FROM overduerules WHERE branchcode=? AND categorycode=?"); diff --git a/tools/picture-upload.pl b/tools/picture-upload.pl index b1d09a6c88..4eff4bd9b6 100755 --- a/tools/picture-upload.pl +++ b/tools/picture-upload.pl @@ -85,7 +85,7 @@ our @counts = (); our %errors = (); # Case is important in these operational values as the template must use case to be visually pleasing! -if ( ( $op eq 'Upload' ) && ($uploadfile || $uploadfiletext) ) { +if ( ( $op eq 'cud-Upload' ) && ($uploadfile || $uploadfiletext) ) { output_and_exit( $input, $cookie, $template, 'wrong_csrf_token' ) unless Koha::Token->new->check_csrf({ @@ -185,7 +185,7 @@ if ( ( $op eq 'Upload' ) && ($uploadfile || $uploadfiletext) ) { if $borrowernumber; } } -elsif ( ( $op eq 'Upload' ) && !$uploadfile ) { +elsif ( ( $op eq 'cud-Upload' ) && !$uploadfile ) { warn "Problem uploading file or no file uploaded."; $template->param( cardnumber => $cardnumber ); $template->param( filetype => $filetype ); diff --git a/tools/quotes.pl b/tools/quotes.pl index b45f55ea16..e6c83d51b2 100755 --- a/tools/quotes.pl +++ b/tools/quotes.pl @@ -43,7 +43,7 @@ my @messages; if ( $op eq 'add_form' ) { $template->param( quote => Koha::Quotes->find($id), ); } -elsif ( $op eq 'add_validate' ) { +elsif ( $op eq 'cud-add_validate' ) { my @fields = qw( source text diff --git a/tools/scheduler.pl b/tools/scheduler.pl index fa4aa516e0..d9568d90ea 100755 --- a/tools/scheduler.pl +++ b/tools/scheduler.pl @@ -78,7 +78,7 @@ if ( $mode eq 'job_add' ) { $format = undef; } } - my $email = $input->param('email'); + my $email = $input->param('cud-email'); if ($email) { my $is_valid = Koha::Email->is_valid($email); if ( !$is_valid ) { @@ -104,7 +104,7 @@ if ( $mode eq 'job_add' ) { if ( $mode eq 'job_change' ) { my $jobid = $input->param('jobid'); - if ( $input->param('delete') ) { + if ( $input->param('cud-delete') ) { remove_at_job($jobid); } } diff --git a/tools/stockrotation.pl b/tools/stockrotation.pl index 3bce9a679b..992cf71086 100755 --- a/tools/stockrotation.pl +++ b/tools/stockrotation.pl @@ -119,7 +119,7 @@ if (!defined $op) { # Return to rotas page print $input->redirect('stockrotation.pl'); -} elsif ($op eq 'process_rota') { +} elsif ($op eq 'cud-process_rota') { # Get a hashref of the submitted rota data my $rota = get_rota_from_form(); @@ -257,7 +257,7 @@ if (!defined $op) { # Return to the stages list print $input->redirect("?op=manage_stages&rota_id=$rota_id"); -} elsif ($op eq 'process_stage') { +} elsif ($op eq 'cud-process_stage') { # Get a hashref of the submitted stage data my $stage = get_stage_from_form(); @@ -338,7 +338,7 @@ if (!defined $op) { # Return to the items list print $input->redirect("?op=manage_items&rota_id=".$params{rota_id}); -} elsif ($op eq 'add_items_to_rota') { +} elsif ($op eq 'cud-add_items_to_rota') { # The item's barcode, # which we may or may not have been passed @@ -415,7 +415,7 @@ if (!defined $op) { } -} elsif ($op eq 'move_items_to_rota') { +} elsif ($op eq 'cud-move_items_to_rota') { # The barcodes of the items we're moving my @move = $input->multi_param('move_item'); diff --git a/tools/upload.pl b/tools/upload.pl index 509e99bb00..b6c637bc5f 100755 --- a/tools/upload.pl +++ b/tools/upload.pl @@ -59,7 +59,7 @@ if ( $op eq 'new' ) { ); output_html_with_http_headers $input, $cookie, $template->output; -} elsif ( $op eq 'browse' ) { +} elsif ( $op eq 'cud-browse' ) { my $uploads; if ($browsecategory){ $uploads = Koha::UploadedFiles->search({ @@ -76,7 +76,7 @@ if ( $op eq 'new' ) { ); output_html_with_http_headers $input, $cookie, $template->output; -} elsif ( $op eq 'search' ) { +} elsif ( $op eq 'cud-search' ) { my $uploads; if( $id ) { # might be a comma separated list my @id = split /,/, $id; @@ -100,7 +100,7 @@ if ( $op eq 'new' ) { ); output_html_with_http_headers $input, $cookie, $template->output; -} elsif ( $op eq 'delete' ) { +} elsif ( $op eq 'cud-delete' ) { # delete only takes the id parameter my $rec = Koha::UploadedFiles->find($id); undef $rec if $rec && $plugin && !$rec->public; diff --git a/tools/viewlog.pl b/tools/viewlog.pl index 9db4e430ed..dc9b662f10 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -44,7 +44,7 @@ plugin that shows stats my $input = CGI->new; -my $do_it = $input->param('do_it'); +my $do_it = $input->param('cud-do_it'); my @modules = $input->multi_param("modules"); my $user = $input->param("user") // ''; my @actions = $input->multi_param("actions"); diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index e50f3c3cd3..87a43e9118 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -50,7 +50,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $shelfid = $query->param('shelfid'); -my $to_address = $query->param('email'); +my $to_address = $query->param('cud-email'); my $shelf = Koha::Virtualshelves->find($shelfid); @@ -95,7 +95,7 @@ if ($to_address) { tables => { borrowers => $borrowernumber, }, - message_transport_type => 'email', + message_transport_type => 'cud-email', loops => \%loops, substitute => \%substitute, ); @@ -109,7 +109,7 @@ if ($to_address) { my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, - message_transport_type => 'email', + message_transport_type => 'cud-email', borrowernumber => $patron->borrowernumber, to_address => $to_address, reply_address => $user_email, diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index a4a6e41ec7..c48325cc6b 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -63,7 +63,7 @@ my ( $shelf, $shelfnumber, @messages, $allow_transfer ); if ( $op eq 'add_form' ) { # Only pass default $shelf = { allow_change_from_owner => 1 }; -} elsif ( $op eq 'edit_form' ) { +} elsif ( $op eq 'cud-edit_form' ) { $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); @@ -78,7 +78,7 @@ if ( $op eq 'add_form' ) { } else { push @messages, { type => 'alert', code => 'does_not_exist' }; } -} elsif ( $op eq 'add' ) { +} elsif ( $op eq 'cud-add' ) { output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); my $allow_changes_from = $query->param('allow_changes_from'); eval { @@ -105,7 +105,7 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'message', code => 'success_on_insert' }; $op = 'view'; } -} elsif ( $op eq 'edit' ) { +} elsif ( $op eq 'cud-edit' ) { output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); @@ -127,7 +127,7 @@ if ( $op eq 'add_form' ) { if ($@) { push @messages, { type => 'alert', code => 'error_on_update' }; - $op = 'edit_form'; + $op = 'cud-edit_form'; } else { push @messages, { type => 'message', code => 'success_on_update' }; } @@ -137,7 +137,7 @@ if ( $op eq 'add_form' ) { } else { push @messages, { type => 'alert', code => 'does_not_exist' }; } -} elsif ( $op eq 'delete' ) { +} elsif ( $op eq 'cud-delete' ) { output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); @@ -156,7 +156,7 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'alert', code => 'does_not_exist' }; } $op = 'list'; -} elsif ( $op eq 'add_biblio' ) { +} elsif ( $op eq 'cud-add_biblio' ) { output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); @@ -213,7 +213,7 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'alert', code => 'does_not_exist' }; } $op = $referer; -} elsif ( $op eq 'remove_biblios' ) { +} elsif ( $op eq 'cud-remove_biblios' ) { output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber); @@ -242,7 +242,7 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'alert', code => 'does_not_exist' }; } $op = $referer; -} elsif ( $op eq 'transfer' ) { +} elsif ( $op eq 'cud-transfer' ) { $shelfnumber = $query->param('shelfnumber'); $shelf = Koha::Virtualshelves->find($shelfnumber) if $shelfnumber; my $new_owner = $query->param('new_owner'); # is a borrowernumber -- 2.39.5