@@ -, +, @@ - use $MODULE qw( $subroutine list ); --- C4/Accounts.pm | 7 +- C4/Acquisition.pm | 108 +++++++------ C4/Auth.pm | 36 ++--- C4/Auth_with_cas.pm | 7 +- C4/Auth_with_ldap.pm | 12 +- C4/Auth_with_shibboleth.pm | 12 +- C4/AuthoritiesMarc.pm | 66 ++++---- C4/AuthoritiesMarc/MARC21.pm | 1 - C4/BackgroundJob.pm | 2 +- C4/Barcodes.pm | 9 +- C4/Barcodes/EAN13.pm | 4 +- C4/Barcodes/annual.pm | 4 +- C4/Barcodes/hbyymmincr.pm | 2 +- C4/Biblio.pm | 32 ++-- C4/Breeding.pm | 15 +- C4/Budgets.pm | 99 ++++++------ C4/Calendar.pm | 4 +- C4/Charset.pm | 11 +- C4/Circulation.pm | 150 ++++++++---------- C4/ClassSortRoutine.pm | 18 +-- C4/ClassSortRoutine/Dewey.pm | 2 +- C4/ClassSortRoutine/Generic.pm | 2 +- C4/ClassSortRoutine/LCC.pm | 2 +- C4/ClassSource.pm | 29 ++-- C4/ClassSplitRoutine.pm | 3 +- C4/Context.pm | 5 +- C4/Contract.pm | 16 +- C4/CourseReserves.pm | 37 +++-- C4/Creators.pm | 18 ++- C4/Creators/Lib.pm | 2 +- C4/Creators/PDF.pm | 35 +++- C4/Creators/Profile.pm | 2 +- C4/Creators/Template.pm | 4 +- C4/External/BakerTaylor.pm | 13 +- C4/External/OverDrive.pm | 2 +- C4/External/Syndetics.pm | 19 ++- C4/Heading.pm | 4 +- C4/Heading/MARC21.pm | 1 - C4/Heading/UNIMARC.pm | 1 - C4/HoldsQueue.pm | 23 ++- C4/ILSDI/Services.pm | 14 +- C4/ImportBatch.pm | 121 +++++++------- C4/ImportExportFramework.pm | 17 +- C4/InstallAuth.pm | 19 ++- C4/Installer.pm | 4 +- C4/Installer/PerlModules.pm | 3 +- C4/Installer/UpgradeBackup.pm | 6 +- C4/ItemCirculationAlertPreference.pm | 2 +- C4/Items.pm | 22 +-- C4/Koha.pm | 53 ++++--- C4/Labels/Label.pm | 7 +- C4/Languages.pm | 16 +- C4/Letters.pm | 35 ++-- C4/Linker.pm | 1 - C4/Linker/Default.pm | 1 - C4/Linker/FirstMatch.pm | 1 - C4/Linker/LastMatch.pm | 1 - C4/Log.pm | 3 +- C4/MarcModificationTemplates.pm | 37 +++-- C4/Matcher.pm | 9 +- C4/Members.pm | 40 ++--- C4/Members/Statistics.pm | 11 +- C4/Message.pm | 6 +- C4/OAI/Sets.pm | 8 +- C4/Output.pm | 23 +-- C4/Output/JSONStream.pm | 2 +- C4/Overdues.pm | 43 +++-- C4/Patroncards.pm | 11 +- C4/Patroncards/Patroncard.pm | 10 +- C4/Record.pm | 31 ++-- C4/Reports.pm | 4 +- C4/Reports/Guided.pm | 18 ++- C4/Reserves.pm | 80 +++++----- C4/Ris.pm | 6 +- C4/RotatingCollections.pm | 6 +- C4/SIP/ILS.pm | 2 +- C4/SIP/ILS/Item.pm | 4 +- C4/SIP/ILS/Transaction/Checkin.pm | 4 +- C4/SIP/ILS/Transaction/Checkout.pm | 4 +- C4/SIP/ILS/Transaction/Hold.pm | 6 +- C4/SIP/ILS/Transaction/Renew.pm | 2 +- C4/SIP/ILS/Transaction/RenewAll.pm | 2 +- C4/SIP/SIPServer.pm | 2 +- C4/SIP/Sip.pm | 2 +- C4/Scheduler.pm | 9 +- C4/Scrubber.pm | 2 +- C4/Search.pm | 43 ++--- C4/Search/History.pm | 7 +- C4/Search/PazPar2.pm | 2 +- C4/Serials.pm | 73 +++++---- C4/Serials/Frequency.pm | 12 +- C4/Serials/Numberpattern.pm | 16 +- C4/Service.pm | 2 +- C4/ShelfBrowser.pm | 15 +- C4/SocialData.pm | 2 +- C4/Stats.pm | 10 +- C4/Suggestions.pm | 3 +- C4/Tags.pm | 37 ++--- C4/Templates.pm | 7 +- C4/TmplTokenType.pm | 31 ++-- C4/UsageStats.pm | 4 +- C4/Utils/DataTables/Members.pm | 4 +- C4/Utils/DataTables/VirtualShelves.pm | 2 +- C4/XISBN.pm | 20 ++- C4/XSLT.pm | 17 +- Koha/Account.pm | 6 +- Koha/Account/CreditType.pm | 1 - Koha/Account/CreditTypes.pm | 1 - Koha/Account/DebitType.pm | 1 - Koha/Account/DebitTypes.pm | 1 - Koha/Account/Line.pm | 9 +- Koha/Account/Lines.pm | 1 - Koha/Account/Offset.pm | 1 - Koha/Account/Offsets.pm | 1 - Koha/Acquisition/Basket.pm | 2 +- Koha/Acquisition/Bookseller/Contact.pm | 1 - Koha/Acquisition/Bookseller/Contacts.pm | 1 - Koha/Acquisition/Currencies.pm | 1 - Koha/Acquisition/Currency.pm | 1 - Koha/Acquisition/Invoice/Adjustment.pm | 1 - Koha/Acquisition/Invoice/Adjustments.pm | 1 - Koha/Acquisition/Order.pm | 5 +- Koha/Acquisition/Order/Claim.pm | 1 - Koha/Acquisition/Order/Claims.pm | 1 - Koha/Acquisition/Orders.pm | 1 - Koha/AdvancedEditorMacro.pm | 1 - Koha/AdvancedEditorMacros.pm | 1 - Koha/ApiKey.pm | 1 - Koha/ApiKeys.pm | 1 - Koha/ArticleRequest.pm | 3 +- Koha/ArticleRequests.pm | 1 - Koha/AudioAlert.pm | 1 - Koha/AudioAlerts.pm | 1 - Koha/AuthUtils.pm | 17 +- Koha/AuthorisedValue.pm | 1 - Koha/AuthorisedValueCategories.pm | 1 - Koha/AuthorisedValueCategory.pm | 1 - Koha/AuthorisedValues.pm | 1 - Koha/Authorities.pm | 1 - Koha/Authority/MergeRequests.pm | 3 +- Koha/Authority/Type.pm | 1 - Koha/Authority/Types.pm | 1 - Koha/BackgroundJob.pm | 4 +- Koha/BackgroundJob/BatchUpdateAuthority.pm | 4 +- Koha/BackgroundJob/BatchUpdateBiblio.pm | 2 +- Koha/Biblio.pm | 8 +- Koha/Biblio/Metadatas.pm | 1 - Koha/BiblioFramework.pm | 1 - Koha/BiblioFrameworks.pm | 1 - Koha/BiblioUtils.pm | 3 +- Koha/BiblioUtils/Iterator.pm | 4 +- Koha/Biblioitem.pm | 1 - Koha/Biblioitems.pm | 1 - Koha/Biblios.pm | 1 - Koha/Cache.pm | 4 +- Koha/Cache/Object.pm | 1 - Koha/Calendar.pm | 2 +- Koha/Cash/Register.pm | 1 - Koha/Cash/Register/Action.pm | 1 - Koha/Cash/Register/Actions.pm | 1 - Koha/Cash/Register/Cashup.pm | 1 - Koha/Cash/Register/Cashups.pm | 1 - Koha/Cash/Registers.pm | 1 - Koha/Charges/Fees.pm | 2 +- Koha/Checkout.pm | 7 +- Koha/Checkouts.pm | 5 +- Koha/Checkouts/ReturnClaims.pm | 1 - Koha/CirculationRules.pm | 2 +- Koha/Cities.pm | 1 - Koha/City.pm | 1 - Koha/ClassSortRule.pm | 1 - Koha/ClassSortRules.pm | 1 - Koha/ClassSource.pm | 1 - Koha/ClassSources.pm | 1 - Koha/ClassSplitRule.pm | 2 +- Koha/Club.pm | 1 - Koha/Club/Enrollment.pm | 3 +- Koha/Club/Enrollment/Field.pm | 1 - Koha/Club/Enrollment/Fields.pm | 1 - Koha/Club/Enrollments.pm | 1 - Koha/Club/Field.pm | 1 - Koha/Club/Fields.pm | 1 - Koha/Club/Hold.pm | 3 +- Koha/Club/Hold/PatronHold.pm | 1 - Koha/Club/Hold/PatronHolds.pm | 1 - Koha/Club/Holds.pm | 1 - Koha/Club/Template.pm | 1 - Koha/Club/Template/EnrollmentField.pm | 1 - Koha/Club/Template/EnrollmentFields.pm | 1 - Koha/Club/Template/Field.pm | 1 - Koha/Club/Template/Fields.pm | 1 - Koha/Club/Templates.pm | 1 - Koha/Clubs.pm | 1 - Koha/Config.pm | 2 +- Koha/Config/SysPref.pm | 1 - Koha/Config/SysPrefs.pm | 1 - Koha/Course.pm | 1 - Koha/Course/Instructor.pm | 1 - Koha/Course/Instructors.pm | 1 - Koha/Course/Item.pm | 1 - Koha/Course/Items.pm | 1 - Koha/Course/Reserve.pm | 1 - Koha/Course/Reserves.pm | 1 - Koha/Courses.pm | 1 - Koha/CoverImage.pm | 1 - Koha/CoverImages.pm | 1 - Koha/CsvProfile.pm | 1 - Koha/CsvProfiles.pm | 1 - Koha/Database.pm | 1 - Koha/Desk.pm | 1 - Koha/Desks.pm | 1 - Koha/EDI.pm | 32 +++- Koha/Edifact.pm | 5 +- Koha/Edifact/Line.pm | 2 +- Koha/Edifact/Order.pm | 7 +- Koha/Edifact/Transport.pm | 9 +- Koha/Email.pm | 2 +- Koha/Exporter/Record.pm | 4 +- Koha/ExternalContent.pm | 2 +- Koha/ExternalContent/OverDrive.pm | 2 +- Koha/ExternalContent/RecordedBooks.pm | 2 +- Koha/Filter/MARC/EmbedItemsAvailability.pm | 2 +- Koha/Filter/MARC/EmbedSeeFromHeadings.pm | 3 +- Koha/Filter/MARC/Null.pm | 1 - Koha/Filter/MARC/ViewPolicy.pm | 5 +- Koha/Hold.pm | 11 +- Koha/Holds.pm | 1 - Koha/I18N.pm | 13 +- Koha/Illrequest.pm | 11 +- Koha/Illrequest/Config.pm | 2 +- Koha/Illrequest/Logger.pm | 5 +- Koha/Item.pm | 10 +- Koha/Item/Search/Field.pm | 22 +-- Koha/Item/Transfer.pm | 5 +- Koha/Item/Transfer/Limit.pm | 1 - Koha/Item/Transfers.pm | 1 - Koha/ItemType.pm | 3 +- Koha/ItemTypes.pm | 1 - Koha/Items.pm | 1 - Koha/KeyboardShortcut.pm | 1 - Koha/KeyboardShortcuts.pm | 1 - Koha/Libraries.pm | 1 - Koha/Library.pm | 1 - Koha/Library/Group.pm | 3 +- Koha/Library/Groups.pm | 1 - Koha/Library/OverDriveInfo.pm | 1 - Koha/Library/OverDriveInfos.pm | 1 - Koha/Linktracker.pm | 1 - Koha/List/Patron.pm | 2 +- Koha/Logger.pm | 1 - Koha/MarcSubfieldStructure.pm | 1 - Koha/MarcSubfieldStructures.pm | 1 - Koha/MessageAttribute.pm | 1 - Koha/MessageAttributes.pm | 1 - Koha/MetaSearcher.pm | 4 +- Koha/MetadataRecord.pm | 2 +- Koha/MetadataRecord/Authority.pm | 3 +- Koha/News.pm | 1 - Koha/NewsItem.pm | 3 +- Koha/Notice/Message.pm | 1 - Koha/Notice/Messages.pm | 1 - Koha/Notice/Template.pm | 1 - Koha/Notice/Templates.pm | 1 - Koha/OAI/Server/Description.pm | 2 +- Koha/OAI/Server/GetRecord.pm | 3 +- Koha/OAI/Server/ListBase.pm | 3 +- Koha/OAI/Server/ListSets.pm | 2 +- Koha/OAI/Server/Repository.pm | 4 +- Koha/Object.pm | 6 +- Koha/Object/Limit/Library.pm | 2 +- Koha/Objects.pm | 2 +- Koha/Old/Holds.pm | 1 - Koha/Patron.pm | 9 +- Koha/Patron/Category.pm | 5 +- Koha/Patron/Discharge.pm | 6 +- Koha/Patron/Image.pm | 1 - Koha/Patron/Images.pm | 1 - Koha/Patron/Message.pm | 3 +- Koha/Patron/Messages.pm | 1 - Koha/Patron/Modification.pm | 7 +- Koha/Patron/Modifications.pm | 4 +- Koha/Patron/Password/Recovery.pm | 9 +- Koha/Patron/Relationship.pm | 3 +- Koha/Patron/Relationships.pm | 1 - Koha/Patrons.pm | 4 +- Koha/Patrons/Import.pm | 11 +- Koha/Plugins.pm | 9 +- Koha/Plugins/Base.pm | 7 +- Koha/Plugins/Handler.pm | 6 +- Koha/Plugins/Method.pm | 1 - Koha/Plugins/Methods.pm | 1 - Koha/PseudonymizedTransaction.pm | 3 +- Koha/PseudonymizedTransactions.pm | 1 - Koha/Quote.pm | 1 - Koha/Quotes.pm | 3 +- Koha/REST/Plugin/PluginRoutes.pm | 4 +- Koha/REST/Plugin/Query.pm | 6 +- Koha/REST/V1.pm | 2 +- Koha/REST/V1/Acquisitions/Funds.pm | 2 +- Koha/REST/V1/Acquisitions/Orders.pm | 6 +- Koha/REST/V1/Acquisitions/Vendors.pm | 2 +- Koha/REST/V1/AdvancedEditorMacro.pm | 2 +- Koha/REST/V1/Auth.pm | 4 +- Koha/REST/V1/Biblios.pm | 6 +- Koha/REST/V1/CashRegisters/Cashups.pm | 3 +- Koha/REST/V1/Checkouts.pm | 4 +- Koha/REST/V1/CirculationRules.pm | 1 - Koha/REST/V1/Cities.pm | 2 +- Koha/REST/V1/Clubs/Holds.pm | 8 +- Koha/REST/V1/Config/SMTP/Servers.pm | 2 +- Koha/REST/V1/Holds.pm | 9 +- Koha/REST/V1/ImportBatchProfiles.pm | 2 +- Koha/REST/V1/Items.pm | 4 +- Koha/REST/V1/Libraries.pm | 2 +- Koha/REST/V1/OAuth.pm | 2 +- Koha/REST/V1/Patrons.pm | 5 +- Koha/REST/V1/Patrons/Account.pm | 3 +- Koha/REST/V1/Patrons/Attributes.pm | 4 +- Koha/REST/V1/Patrons/Password.pm | 4 +- Koha/REST/V1/Quotes.pm | 2 +- Koha/REST/V1/ReturnClaims.pm | 3 +- Koha/REST/V1/Static.pm | 2 +- Koha/REST/V1/TransferLimits.pm | 2 +- Koha/Rating.pm | 1 - Koha/Ratings.pm | 1 - Koha/RecordProcessor.pm | 2 +- Koha/Report.pm | 2 - Koha/Reports.pm | 1 - Koha/Review.pm | 1 - Koha/Reviews.pm | 1 - Koha/SMS/Provider.pm | 1 - Koha/SMS/Providers.pm | 1 - Koha/Schema/Loader/mysql.pm | 2 +- Koha/Script.pm | 4 +- Koha/SearchEngine.pm | 2 +- Koha/SearchEngine/Elasticsearch.pm | 19 ++- Koha/SearchEngine/Elasticsearch/Indexer.pm | 7 +- .../Elasticsearch/QueryBuilder.pm | 5 +- Koha/SearchEngine/Elasticsearch/Search.pm | 4 +- Koha/SearchEngine/Indexer.pm | 1 - Koha/SearchEngine/QueryBuilder.pm | 2 +- Koha/SearchEngine/Search.pm | 4 +- Koha/SearchEngine/Zebra/Indexer.pm | 2 +- Koha/SearchEngine/Zebra/Search.pm | 4 +- Koha/SearchField.pm | 1 - Koha/SearchFields.pm | 1 - Koha/SearchMarcMap.pm | 1 - Koha/SearchMarcMaps.pm | 1 - Koha/Serial.pm | 1 - Koha/Serial/Item.pm | 1 - Koha/Serial/Items.pm | 1 - Koha/Serials.pm | 1 - Koha/SharedContent.pm | 2 +- Koha/SimpleMARC.pm | 40 ++--- Koha/Sitemapper/Writer.pm | 2 +- Koha/Statistic.pm | 1 - Koha/Statistics.pm | 1 - Koha/StockRotationItem.pm | 4 +- Koha/Subscription.pm | 2 - Koha/Subscription/Frequencies.pm | 1 - Koha/Subscription/Frequency.pm | 1 - Koha/Subscription/Histories.pm | 1 - Koha/Subscription/History.pm | 1 - Koha/Subscription/Routinglist.pm | 1 - Koha/Subscription/Routinglists.pm | 1 - Koha/Subscriptions.pm | 1 - Koha/Suggestion.pm | 3 +- Koha/SuggestionEngine.pm | 2 +- Koha/SuggestionEngine/Plugin/AuthorityFile.pm | 1 - Koha/SuggestionEngine/Plugin/ExplodedTerms.pm | 1 - .../Plugin/LibrisSpellcheck.pm | 2 +- Koha/SuggestionEngine/Plugin/Null.pm | 1 - Koha/Suggestions.pm | 1 - Koha/Tag.pm | 1 - Koha/Tags.pm | 1 - Koha/Tags/Approval.pm | 1 - Koha/Tags/Approvals.pm | 1 - Koha/Tags/Index.pm | 1 - Koha/Tags/Indexes.pm | 1 - Koha/Template/Plugin/Asset.pm | 2 +- Koha/Template/Plugin/AudioAlerts.pm | 3 +- Koha/Template/Plugin/AuthorisedValues.pm | 2 +- Koha/Template/Plugin/Categories.pm | 2 +- Koha/Template/Plugin/I18N.pm | 2 +- Koha/Template/Plugin/KohaDates.pm | 2 +- Koha/Template/Plugin/KohaPlugins.pm | 2 +- Koha/Template/Plugin/To.pm | 2 +- Koha/Token.pm | 10 +- Koha/UploadedFiles.pm | 4 +- Koha/Uploader.pm | 1 - Koha/Util/FrameworkPlugin.pm | 3 +- Koha/Util/MARC.pm | 1 - Koha/Util/OpenDocument.pm | 4 +- Koha/Virtualshelf.pm | 3 +- Koha/Virtualshelfcontent.pm | 1 - Koha/Virtualshelfcontents.pm | 1 - Koha/Virtualshelfshare.pm | 3 +- Koha/Virtualshelfshares.pm | 1 - Koha/Virtualshelves.pm | 1 - Koha/XSLT/Security.pm | 1 - Koha/Z3950Responder/Session.pm | 2 +- Koha/Z3950Server.pm | 1 - Koha/Z3950Servers.pm | 1 - Koha/pdfformat/layout2pages.pm | 3 +- Koha/pdfformat/layout2pagesde.pm | 12 +- Koha/pdfformat/layout3pages.pm | 7 +- Koha/pdfformat/layout3pagesfr.pm | 2 +- about.pl | 19 +-- acqui/acqui-home.pl | 7 +- acqui/add_user_search.pl | 6 +- acqui/addorder.pl | 25 +-- acqui/addorderiso2709.pl | 28 ++-- acqui/ajax-getauthvaluedropbox.pl | 4 +- acqui/basket.pl | 21 ++- acqui/basketgroup.pl | 10 +- acqui/basketheader.pl | 8 +- acqui/booksellers.pl | 9 +- acqui/cancelorder.pl | 5 +- acqui/check_budget_total.pl | 6 +- acqui/check_uniqueness.pl | 6 +- acqui/duplicate_orders.pl | 10 +- acqui/edi_ean.pl | 5 +- acqui/edifactmsgs.pl | 7 +- acqui/edimsg.pl | 6 +- acqui/finishreceive.pl | 9 +- acqui/histsearch.pl | 9 +- acqui/invoice-files.pl | 6 +- acqui/invoice.pl | 12 +- acqui/invoices.pl | 10 +- acqui/lateorders-export.pl | 4 +- acqui/lateorders.pl | 12 +- acqui/modordernotes.pl | 6 +- acqui/neworderempty.pl | 32 ++-- acqui/newordersubscription.pl | 8 +- acqui/newordersuggestion.pl | 7 +- acqui/ordered.pl | 6 +- acqui/orderreceive.pl | 16 +- acqui/parcel.pl | 15 +- acqui/parcels.pl | 8 +- acqui/showorder.pl | 4 +- acqui/spent.pl | 6 +- acqui/supplier.pl | 7 +- acqui/transferorder.pl | 6 +- acqui/uncertainprice.pl | 7 +- acqui/updatesupplier.pl | 4 +- acqui/z3950_search.pl | 7 +- admin/add_user_search.pl | 4 +- admin/additional-fields.pl | 5 +- admin/admin-home.pl | 4 +- admin/adveditorshortcuts.pl | 6 +- admin/aqbudgetperiods.pl | 15 +- admin/aqbudgets.pl | 24 ++- admin/aqcontract.pl | 14 +- admin/aqplan.pl | 23 ++- admin/audio_alerts.pl | 4 +- admin/auth_subfields_structure.pl | 5 +- admin/auth_tag_structure.pl | 5 +- admin/authorised_values.pl | 8 +- admin/authtypes.pl | 4 +- admin/background_jobs.pl | 6 +- admin/biblio_framework.pl | 4 +- admin/branch_transfer_limits.pl | 7 +- admin/branches.pl | 6 +- admin/cash_registers.pl | 6 +- admin/categories.pl | 6 +- admin/check_budget_parent.pl | 6 +- admin/check_parent_total.pl | 6 +- admin/checkmarc.pl | 5 +- admin/cities.pl | 4 +- admin/classsources.pl | 9 +- admin/clone-rules.pl | 5 +- admin/columns_settings.pl | 4 +- admin/credit_types.pl | 6 +- admin/currency.pl | 4 +- admin/debit_types.pl | 6 +- admin/desks.pl | 4 +- admin/didyoumean.pl | 8 +- admin/edi_accounts.pl | 4 +- admin/edi_ean_accounts.pl | 4 +- admin/import_export_framework.pl | 4 +- admin/item_circulation_alerts.pl | 8 +- admin/items_search_field.pl | 4 +- admin/items_search_fields.pl | 4 +- admin/itemtypes.pl | 7 +- admin/koha2marclinks.pl | 5 +- admin/library_groups.pl | 4 +- admin/localization.pl | 4 +- admin/marc_subfields_structure.pl | 4 +- admin/marctagstructure.pl | 5 +- admin/matching-rules.pl | 5 +- admin/oai_set_mappings.pl | 7 +- admin/oai_sets.pl | 7 +- admin/overdrive.pl | 4 +- admin/patron-attr-types.pl | 7 +- admin/preferences.pl | 14 +- admin/searchengine/elasticsearch/mappings.pl | 7 +- admin/share_content.pl | 6 +- admin/smart-rules.pl | 7 +- admin/sms_providers.pl | 4 +- admin/smtp_servers.pl | 8 +- admin/sru_modmapping.pl | 4 +- admin/systempreferences.pl | 12 +- admin/transfer_limits.pl | 8 +- admin/transport-cost-matrix.pl | 8 +- admin/usage_statistics.pl | 6 +- admin/z3950servers.pl | 4 +- api/v1/app.pl | 2 +- authorities/auth_finder.pl | 6 +- authorities/authorities-home.pl | 11 +- authorities/authorities.pl | 13 +- authorities/blinddetail-biblio-search.pl | 8 +- authorities/detail-biblio-search.pl | 8 +- authorities/detail.pl | 7 +- authorities/export.pl | 4 +- authorities/merge.pl | 9 +- authorities/merge_ajax.pl | 6 +- authorities/ysearch.pl | 8 +- basket/basket.pl | 15 +- basket/downloadcart.pl | 11 +- basket/sendbasket.pl | 23 +-- catalogue/ISBDdetail.pl | 12 +- catalogue/MARCdetail.pl | 22 +-- catalogue/detail.pl | 39 +++-- catalogue/export.pl | 6 +- catalogue/getitem-ajax.pl | 10 +- catalogue/imageviewer.pl | 9 +- catalogue/issuehistory.pl | 9 +- catalogue/item-export.pl | 2 +- catalogue/itemsearch.pl | 11 +- catalogue/labeledMARCdetail.pl | 17 +- catalogue/moredetail.pl | 17 +- catalogue/search-history.pl | 4 +- catalogue/search.pl | 12 +- catalogue/showmarc.pl | 11 +- catalogue/stockrotation.pl | 10 +- catalogue/updateitem.pl | 6 +- cataloguing/addbiblio.pl | 37 +++-- cataloguing/addbooks.pl | 14 +- cataloguing/additem.pl | 38 +++-- cataloguing/editor.pl | 6 +- cataloguing/linkitem.pl | 8 +- cataloguing/merge.pl | 24 ++- cataloguing/merge_ajax.pl | 6 +- cataloguing/moveitem.pl | 9 +- cataloguing/value_builder/EXAMPLE.pl | 4 +- cataloguing/value_builder/barcode.pl | 6 +- cataloguing/value_builder/barcode_manual.pl | 4 +- cataloguing/value_builder/callnumber-KU.pl | 4 +- cataloguing/value_builder/callnumber.pl | 4 +- cataloguing/value_builder/cn_browser.pl | 7 +- cataloguing/value_builder/dateaccessioned.pl | 2 +- cataloguing/value_builder/macles.pl | 4 +- cataloguing/value_builder/marc21_field_006.pl | 4 +- cataloguing/value_builder/marc21_field_007.pl | 4 +- cataloguing/value_builder/marc21_field_008.pl | 4 +- .../marc21_field_008_authorities.pl | 4 +- .../marc21_field_008_classifications.pl | 4 +- cataloguing/value_builder/marc21_leader.pl | 4 +- .../marc21_leader_authorities.pl | 4 +- .../value_builder/marc21_linking_section.pl | 12 +- .../value_builder/normarc_field_007.pl | 4 +- .../value_builder/normarc_field_008.pl | 4 +- cataloguing/value_builder/normarc_leader.pl | 4 +- cataloguing/value_builder/stocknumberAV.pl | 4 +- cataloguing/value_builder/stocknumberam123.pl | 4 +- .../value_builder/unimarc_field_010.pl | 4 +- .../value_builder/unimarc_field_100.pl | 6 +- .../unimarc_field_100_authorities.pl | 4 +- .../value_builder/unimarc_field_105.pl | 4 +- .../value_builder/unimarc_field_106.pl | 4 +- .../value_builder/unimarc_field_110.pl | 4 +- .../value_builder/unimarc_field_115a.pl | 4 +- .../value_builder/unimarc_field_115b.pl | 4 +- .../value_builder/unimarc_field_116.pl | 4 +- .../value_builder/unimarc_field_117.pl | 4 +- .../value_builder/unimarc_field_120.pl | 4 +- .../value_builder/unimarc_field_121a.pl | 4 +- .../value_builder/unimarc_field_121b.pl | 4 +- .../value_builder/unimarc_field_122.pl | 4 +- .../value_builder/unimarc_field_123a.pl | 4 +- .../value_builder/unimarc_field_123d.pl | 4 +- .../value_builder/unimarc_field_123e.pl | 4 +- .../value_builder/unimarc_field_123f.pl | 4 +- .../value_builder/unimarc_field_123g.pl | 4 +- .../value_builder/unimarc_field_123i.pl | 4 +- .../value_builder/unimarc_field_123j.pl | 4 +- .../value_builder/unimarc_field_124.pl | 4 +- .../value_builder/unimarc_field_124a.pl | 4 +- .../value_builder/unimarc_field_124b.pl | 4 +- .../value_builder/unimarc_field_124c.pl | 4 +- .../value_builder/unimarc_field_124d.pl | 4 +- .../value_builder/unimarc_field_124e.pl | 4 +- .../value_builder/unimarc_field_124f.pl | 4 +- .../value_builder/unimarc_field_124g.pl | 4 +- .../value_builder/unimarc_field_125.pl | 4 +- .../value_builder/unimarc_field_125a.pl | 4 +- .../value_builder/unimarc_field_125b.pl | 4 +- .../value_builder/unimarc_field_126.pl | 4 +- .../value_builder/unimarc_field_126a.pl | 4 +- .../value_builder/unimarc_field_126b.pl | 4 +- .../value_builder/unimarc_field_127.pl | 4 +- .../value_builder/unimarc_field_128a.pl | 4 +- .../value_builder/unimarc_field_128b.pl | 4 +- .../value_builder/unimarc_field_128c.pl | 4 +- .../value_builder/unimarc_field_130.pl | 4 +- .../value_builder/unimarc_field_135a.pl | 4 +- .../value_builder/unimarc_field_140.pl | 4 +- .../value_builder/unimarc_field_141.pl | 4 +- .../value_builder/unimarc_field_210c.pl | 9 +- .../value_builder/unimarc_field_210c_bis.pl | 6 +- .../value_builder/unimarc_field_225a.pl | 7 +- .../value_builder/unimarc_field_225a_bis.pl | 4 +- .../value_builder/unimarc_field_4XX.pl | 12 +- .../value_builder/unimarc_field_686a.pl | 4 +- .../value_builder/unimarc_field_700-4.pl | 4 +- cataloguing/value_builder/unimarc_leader.pl | 4 +- cataloguing/ysearch.pl | 6 +- cataloguing/z3950_auth_search.pl | 7 +- cataloguing/z3950_search.pl | 7 +- circ/add_message.pl | 2 +- circ/article-request-slip.pl | 4 +- circ/article-requests.pl | 4 +- circ/bookcount.pl | 7 +- circ/branchoverdues.pl | 13 +- circ/branchtransfers.pl | 11 +- circ/checkout-notes.pl | 4 +- circ/circulation-home.pl | 4 +- circ/circulation.pl | 22 +-- circ/del_message.pl | 2 +- circ/hold-transfer-slip.pl | 6 +- circ/offline-mf.pl | 2 +- circ/offline.pl | 4 +- circ/on-site_checkouts.pl | 5 +- circ/overdue.pl | 6 +- circ/pendingreserves.pl | 8 +- circ/renew.pl | 9 +- circ/request-article.pl | 8 +- circ/reserveratios.pl | 7 +- circ/returns.pl | 20 ++- circ/set-library.pl | 5 +- circ/transfer-slip.pl | 6 +- circ/transfers_to_send.pl | 6 +- circ/transferstoreceive.pl | 16 +- circ/view_holdsqueue.pl | 8 +- circ/waitingreserves.pl | 20 +-- circ/ysearch.pl | 4 +- clubs/club-enrollments.pl | 4 +- clubs/clubs-add-modify.pl | 6 +- clubs/clubs.pl | 4 +- clubs/patron-clubs-tab.pl | 4 +- clubs/patron-enroll.pl | 4 +- clubs/templates-add-modify.pl | 6 +- course_reserves/add_items.pl | 9 +- course_reserves/batch_add_items.pl | 6 +- course_reserves/batch_rm_items.pl | 6 +- course_reserves/course-details.pl | 7 +- course_reserves/course-reserves.pl | 6 +- course_reserves/course.pl | 8 +- course_reserves/mod_course.pl | 4 +- .../CASProxy/examples/proxy_cas_callback.pl | 2 +- docs/CAS/CASProxy/examples/proxy_cas_data.pl | 5 +- errors/400.pl | 6 +- errors/401.pl | 6 +- errors/402.pl | 6 +- errors/403.pl | 6 +- errors/404.pl | 6 +- errors/500.pl | 6 +- help.pl | 2 +- ill/ill-requests.pl | 10 +- installer/data/mysql/backfill_statistics.pl | 4 - ...fix_unclosed_nonaccruing_fines_bug17135.pl | 6 +- installer/data/mysql/update22to30.pl | 4 +- .../html-template-to-template-toolkit.pl | 8 +- installer/install.pl | 8 +- installer/onboarding.pl | 8 +- koha_perl_deps.pl | 6 +- labels/label-create-csv.pl | 2 - labels/label-create-pdf.pl | 2 +- labels/label-create-xml.pl | 2 - labels/label-edit-batch.pl | 6 +- labels/label-edit-layout.pl | 13 +- labels/label-edit-profile.pl | 6 +- labels/label-edit-range.pl | 4 +- labels/label-edit-template.pl | 6 +- labels/label-home.pl | 4 +- labels/label-item-search.pl | 15 +- labels/label-manage.pl | 13 +- labels/label-print.pl | 11 +- labels/spinelabel-home.pl | 4 +- labels/spinelabel-print.pl | 4 +- lib/CGI/Session/Serialize/yamlxs.pm | 2 +- mainpage.pl | 6 +- members/accountline-details.pl | 4 +- members/apikeys.pl | 4 +- members/boraccount.pl | 6 +- members/cancel-charge.pl | 2 +- members/deletemem.pl | 9 +- members/discharge.pl | 7 +- members/discharges.pl | 4 +- members/files.pl | 5 +- members/guarantor_search.pl | 4 +- members/holdshistory.pl | 4 +- members/housebound.pl | 6 +- members/ill-requests.pl | 4 +- members/mancredit.pl | 5 +- members/maninvoice.pl | 9 +- members/member-flags.pl | 8 +- members/member-password.pl | 10 +- members/member.pl | 7 +- members/memberentry.pl | 16 +- members/members-home.pl | 6 +- members/members-update-do.pl | 2 +- members/members-update.pl | 4 +- members/merge-patrons.pl | 6 +- members/mod_debarment.pl | 6 +- members/moremember.pl | 9 +- members/notices.pl | 4 +- members/pay.pl | 8 +- members/paycollect.pl | 9 +- members/print_overdues.pl | 6 +- members/printfeercpt.pl | 4 +- members/printinvoice.pl | 4 +- members/printslip.pl | 8 +- members/purchase-suggestions.pl | 6 +- members/readingrec.pl | 10 +- members/routing-lists.pl | 4 +- members/setstatus.pl | 2 +- members/statistics.pl | 10 +- members/summary-print.pl | 7 +- members/update-child.pl | 4 +- misc/add_date_fields_to_marc_records.pl | 6 +- misc/admin/set_password.pl | 4 +- misc/background_jobs_worker.pl | 4 +- misc/batchCompareMARCvsFrameworks.pl | 5 +- misc/batchDeleteUnusedSubfields.pl | 9 +- misc/batchImportMARCWithBiblionumbers.pl | 9 +- misc/batchRebuildBiblioTables.pl | 11 +- misc/batchRebuildItemsTables.pl | 10 +- misc/batchRepairMissingBiblionumbers.pl | 4 +- misc/batchdeletebiblios.pl | 7 +- misc/bin/connexion_import_daemon.pl | 12 +- misc/check_sysprefs.pl | 2 +- misc/commit_file.pl | 6 +- misc/cronjobs/advance_notices.pl | 12 +- misc/cronjobs/archive_purchase_suggestions.pl | 6 +- misc/cronjobs/automatic_checkin.pl | 2 +- .../automatic_item_modification_by_age.pl | 6 +- misc/cronjobs/automatic_renewals.pl | 8 +- misc/cronjobs/batch_anonymise.pl | 12 +- misc/cronjobs/build_browser_and_cloud.pl | 2 +- misc/cronjobs/cart_to_shelf.pl | 8 +- misc/cronjobs/check-url-quick.pl | 10 +- misc/cronjobs/cleanup_database.pl | 8 +- misc/cronjobs/cloud-kw.pl | 10 +- misc/cronjobs/create_koc_db.pl | 4 +- misc/cronjobs/delete_items.pl | 6 +- misc/cronjobs/delete_patrons.pl | 10 +- misc/cronjobs/delete_records_via_leader.pl | 9 +- misc/cronjobs/edi_cron.pl | 4 +- misc/cronjobs/fines.pl | 12 +- misc/cronjobs/gather_print_notices.pl | 16 +- misc/cronjobs/holds/auto_unsuspend_holds.pl | 4 +- misc/cronjobs/holds/build_holds_queue.pl | 4 +- misc/cronjobs/holds/cancel_expired_holds.pl | 8 +- misc/cronjobs/holds/cancel_unfilled_holds.pl | 9 +- misc/cronjobs/holds/holds_reminder.pl | 11 +- misc/cronjobs/import_webservice_batch.pl | 7 +- misc/cronjobs/longoverdue.pl | 11 +- misc/cronjobs/membership_expiry.pl | 9 +- misc/cronjobs/merge_authorities.pl | 6 +- .../notice_unprocessed_suggestions.pl | 8 +- misc/cronjobs/overdue_notices.pl | 14 +- misc/cronjobs/patron_emailer.pl | 10 +- misc/cronjobs/plugins_nightly.pl | 4 +- misc/cronjobs/process_message_queue.pl | 10 +- misc/cronjobs/purge_suggestions.pl | 7 +- misc/cronjobs/reconcile_balances.pl | 10 +- misc/cronjobs/rss/rss.pl | 3 +- misc/cronjobs/runreport.pl | 18 +-- misc/cronjobs/serialsUpdate.pl | 14 +- .../share_usage_with_koha_community.pl | 8 +- misc/cronjobs/sitemap.pl | 5 +- misc/cronjobs/staticfines.pl | 16 +- misc/cronjobs/stockrotation.pl | 2 +- .../thirdparty/TalkingTech_itiva_inbound.pl | 6 +- .../thirdparty/TalkingTech_itiva_outbound.pl | 9 +- misc/cronjobs/update_patrons_category.pl | 8 +- misc/cronjobs/update_totalissues.pl | 16 +- misc/cronjobs/writeoff_debts.pl | 6 +- misc/devel/add_missing_filters.pl | 6 +- misc/devel/coverage.pl | 6 +- misc/devel/create_superlibrarian.pl | 4 +- misc/devel/get_prepared_letter.pl | 8 +- misc/devel/install_plugins.pl | 4 +- misc/devel/update_dbix_class_files.pl | 4 +- misc/export_borrowers.pl | 2 +- misc/export_records.pl | 6 +- misc/exportauth.pl | 3 +- misc/import_patrons.pl | 4 +- misc/link_bibs_to_authorities.pl | 20 ++- misc/load_testing/benchmark_circulation.pl | 3 +- misc/load_testing/benchmark_staff.pl | 7 +- misc/load_testing/benchmark_webservices.pl | 3 +- misc/load_yaml.pl | 2 +- .../UNIMARC_fix_collectiontitle.pl | 3 +- ...MARC_sync_date_created_with_marc_biblio.pl | 6 +- misc/maintenance/auth_show_hidden_data.pl | 4 +- .../borrowers-force-messaging-defaults.pl | 6 +- misc/maintenance/check_syspref_cache.pl | 4 +- misc/maintenance/cmp_sysprefs.pl | 4 +- misc/maintenance/fix_accountlines_date.pl | 7 +- .../fix_accountlines_rmdupfines_bug8253.pl | 5 +- misc/maintenance/fix_mysql_constraints.pl | 8 +- misc/maintenance/fix_tags_weight.pl | 4 +- misc/maintenance/generate_MARC21Languages.pl | 8 +- .../process_record_through_filter.pl | 3 +- .../remove_items_from_biblioitems.pl | 4 +- misc/maintenance/sanitize_records.pl | 7 +- .../search_for_data_inconsistencies.pl | 2 +- misc/maintenance/touch_all_biblios.pl | 8 +- misc/maintenance/touch_all_items.pl | 7 +- misc/maintenance/update_authorities.pl | 6 +- .../22_to_30/convert_to_utf8.pl | 2 +- .../22_to_30/export_Authorities.pl | 5 +- .../22_to_30/export_Authorities_xml.pl | 5 +- .../22_to_30/missing090field.pl | 5 +- .../22_to_30/move_marc_to_authheader.pl | 2 +- .../22_to_30/move_marc_to_biblioitems.pl | 3 +- .../22_to_30/rebuild_leader.pl | 5 +- .../22_to_30/rebuild_unimarc_100.pl | 5 +- misc/migration_tools/buildCOUNTRY.pl | 5 +- misc/migration_tools/buildEDITORS.pl | 6 +- misc/migration_tools/buildLANG.pl | 5 +- misc/migration_tools/build_oai_sets.pl | 16 +- misc/migration_tools/bulkmarcimport.pl | 27 ++-- .../migration_tools/checkNonIndexedBiblios.pl | 5 +- misc/migration_tools/create_analytical_rel.pl | 7 +- misc/migration_tools/ifla/update.pl | 8 +- misc/migration_tools/import_lexile.pl | 6 +- misc/migration_tools/koha-svc.pl | 2 +- misc/migration_tools/rebuild_zebra.pl | 12 +- .../remove_unused_authorities.pl | 2 +- .../switch_marc21_series_info.pl | 6 +- misc/migration_tools/upgradeitems.pl | 4 +- misc/mod_zebraqueue.pl | 6 +- misc/recreateIssueStatistics.pl | 4 +- misc/sax_parser_test.pl | 2 +- .../export_elasticsearch_mappings.pl | 4 +- misc/search_tools/rebuild_elasticsearch.pl | 7 +- misc/stage_file.pl | 8 +- misc/translator/LangInstaller.pm | 3 +- misc/translator/TmplTokenizer.pm | 5 - misc/translator/VerboseWarnings.pm | 30 ++-- misc/translator/tmpl_process3.pl | 5 +- misc/translator/xgettext.pl | 4 +- misc/z3950_responder.pl | 7 +- offline_circ/download.pl | 4 +- offline_circ/enqueue_koc.pl | 10 +- offline_circ/list.pl | 8 +- offline_circ/process.pl | 4 +- offline_circ/process_koc.pl | 13 +- offline_circ/service.pl | 6 +- opac/clubs/clubs-tab.pl | 4 +- opac/clubs/enroll.pl | 4 +- opac/errors/400.pl | 6 +- opac/errors/401.pl | 6 +- opac/errors/402.pl | 6 +- opac/errors/403.pl | 6 +- opac/errors/404.pl | 6 +- opac/errors/500.pl | 6 +- opac/external/overdrive/auth.pl | 3 +- opac/ilsdi.pl | 8 +- opac/maintenance.pl | 2 +- opac/opac-ISBDdetail.pl | 23 ++- opac/opac-MARCdetail.pl | 24 +-- opac/opac-account-pay-return.pl | 2 +- opac/opac-account-pay.pl | 5 +- opac/opac-account.pl | 4 +- opac/opac-addbybiblionumber.pl | 5 +- opac/opac-alert-subscribe.pl | 8 +- opac/opac-article-request-cancel.pl | 2 +- opac/opac-authorities-home.pl | 8 +- opac/opac-authoritiesdetail.pl | 9 +- opac/opac-basket.pl | 18 ++- opac/opac-blocked.pl | 4 +- opac/opac-browse.pl | 6 +- opac/opac-browser.pl | 5 +- opac/opac-course-details.pl | 7 +- opac/opac-course-reserves.pl | 6 +- opac/opac-detail.pl | 64 +++++--- opac/opac-discharge.pl | 8 +- opac/opac-downloadcart.pl | 11 +- opac/opac-downloadshelf.pl | 10 +- opac/opac-export.pl | 9 +- opac/opac-holdshistory.pl | 4 +- opac/opac-ics.pl | 7 +- opac/opac-idref.pl | 7 +- opac/opac-illrequests.pl | 4 +- opac/opac-imageviewer.pl | 5 +- opac/opac-issue-note.pl | 7 +- opac/opac-library.pl | 4 +- opac/opac-main.pl | 7 +- opac/opac-memberentry.pl | 10 +- opac/opac-messaging.pl | 7 +- opac/opac-modrequest-suspend.pl | 4 +- opac/opac-modrequest.pl | 4 +- opac/opac-mymessages.pl | 5 +- opac/opac-news-rss.pl | 5 +- opac/opac-overdrive-search.pl | 4 +- opac/opac-passwd.pl | 8 +- opac/opac-password-recovery.pl | 18 ++- opac/opac-patron-consent.pl | 6 +- opac/opac-patron-image.pl | 2 +- opac/opac-privacy.pl | 4 +- opac/opac-ratings-ajax.pl | 4 +- opac/opac-ratings.pl | 2 +- opac/opac-readingrecord.pl | 16 +- opac/opac-recordedbooks-search.pl | 4 +- opac/opac-registration-verify.pl | 4 +- opac/opac-renew.pl | 6 +- opac/opac-reportproblem.pl | 8 +- opac/opac-request-article.pl | 4 +- opac/opac-reserve.pl | 19 ++- opac/opac-restrictedpage.pl | 4 +- opac/opac-retrieve-file.pl | 4 +- opac/opac-review.pl | 8 +- opac/opac-routing-lists.pl | 4 +- opac/opac-search-history.pl | 8 +- opac/opac-search.pl | 14 +- opac/opac-sendbasket.pl | 24 +-- opac/opac-sendshelf.pl | 24 +-- opac/opac-serial-issues.pl | 8 +- opac/opac-shareshelf.pl | 5 +- opac/opac-shelves.pl | 14 +- opac/opac-showmarc.pl | 7 +- opac/opac-showreviews.pl | 18 ++- opac/opac-suggestions.pl | 19 ++- opac/opac-tags.pl | 17 +- opac/opac-tags_subject.pl | 5 +- opac/opac-topissues.pl | 9 +- opac/opac-user.pl | 28 ++-- opac/sci/sci-main.pl | 8 +- opac/sco/help.pl | 4 +- opac/sco/printslip.pl | 7 +- opac/sco/sco-main.pl | 9 +- opac/sco/sco-patron-image.pl | 2 +- opac/svc/checkout_notes | 4 +- opac/svc/shelfbrowser.pl | 6 +- opac/tracklinks.pl | 6 +- patron_lists/add-modify.pl | 6 +- patron_lists/delete.pl | 4 +- patron_lists/list.pl | 12 +- patron_lists/lists.pl | 6 +- patron_lists/patrons.pl | 6 +- patroncards/add_user_search.pl | 4 +- patroncards/create-pdf.pl | 10 +- patroncards/edit-batch.pl | 6 +- patroncards/edit-layout.pl | 15 +- patroncards/edit-profile.pl | 6 +- patroncards/edit-template.pl | 6 +- patroncards/home.pl | 4 +- patroncards/image-manage.pl | 9 +- patroncards/manage.pl | 15 +- patroncards/print.pl | 7 +- plugins/plugins-enable.pl | 2 +- plugins/plugins-home.pl | 8 +- plugins/plugins-uninstall.pl | 4 +- plugins/plugins-upload.pl | 5 +- plugins/run.pl | 4 +- pos/pay.pl | 4 +- pos/printreceipt.pl | 6 +- pos/register.pl | 6 +- pos/registers.pl | 4 +- reports/acquisitions_stats.pl | 13 +- reports/bor_issues_top.pl | 14 +- reports/borrowers_out.pl | 11 +- reports/borrowers_stats.pl | 18 +-- reports/cash_register_stats.pl | 12 +- reports/cat_issues_top.pl | 12 +- reports/catalogue_out.pl | 5 +- reports/catalogue_stats.pl | 13 +- reports/dictionary.pl | 9 +- reports/guided_reports.pl | 12 +- reports/issues_avg_stats.pl | 12 +- reports/issues_stats.pl | 13 +- reports/itemslost.pl | 7 +- reports/manager.pl | 5 +- reports/orders_by_fund.pl | 12 +- reports/reports-home.pl | 4 +- reports/reserves_stats.pl | 12 +- reports/serials_stats.pl | 9 +- reserve/modrequest.pl | 4 +- reserve/modrequest_suspendall.pl | 4 +- reserve/placerequest.pl | 9 +- reserve/request.pl | 26 ++- reviews/reviewswaiting.pl | 5 +- rotating_collections/addItems.pl | 5 +- rotating_collections/editCollections.pl | 4 +- rotating_collections/rotatingCollections.pl | 4 +- rotating_collections/transferCollection.pl | 4 +- serials/acqui-search-result.pl | 7 +- serials/acqui-search.pl | 4 +- serials/add_user_search.pl | 4 +- serials/checkexpiration.pl | 8 +- serials/claims.pl | 10 +- serials/create-numberpattern.pl | 8 +- serials/lateissues-export.pl | 3 +- serials/routing-preview.pl | 14 +- serials/routing.pl | 9 +- serials/serials-collection.pl | 10 +- serials/serials-edit.pl | 19 ++- serials/serials-home.pl | 4 +- serials/serials-search.pl | 9 +- serials/showpredictionpattern.pl | 10 +- serials/subscription-add.pl | 19 ++- serials/subscription-batchedit.pl | 8 +- serials/subscription-bib-search.pl | 10 +- serials/subscription-detail.pl | 16 +- serials/subscription-frequencies.pl | 6 +- serials/subscription-frequency.pl | 4 +- serials/subscription-history.pl | 9 +- serials/subscription-numberpattern.pl | 4 +- serials/subscription-numberpatterns.pl | 16 +- serials/subscription-renew.pl | 12 +- serials/viewalerts.pl | 4 +- services/itemrecorddisplay.pl | 6 +- suggestion/add_user_search.pl | 4 +- suggestion/suggestion.pl | 12 +- svc/authorised_values | 1 - svc/cataloguing/automatic_linker.pl | 6 +- svc/checkout_notes | 4 +- svc/creator_batches | 4 +- svc/problem_reports | 4 +- t/Acquisition/CanUserManageBasket.t | 2 +- t/Auth.t | 2 +- t/Auth_with_shibboleth.t | 2 +- t/AuthoritiesMarc_MARC21.t | 2 +- t/AuthoritiesMarc_UNIMARC.t | 2 +- t/Biblio.t | 3 +- t/Biblio/TransformHtmlToXml.t | 2 +- t/Biblio2.t | 2 +- t/Budgets/CanUserModifyBudget.t | 2 +- t/Budgets/CanUserUseBudget.t | 2 +- t/Charset.t | 2 +- t/Circulation/AgeRestrictionMarkers.t | 2 +- t/Circulation_barcodedecode.t | 2 +- t/ClassSortRoutine_Dewey.t | 2 +- t/ClassSortRoutine_Generic.t | 2 +- t/ClassSortRoutine_LCC.t | 2 +- t/Creators.t | 2 +- t/External/BakerTaylor.t | 2 +- t/ImportBatch.t | 2 +- t/Koha.t | 2 +- t/Koha/Util/MARC.t | 1 + t/Koha/sleep.pl | 2 - t/Koha/wait.pl | 2 - t/Koha_Util_MARC.t | 1 + t/Labels.t | 4 +- t/Labels_split_Regex.t | 2 +- t/Labels_split_ddcn.t | 2 +- t/Labels_split_lccn.t | 2 +- t/Languages.t | 2 +- t/Letters.t | 2 +- t/Matcher.t | 2 +- t/Members/cardnumber.t | 2 +- t/Output.t | 2 +- t/Prices.t | 2 +- t/SIP/Sip.t | 2 +- t/SMS.t | 2 +- t/Scheduler.t | 2 +- t/Scrubber.t | 6 +- t/Search/History.t | 2 +- t/Search/buildQuery.t | 2 +- t/Serials/GetNextSeq.t | 2 +- t/Serials/ModSerialStatus.t | 2 +- t/SimpleMARC.t | 2 +- t/SocialData.t | 2 +- t/TmplToken.t | 1 - t/db_dependent/Accounts.t | 2 +- t/db_dependent/Acquisition.t | 6 +- t/db_dependent/Acquisition/CancelReceipt.t | 6 +- t/db_dependent/Acquisition/GetBasketAsCSV.t | 4 +- .../Acquisition/GetBasketsInfosByBookseller.t | 4 +- .../Acquisition/GetOrdersByBiblionumber.t | 6 +- t/db_dependent/Acquisition/Invoices.t | 2 +- t/db_dependent/Acquisition/NewOrder.t | 6 +- .../Acquisition/OrderFromSubscription.t | 8 +- t/db_dependent/Acquisition/OrderUsers.t | 6 +- t/db_dependent/Acquisition/StandingOrders.t | 4 +- t/db_dependent/Acquisition/TransferOrder.t | 4 +- .../Acquisition/close_reopen_basket.t | 6 +- .../Acquisition/populate_order_with_prices.t | 2 +- t/db_dependent/Amazon.t | 2 +- t/db_dependent/Auth.t | 3 +- t/db_dependent/Auth/haspermission.t | 2 +- t/db_dependent/Auth_with_cas.t | 2 +- t/db_dependent/Auth_with_ldap.t | 2 +- t/db_dependent/AuthoritiesMarc.t | 2 +- t/db_dependent/Authority/Merge.t | 4 +- t/db_dependent/BackgroundJob.t | 4 +- t/db_dependent/Barcodes.t | 2 +- t/db_dependent/Barcodes_ValueBuilder.t | 2 +- t/db_dependent/Biblio.t | 6 +- t/db_dependent/Biblio/Isbd.t | 2 +- t/db_dependent/Biblio/ModBiblioMarc.t | 2 +- t/db_dependent/Biblio/TransformHtmlToMarc.t | 2 +- t/db_dependent/Biblio/TransformKohaToMarc.t | 2 +- t/db_dependent/Biblio/TransformMarcToKoha.t | 2 +- t/db_dependent/Budgets.t | 6 +- t/db_dependent/Charset.t | 2 +- t/db_dependent/Circulation.t | 10 +- t/db_dependent/Circulation/Branch.t | 8 +- t/db_dependent/Circulation/CalcDateDue.t | 4 +- t/db_dependent/Circulation/CalcFine.t | 2 +- .../Circulation/CheckIfIssuedToPatron.t | 4 +- .../Circulation/CheckValidBarcode.t | 6 +- t/db_dependent/Circulation/GetHardDueDate.t | 2 +- .../Circulation/GetPendingOnSiteCheckouts.t | 4 +- t/db_dependent/Circulation/GetTopIssues.t | 4 +- t/db_dependent/Circulation/IsItemIssued.t | 4 +- .../Circulation/MarkIssueReturned.t | 2 +- t/db_dependent/Circulation/OfflineOperation.t | 4 +- t/db_dependent/Circulation/ReturnClaims.t | 2 +- t/db_dependent/Circulation/Returns.t | 4 +- .../Circulation/StoreLastBorrower.t | 2 +- .../Circulation/SwitchOnSiteCheckouts.t | 2 +- t/db_dependent/Circulation/TooMany.t | 2 +- t/db_dependent/Circulation/issue.t | 6 +- t/db_dependent/Circulation/transferbook.t | 4 +- t/db_dependent/Circulation/transfers.t | 8 +- t/db_dependent/Contract.t | 2 +- t/db_dependent/CourseReserves.t | 4 +- t/db_dependent/CourseReserves/CourseItems.t | 2 +- t/db_dependent/Creators/Lib.t | 2 +- t/db_dependent/DecreaseLoanHighHolds.t | 2 +- t/db_dependent/Exporter/Record.t | 2 +- t/db_dependent/Filter_MARC_ViewPolicy.t | 2 +- t/db_dependent/Fines.t | 2 +- t/db_dependent/FrameworkPlugin.t | 4 +- t/db_dependent/Heading.t | 2 +- t/db_dependent/Heading_MARC21.t | 2 +- t/db_dependent/Hold.t | 2 +- t/db_dependent/Holds.t | 4 +- .../Holds/DisallowHoldIfItemsAvailable.t | 4 +- t/db_dependent/Holds/HoldFulfillmentPolicy.t | 2 +- t/db_dependent/Holds/HoldItemtypeLimit.t | 2 +- t/db_dependent/Holds/LocalHoldsPriority.t | 4 +- t/db_dependent/Holds/RevertWaitingStatus.t | 2 +- t/db_dependent/Holds/WaitingReserves.t | 4 +- t/db_dependent/HoldsQueue.t | 8 +- t/db_dependent/Holidays.t | 2 +- t/db_dependent/ILSDI_Services.t | 4 +- t/db_dependent/Illrequests.t | 2 +- t/db_dependent/ImportBatch.t | 2 +- t/db_dependent/ImportExportFramework.t | 2 +- t/db_dependent/Installer.t | 2 +- t/db_dependent/Items.t | 4 +- .../Items/AutomaticItemModificationByAge.t | 4 +- t/db_dependent/Items/GetHostItemsInfo.t | 2 +- t/db_dependent/Items/GetItemsForInventory.t | 6 +- t/db_dependent/Items/MoveItemFromBiblio.t | 2 +- t/db_dependent/Koha.t | 2 +- t/db_dependent/Koha/Account/Line.t | 2 +- t/db_dependent/Koha/Acquisition/Basket.t | 2 +- t/db_dependent/Koha/Acquisition/Booksellers.t | 8 +- t/db_dependent/Koha/Acquisition/Order.t | 2 +- t/db_dependent/Koha/ActionLogs.t | 2 +- t/db_dependent/Koha/Authorities.t | 2 +- t/db_dependent/Koha/Biblio.t | 2 +- t/db_dependent/Koha/Biblio/Metadata.t | 2 +- t/db_dependent/Koha/Biblios.t | 4 +- t/db_dependent/Koha/Charges/Fees.t | 2 +- t/db_dependent/Koha/Checkouts.t | 2 +- t/db_dependent/Koha/Club/Enrollment.t | 2 +- t/db_dependent/Koha/Filter/EmbedItems.t | 2 +- .../Koha/Filter/EmbedItemsAvailability.t | 2 +- t/db_dependent/Koha/Holds.t | 4 +- t/db_dependent/Koha/Item.t | 4 +- t/db_dependent/Koha/ItemTypes.t | 2 +- t/db_dependent/Koha/Items.t | 2 +- t/db_dependent/Koha/Object.t | 4 +- t/db_dependent/Koha/Patron/Category.t | 2 +- t/db_dependent/Koha/Patrons.t | 4 +- .../Koha/Plugins/Circulation_hooks.t | 2 +- t/db_dependent/Koha/Plugins/Holds_hooks.t | 2 +- t/db_dependent/Koha/Pseudonymization.t | 4 +- t/db_dependent/Koha/SearchEngine/Indexer.t | 8 +- t/db_dependent/Koha/Statistics.t | 2 +- t/db_dependent/Koha/Z3950Responder/Session.t | 2 +- t/db_dependent/Koha/Z3950Responder/Session2.t | 2 +- t/db_dependent/Koha_Authority.t | 4 +- .../Koha_ExternalContent_RecordedBooks.t | 2 +- t/db_dependent/Labels/t_Batch.t | 6 +- t/db_dependent/Languages.t | 2 +- t/db_dependent/Letters.t | 8 +- .../Letters/GetLettersAvailableForALibrary.t | 2 +- t/db_dependent/Letters/TemplateToolkit.t | 6 +- t/db_dependent/LibraryGroups.t | 2 +- t/db_dependent/Linker_Default.t | 4 +- t/db_dependent/Linker_FirstMatch.t | 2 +- t/db_dependent/Log.t | 4 +- t/db_dependent/MarcModificationTemplates.t | 2 +- t/db_dependent/Members.t | 2 +- t/db_dependent/Members/GetAllIssues.t | 6 +- t/db_dependent/Members/IssueSlip.t | 6 +- t/db_dependent/Members/Statistics.t | 2 +- t/db_dependent/Message.t | 2 +- t/db_dependent/MungeMarcPrice.t | 2 +- t/db_dependent/OAI/AndSets.t | 4 +- t/db_dependent/OAI/Server.t | 2 +- t/db_dependent/OAI/Sets.t | 4 +- t/db_dependent/Overdues.t | 2 +- t/db_dependent/Passwordrecovery.t | 2 +- t/db_dependent/Patron/Borrower_PrevCheckout.t | 2 +- t/db_dependent/Patron/Messages.t | 2 +- t/db_dependent/Patroncards.t | 2 +- t/db_dependent/Record.t | 2 +- t/db_dependent/Record/Record.t | 2 +- t/db_dependent/Record/marcrecord2csv.t | 6 +- t/db_dependent/Reports.t | 2 +- t/db_dependent/Reports/Guided.t | 2 +- t/db_dependent/Reserves.t | 6 +- .../Reserves/AutoUnsuspendReserves.t | 2 +- .../Reserves/CancelExpiredReserves.t | 2 +- t/db_dependent/Reserves/GetReserveFee.t | 4 +- t/db_dependent/Reserves/MultiplePerRecord.t | 2 +- t/db_dependent/RotatingCollections.t | 4 +- t/db_dependent/SIP/ILS.t | 4 +- t/db_dependent/SIP/Message.t | 2 +- t/db_dependent/SIP/SIPServer.t | 2 +- t/db_dependent/SIP/Transaction.t | 2 +- t/db_dependent/Search.t | 6 +- t/db_dependent/Search/History.t | 4 +- t/db_dependent/Serials.t | 10 +- t/db_dependent/Serials/Claims.t | 4 +- t/db_dependent/Serials/Frequency.t | 2 +- .../Serials/GetFictiveIssueNumber.t | 2 +- t/db_dependent/Serials/GetNextDate.t | 2 +- t/db_dependent/Serials/GetNextSeq.t | 2 +- t/db_dependent/Serials/Numberpattern.t | 2 +- t/db_dependent/Serials/ReNewSubscription.t | 2 +- t/db_dependent/Serials_2.t | 4 +- t/db_dependent/ShelfBrowser.t | 4 +- t/db_dependent/Stats.t | 4 +- t/db_dependent/Suggestions.t | 4 +- t/db_dependent/Tags.t | 2 +- t/db_dependent/Templates.t | 4 +- t/db_dependent/UsageStats.t | 6 +- t/db_dependent/Utils/Datatables.t | 2 +- .../Utils/Datatables_Virtualshelves.t | 2 +- t/db_dependent/XISBN.t | 6 +- t/db_dependent/XSLT.t | 2 +- t/db_dependent/api/v1/auth.t | 2 +- t/db_dependent/api/v1/checkouts.t | 2 +- t/db_dependent/api/v1/holds.t | 2 +- t/db_dependent/api/v1/return_claims.t | 2 +- t/db_dependent/rollingloans.t | 2 +- t/db_dependent/selenium/basic_workflow.t | 2 +- t/db_dependent/selenium/regressions.t | 2 +- t/db_dependent/www/regressions.t | 2 +- t/db_dependent/zebra_config.pl | 8 +- t/lib/Dates.pm | 2 +- t/lib/Koha/BackgroundJob/BatchTest.pm | 2 +- t/lib/Koha/Plugin/BadAPIRoute.pm | 2 +- t/lib/Koha/Plugin/Test.pm | 2 +- t/lib/Mocks.pm | 2 +- t/lib/Selenium.pm | 4 +- t/lib/TestBuilder.pm | 13 +- tags/list.pl | 11 +- tags/review.pl | 20 ++- tools/access_files.pl | 11 +- tools/ajax-inventory.pl | 2 +- tools/automatic_item_modification_by_age.pl | 7 +- tools/background-job-progress.pl | 3 +- tools/batchMod.pl | 28 ++-- tools/batch_delete_records.pl | 8 +- tools/batch_record_modification.pl | 11 +- tools/batch_records_ajax.pl | 7 +- tools/cleanborrowers.pl | 11 +- tools/copy-holidays.pl | 2 +- tools/csv-profiles.pl | 5 +- tools/exceptionHolidays.pl | 4 +- tools/export.pl | 8 +- tools/holidays.pl | 6 +- tools/import_borrowers.pl | 8 +- tools/inventory.pl | 19 ++- tools/koha-news.pl | 10 +- tools/letter.pl | 8 +- tools/manage-marc-import.pl | 8 +- tools/marc_modification_templates.pl | 16 +- tools/modborrowers.pl | 11 +- tools/newHolidays.pl | 4 +- tools/overduerules.pl | 7 +- tools/picture-upload.pl | 5 +- tools/problem-reports.pl | 4 +- tools/quotes-upload.pl | 5 +- tools/quotes.pl | 6 +- tools/scheduler.pl | 10 +- tools/showdiffmarc.pl | 10 +- tools/stage-marc-import.pl | 9 +- tools/stockrotation.pl | 6 +- tools/tools-home.pl | 6 +- tools/upload-cover-image.pl | 6 +- tools/upload-file.pl | 4 +- tools/upload.pl | 4 +- tools/viewlog.pl | 12 +- virtualshelves/addbybiblionumber.pl | 5 +- virtualshelves/downloadshelf.pl | 10 +- virtualshelves/sendshelf.pl | 22 ++- virtualshelves/shelves.pl | 15 +- xt/yaml_valid.pl | 2 +- 1311 files changed, 4077 insertions(+), 4362 deletions(-) --- a/C4/Accounts.pm +++ a/C4/Accounts.pm @@ -22,14 +22,11 @@ use Modern::Perl; use C4::Context; use C4::Stats; use C4::Members; -use C4::Log qw(logaction); use Koha::Account; use Koha::Account::Lines; use Koha::Account::Offsets; use Koha::Items; -use Mojo::Util qw(deprecated); -use Data::Dumper qw(Dumper); use vars qw(@ISA @EXPORT); @@ -37,8 +34,8 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &chargelostitem - &purge_zero_balance_fees + chargelostitem + purge_zero_balance_fees ); } --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -19,13 +19,13 @@ package C4::Acquisition; use Modern::Perl; -use Carp; +use Carp qw( carp croak ); use Text::CSV_XS; use C4::Context; -use C4::Suggestions; -use C4::Biblio; -use C4::Contract; -use C4::Log qw(logaction); +use C4::Suggestions qw( GetSuggestion GetSuggestionFromBiblionumber ModSuggestion ); +use C4::Biblio qw( GetMarcFromKohaField GetMarcStructure IsMarcStructureInternal ); +use C4::Contract qw( GetContract ); +use C4::Log qw( logaction ); use C4::Templates qw(gettemplate); use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Baskets; @@ -42,60 +42,58 @@ use Koha::Patrons; use C4::Koha; use MARC::Field; -use MARC::Record; -use JSON qw(to_json); +use JSON qw( to_json ); -use Time::localtime; - -use vars qw(@ISA @EXPORT); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetBasket &NewBasket &ReopenBasket &ModBasket - &GetBasketAsCSV &GetBasketGroupAsCSV - &GetBasketsByBookseller &GetBasketsByBasketgroup - &GetBasketsInfosByBookseller - - &GetBasketUsers &ModBasketUsers - &CanUserManageBasket - - &ModBasketHeader - - &ModBasketgroup &NewBasketgroup &DelBasketgroup &GetBasketgroup &CloseBasketgroup - &GetBasketgroups &ReOpenBasketgroup - - &ModOrder &GetOrder &GetOrders &GetOrdersByBiblionumber - &GetOrderFromItemnumber - &SearchOrders &GetHistory &GetRecentAcqui - &ModReceiveOrder &CancelReceipt - &TransferOrder - &ModItemOrder - - &GetParcels - - &GetInvoices - &GetInvoice - &GetInvoiceDetails - &AddInvoice - &ModInvoice - &CloseInvoice - &ReopenInvoice - &DelInvoice - &MergeInvoices - - &AddClaim - &GetBiblioCountByBasketno - - &GetOrderUsers - &ModOrderUsers - &NotifyOrderUsers - - &FillWithDefaultValues - - &get_rounded_price - &get_rounding_sql + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetBasket NewBasket ReopenBasket ModBasket + GetBasketAsCSV GetBasketGroupAsCSV + GetBasketsByBookseller GetBasketsByBasketgroup + GetBasketsInfosByBookseller + + GetBasketUsers ModBasketUsers + CanUserManageBasket + + ModBasketHeader + + ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroup CloseBasketgroup + GetBasketgroups ReOpenBasketgroup + + ModOrder GetOrder GetOrders GetOrdersByBiblionumber + GetOrderFromItemnumber + SearchOrders GetHistory GetRecentAcqui + ModReceiveOrder CancelReceipt + populate_order_with_prices + TransferOrder + ModItemOrder + + GetParcels + + GetInvoices + GetInvoice + GetInvoiceDetails + AddInvoice + ModInvoice + CloseInvoice + ReopenInvoice + DelInvoice + MergeInvoices + + AddClaim + GetBiblioCountByBasketno + + GetOrderUsers + ModOrderUsers + NotifyOrderUsers + + FillWithDefaultValues + + get_rounded_price + get_rounding_sql ); } --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -19,14 +19,11 @@ package C4::Auth; use strict; use warnings; -use Carp qw/croak/; +use Carp qw( croak ); -use Digest::MD5 qw(md5_base64); -use JSON qw/encode_json/; -use URI::Escape; +use Digest::MD5 qw( md5_base64 ); use CGI::Session; -require Exporter; use C4::Context; use C4::Templates; # to get the template use C4::Languages; @@ -34,25 +31,25 @@ use C4::Search::History; use Koha; use Koha::Logger; use Koha::Caches; -use Koha::AuthUtils qw(get_script_name hash_password); +use Koha::AuthUtils qw( get_script_name hash_password ); use Koha::Checkouts; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Library::Groups; use Koha::Libraries; use Koha::Cash::Registers; use Koha::Desks; use Koha::Patrons; use Koha::Patron::Consents; -use POSIX qw/strftime/; -use List::MoreUtils qw/ any /; -use Encode qw( encode is_utf8); -use C4::Auth_with_shibboleth; +use List::MoreUtils qw( any ); +use Encode; +use C4::Auth_with_shibboleth qw( shib_ok get_login_shib login_shib_url logout_shib checkpw_shib ); use Net::CIDR; -use C4::Log qw/logaction/; +use C4::Log qw( logaction ); # use utf8; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $ldap $cas $caslogout); +use vars qw($ldap $cas $caslogout); +our (@ISA, @EXPORT_OK); BEGIN { sub psgi_env { any { /^psgi\./ } keys %ENV } @@ -63,12 +60,15 @@ BEGIN { C4::Context->set_remote_address; - @ISA = qw(Exporter); - @EXPORT = qw(&checkauth &get_template_and_user &haspermission &get_user_subpermissions); - @EXPORT_OK = qw(&check_api_auth &get_session &check_cookie_auth &checkpw &checkpw_internal &checkpw_hash - &get_all_subpermissions &get_user_subpermissions track_login_daily &in_iprange + require Exporter; + @ISA = qw(Exporter); + + @EXPORT_OK = qw( + checkauth check_api_auth get_session check_cookie_auth checkpw checkpw_internal checkpw_hash + get_all_subpermissions get_user_subpermissions track_login_daily in_iprange + get_template_and_user haspermission ); - %EXPORT_TAGS = ( EditPermissions => [qw(get_all_subpermissions get_user_subpermissions)] ); + $ldap = C4::Context->config('useldapserver') || 0; $cas = C4::Context->preference('casAuthentication'); $caslogout = C4::Context->preference('casLogout'); --- a/C4/Auth_with_cas.pm +++ a/C4/Auth_with_cas.pm @@ -21,20 +21,19 @@ use strict; use warnings; use C4::Context; -use Koha::AuthUtils qw(get_script_name); +use Koha::AuthUtils qw( get_script_name ); use Authen::CAS::Client; use CGI qw ( -utf8 ); -use FindBin; use YAML::XS; use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url logout_if_required); + @EXPORT_OK = qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url logout_if_required); } my $defaultcasserver; my $casservers; --- a/C4/Auth_with_ldap.pm +++ a/C4/Auth_with_ldap.pm @@ -18,23 +18,21 @@ package C4::Auth_with_ldap; # along with Koha; if not, see . use Modern::Perl; -use Carp; +use Carp qw( croak ); use C4::Context; use C4::Members::Messaging; -use C4::Auth qw(checkpw_internal); +use C4::Auth qw( checkpw_internal ); use Koha::Patrons; -use Koha::AuthUtils qw(hash_password); -use List::MoreUtils qw( any ); +use Koha::AuthUtils qw( hash_password ); use Net::LDAP; use Net::LDAP::Filter; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( checkpw_ldap ); + @EXPORT_OK = qw( checkpw_ldap ); } # Redefine checkpw_ldap: --- a/C4/Auth_with_shibboleth.pm +++ a/C4/Auth_with_shibboleth.pm @@ -20,22 +20,20 @@ package C4::Auth_with_shibboleth; use Modern::Perl; use C4::Context; -use Koha::AuthUtils qw(get_script_name); +use Koha::AuthUtils qw( get_script_name ); use Koha::Database; use Koha::Patrons; use C4::Members::Messaging; -use Carp; -use CGI; -use List::MoreUtils qw(any); +use Carp qw( carp ); +use List::MoreUtils qw( any ); use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = + @EXPORT_OK = qw(shib_ok logout_shib login_shib_url checkpw_shib get_login_shib); } --- a/C4/AuthoritiesMarc.pm +++ a/C4/AuthoritiesMarc.pm @@ -21,13 +21,12 @@ package C4::AuthoritiesMarc; use strict; use warnings; use C4::Context; -use MARC::Record; -use C4::Biblio; -use C4::Search; +use C4::Biblio qw( GetFrameworkCode GetMarcBiblio ModBiblio ); +use C4::Search qw( FindDuplicate new_record_from_zebra ); use C4::AuthoritiesMarc::MARC21; use C4::AuthoritiesMarc::UNIMARC; -use C4::Charset; -use C4::Log; +use C4::Charset qw( SetUTF8Flag ); +use C4::Log qw( logaction ); use Koha::MetadataRecord::Authority; use Koha::Authorities; use Koha::Authority::MergeRequests; @@ -38,35 +37,38 @@ use Koha::SearchEngine; use Koha::SearchEngine::Indexer; use Koha::SearchEngine::Search; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetTagsLabels - &GetAuthMARCFromKohaField - - &AddAuthority - &ModAuthority - &DelAuthority - &GetAuthority - &GetAuthorityXML - - &SearchAuthorities - - &BuildSummary - &BuildAuthHierarchies - &BuildAuthHierarchy - &GenerateHierarchy - - &merge - &FindDuplicateAuthority - - &GuessAuthTypeCode - &GuessAuthId - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetTagsLabels + GetAuthMARCFromKohaField + + AddAuthority + ModAuthority + DelAuthority + GetAuthority + GetAuthorityXML + + SearchAuthorities + + BuildSummary + BuildAuthHierarchies + BuildAuthHierarchy + GenerateHierarchy + GetHeaderAuthority + AddAuthorityTrees + CompareFieldWithAuthority + + merge + FindDuplicateAuthority + + GuessAuthTypeCode + GuessAuthId + compare_fields + ); } --- a/C4/AuthoritiesMarc/MARC21.pm +++ a/C4/AuthoritiesMarc/MARC21.pm @@ -18,7 +18,6 @@ package C4::AuthoritiesMarc::MARC21; # along with Koha; if not, see . use Modern::Perl; -use MARC::Record; =head1 NAME --- a/C4/BackgroundJob.pm +++ a/C4/BackgroundJob.pm @@ -20,7 +20,7 @@ package C4::BackgroundJob; use Modern::Perl; use C4::Context; -use C4::Auth qw/get_session/; +use C4::Auth qw( get_session ); use Digest::MD5; --- a/C4/Barcodes.pm +++ a/C4/Barcodes.pm @@ -20,7 +20,7 @@ package C4::Barcodes; use strict; use warnings; -use Carp; +use Carp qw( carp ); use C4::Context; use C4::Barcodes::hbyymmincr; @@ -28,15 +28,8 @@ use C4::Barcodes::annual; use C4::Barcodes::incremental; use C4::Barcodes::EAN13; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use vars qw($max $prefformat); -BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT_OK = qw(); -} - sub _prefformat { unless (defined $prefformat) { unless ($prefformat = C4::Context->preference('autoBarcode')) { --- a/C4/Barcodes/EAN13.pm +++ a/C4/Barcodes/EAN13.pm @@ -22,8 +22,8 @@ use warnings; use C4::Context; -use Algorithm::CheckDigits; -use Carp; +use Algorithm::CheckDigits qw( CheckDigits ); +use Carp qw( carp ); use vars qw(@ISA); --- a/C4/Barcodes/annual.pm +++ a/C4/Barcodes/annual.pm @@ -20,11 +20,11 @@ package C4::Barcodes::annual; use strict; use warnings; -use Carp; +use Carp qw( carp ); use C4::Context; -use Koha::DateUtils qw( output_pref dt_from_string ); +use Koha::DateUtils qw( dt_from_string output_pref ); use vars qw(@ISA); use vars qw($width); --- a/C4/Barcodes/hbyymmincr.pm +++ a/C4/Barcodes/hbyymmincr.pm @@ -19,7 +19,7 @@ package C4::Barcodes::hbyymmincr; use Modern::Perl; -use Carp; +use Carp qw( carp ); use C4::Context; --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -21,12 +21,12 @@ package C4::Biblio; use Modern::Perl; -use vars qw(@ISA @EXPORT); +use vars qw(@ISA @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( AddBiblio GetBiblioData GetMarcBiblio @@ -45,6 +45,7 @@ BEGIN { GetMarcQuantity GetAuthorisedValueDesc GetMarcStructure + GetMarcSubfieldStructure IsMarcStructureInternal GetMarcFromKohaField GetMarcSubfieldStructureFromKohaField @@ -54,6 +55,7 @@ BEGIN { CountItemsIssued ModBiblio ModZebra + EmbedItemsInMarcBiblio UpdateTotalIssues RemoveAllNsb DelBiblio @@ -63,35 +65,42 @@ BEGIN { TransformHtmlToMarc TransformHtmlToXml prepare_host_field + TransformMarcToKohaOneField ); # Internal functions # those functions are exported but should not be used # they are useful in a few circumstances, so they are exported, # but don't use them unless you are a core developer ;-) - push @EXPORT, qw( + push @EXPORT_OK, qw( ModBiblioMarc ); } -use Carp; -use Try::Tiny; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); -use Encode qw( decode is_utf8 ); +use Encode; use List::MoreUtils qw( uniq ); use MARC::Record; use MARC::File::USMARC; use MARC::File::XML; -use POSIX qw(strftime); -use Module::Load::Conditional qw(can_load); +use POSIX qw( strftime ); +use Module::Load::Conditional qw( can_load ); use C4::Koha; -use C4::Log; # logaction +use C4::Log qw( logaction ); # logaction use C4::Budgets; -use C4::ClassSource; -use C4::Charset; +use C4::ClassSource qw( GetClassSort ); +use C4::Charset qw( + nsb_clean + SetMarcUnicodeFlag + SetUTF8Flag + StripNonXmlChars +); use C4::Linker; use C4::OAI::Sets; +use C4::Items qw( GetHiddenItemnumbers GetMarcItem ); use Koha::Logger; use Koha::Caches; @@ -2572,7 +2581,6 @@ sub EmbedItemsInMarcBiblio { my $opachiddenitems = $opac && ( C4::Context->preference('OpacHiddenItems') !~ /^\s*$/ ); - require C4::Items; while ( my ($itemnumber) = $sth->fetchrow_array ) { next if @$itemnumbers and not grep { $_ == $itemnumber } @$itemnumbers; my $item; --- a/C4/Breeding.pm +++ a/C4/Breeding.pm @@ -22,22 +22,21 @@ use strict; use warnings; use C4::Biblio; -use C4::Koha; -use C4::Charset; +use C4::Koha qw( GetNormalizedISBN ); +use C4::Charset qw( MarcToUTF8Record SetUTF8Flag ); use MARC::File::USMARC; use MARC::Field; -use C4::ImportBatch; +use C4::ImportBatch qw( GetZ3950BatchId AddBiblioToBatch AddAuthToBatch ); use C4::AuthoritiesMarc; #GuessAuthTypeCode, FindDuplicateAuthority use C4::Languages; use Koha::Database; use Koha::XSLT::Base; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw(&BreedingSearch &Z3950Search &Z3950SearchAuth); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw(BreedingSearch Z3950Search Z3950SearchAuth); } =head1 NAME --- a/C4/Budgets.pm +++ a/C4/Budgets.pm @@ -23,54 +23,61 @@ use Koha::Database; use Koha::Patrons; use Koha::Acquisition::Invoice::Adjustments; use C4::Acquisition; -use vars qw(@ISA @EXPORT); +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - - &GetBudget - &GetBudgetByOrderNumber - &GetBudgetByCode - &GetBudgets - &BudgetsByActivity - &GetBudgetsReport - &GetBudgetReport - &GetBudgetHierarchy - &AddBudget - &ModBudget - &DelBudget - &GetBudgetSpent - &GetBudgetOrdered - &GetBudgetName - &GetPeriodsCount - GetBudgetHierarchySpent - GetBudgetHierarchyOrdered - - &GetBudgetUsers - &ModBudgetUsers - &CanUserUseBudget - &CanUserModifyBudget - - &GetBudgetPeriod - &GetBudgetPeriods - &ModBudgetPeriod - &AddBudgetPeriod - &DelBudgetPeriod - - &ModBudgetPlan - - &GetBudgetsPlanCell - &AddBudgetPlanValue - &GetBudgetAuthCats - &BudgetHasChildren - &CheckBudgetParent - &CheckBudgetParentPerm - - &HideCols - &GetCols - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + + GetBudget + GetBudgetByOrderNumber + GetBudgetByCode + GetBudgets + BudgetsByActivity + GetBudgetsReport + GetBudgetReport + GetBudgetsByActivity + GetBudgetHierarchy + AddBudget + ModBudget + DelBudget + GetBudgetSpent + GetBudgetOrdered + GetBudgetName + GetPeriodsCount + GetBudgetHierarchySpent + GetBudgetHierarchyOrdered + + GetBudgetUsers + ModBudgetUsers + CanUserUseBudget + CanUserModifyBudget + + GetBudgetPeriod + GetBudgetPeriods + ModBudgetPeriod + AddBudgetPeriod + DelBudgetPeriod + + ModBudgetPlan + + GetBudgetsPlanCell + AddBudgetPlanValue + GetBudgetAuthCats + BudgetHasChildren + GetBudgetChildren + SetOwnerToFundHierarchy + CheckBudgetParent + CheckBudgetParentPerm + + HideCols + GetCols + + CloneBudgetPeriod + CloneBudgetHierarchy + MoveOrders + ); } # ----------------------------BUDGETS.PM-----------------------------"; --- a/C4/Calendar.pm +++ a/C4/Calendar.pm @@ -19,8 +19,8 @@ use strict; use warnings; use vars qw(@EXPORT); -use Carp; -use Date::Calc qw( Date_to_Days Today); +use Carp qw( croak ); +use Date::Calc qw( Today ); use C4::Context; use Koha::Caches; --- a/C4/Charset.pm +++ a/C4/Charset.pm @@ -19,19 +19,18 @@ package C4::Charset; use Modern::Perl; -use MARC::Charset qw/marc8_to_utf8/; +use MARC::Charset; use Text::Iconv; -use Unicode::Normalize; -use Encode qw( decode encode is_utf8 ); +use Unicode::Normalize qw( NFC NFD ); +use Encode; use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( NormalizeString IsStringUTF8ish MarcToUTF8Record --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -24,32 +24,31 @@ use POSIX qw( floor ); use YAML::XS; use Encode; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use C4::Context; -use C4::Stats; -use C4::Reserves; -use C4::Biblio; -use C4::Items; -use C4::Members; +use C4::Stats qw( UpdateStats ); +use C4::Reserves qw( CheckReserves CanItemBeReserved MoveReserve ModReserve ModReserveMinusPriority RevertWaitingStatus IsItemOnHoldAndFound IsAvailableForItemLevelRequest ); +use C4::Biblio qw( UpdateTotalIssues ); +use C4::Items qw( ModItemTransfer ModDateLastSeen CartToShelf ); use C4::Accounts; use C4::ItemCirculationAlertPreference; use C4::Message; -use C4::Log; # logaction -use C4::Overdues qw(CalcFine UpdateFine get_chargeable_units); +use C4::Log qw( logaction ); # logaction +use C4::Overdues; use C4::RotatingCollections qw(GetCollectionItemBranches); -use Algorithm::CheckDigits; +use Algorithm::CheckDigits qw( CheckDigits ); -use Data::Dumper; +use Data::Dumper qw( Dumper ); use Koha::Account; use Koha::AuthorisedValues; use Koha::Biblioitems; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Calendar; use Koha::Checkouts; use Koha::Illrequests; use Koha::Items; use Koha::Patrons; -use Koha::Patron::Debarments; +use Koha::Patron::Debarments qw( DelUniqueDebarment GetDebarments ); use Koha::Database; use Koha::Libraries; use Koha::Account::Lines; @@ -62,77 +61,68 @@ use Koha::Config::SysPref; use Koha::Checkouts::ReturnClaims; use Koha::SearchEngine::Indexer; use Koha::Exceptions::Checkout; -use Carp; -use List::MoreUtils qw( uniq any ); +use Carp qw( carp ); +use List::MoreUtils qw( any ); use Scalar::Util qw( looks_like_number ); -use Try::Tiny; -use Date::Calc qw( - Today - Today_and_Now - Add_Delta_YM - Add_Delta_DHMS - Date_to_Days - Day_of_Week - Add_Delta_Days -); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +use Date::Calc qw( Date_to_Days ); +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - - # FIXME subs that should probably be elsewhere - push @EXPORT, qw( - &barcodedecode - &LostItem - &ReturnLostItem - &GetPendingOnSiteCheckouts - ); - - # subs to deal with issuing a book - push @EXPORT, qw( - &CanBookBeIssued - &CanBookBeRenewed - &AddIssue - &AddRenewal - &GetRenewCount - &GetSoonestRenewDate - &GetLatestAutoRenewDate - &GetIssuingCharges - &GetBranchBorrowerCircRule - &GetBranchItemRule - &GetOpenIssue - &CheckIfIssuedToPatron - &IsItemIssued - GetTopIssues - ); - - # subs to deal with returns - push @EXPORT, qw( - &AddReturn - &MarkIssueReturned - ); - - # subs to deal with transfers - push @EXPORT, qw( - &transferbook - &GetTransfers - &GetTransfersFromTo - &updateWrongTransfer - &IsBranchTransferAllowed - &CreateBranchTransferLimit - &DeleteBranchTransferLimits - &TransferSlip - ); - - # subs to deal with offline circulation - push @EXPORT, qw( - &GetOfflineOperations - &GetOfflineOperation - &AddOfflineOperation - &DeleteOfflineOperation - &ProcessOfflineOperation + + require Exporter; + @ISA = qw(Exporter); + + # FIXME subs that should probably be elsewhere + push @EXPORT_OK, qw( + barcodedecode + LostItem + ReturnLostItem + GetPendingOnSiteCheckouts + + CanBookBeIssued + checkHighHolds + CanBookBeRenewed + AddIssue + GetLoanLength + GetHardDueDate + AddRenewal + GetRenewCount + GetSoonestRenewDate + GetLatestAutoRenewDate + GetIssuingCharges + AddIssuingCharge + GetBranchBorrowerCircRule + GetBranchItemRule + GetBiblioIssues + GetOpenIssue + GetUpcomingDueIssues + CheckIfIssuedToPatron + IsItemIssued + GetAgeRestriction + GetTopIssues + + AddReturn + MarkIssueReturned + + transferbook + TooMany + GetTransfers + GetTransfersFromTo + updateWrongTransfer + CalcDateDue + CheckValidBarcode + IsBranchTransferAllowed + CreateBranchTransferLimit + DeleteBranchTransferLimits + TransferSlip + + GetOfflineOperations + GetOfflineOperation + AddOfflineOperation + DeleteOfflineOperation + ProcessOfflineOperation + ProcessOfflinePayment ); + push @EXPORT_OK, '_GetCircControlBranch'; # This is wrong! } =head1 NAME --- a/C4/ClassSortRoutine.pm +++ a/C4/ClassSortRoutine.pm @@ -20,12 +20,18 @@ package C4::ClassSortRoutine; use strict; use warnings; -require Exporter; use Class::Factory::Util; use C4::Context; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetSortRoutineNames + GetClassSortKey + ); +} =head1 NAME @@ -40,12 +46,6 @@ use C4::ClassSortRoutine; =cut -@ISA = qw(Exporter); -@EXPORT = qw( - &GetSortRoutineNames - &GetClassSortKey -); - # initialization code my %loaded_routines = (); my @sort_routines = GetSortRoutineNames(); --- a/C4/ClassSortRoutine/Dewey.pm +++ a/C4/ClassSortRoutine/Dewey.pm @@ -28,7 +28,7 @@ C4::ClassSortRoutine::Dewey - generic call number sorting key routine =head1 SYNOPSIS -use C4::ClassSortRoutine; +use C4::ClassSortRoutine qw( GetClassSortKey ); my $cn_sort = GetClassSortKey('Dewey', $cn_class, $cn_item); --- a/C4/ClassSortRoutine/Generic.pm +++ a/C4/ClassSortRoutine/Generic.pm @@ -28,7 +28,7 @@ C4::ClassSortRoutine::Generic - generic call number sorting key routine =head1 SYNOPSIS -use C4::ClassSortRoutine; +use C4::ClassSortRoutine qw( GetClassSortKey ); my $cn_sort = GetClassSortKey('Generic', $cn_class, $cn_item); --- a/C4/ClassSortRoutine/LCC.pm +++ a/C4/ClassSortRoutine/LCC.pm @@ -30,7 +30,7 @@ C4::ClassSortRoutine::LCC - generic call number sorting key routine =head1 SYNOPSIS -use C4::ClassSortRoutine; +use C4::ClassSortRoutine qw( GetClassSortKey ); my $cn_sort = GetClassSortKey('LCC', $cn_class, $cn_item); --- a/C4/ClassSource.pm +++ a/C4/ClassSource.pm @@ -20,12 +20,20 @@ package C4::ClassSource; use strict; use warnings; -require Exporter; use C4::Context; -use C4::ClassSortRoutine; - -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +use C4::ClassSortRoutine qw( GetClassSortKey ); + +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetClassSources + GetClassSource + GetClassSortRule + GetClassSort + ); +} =head1 NAME @@ -44,17 +52,6 @@ sources and sorting rules. =cut - -@ISA = qw(Exporter); -@EXPORT = qw( - &GetClassSources - &GetClassSource - &GetClassSortRule - - &GetClassSort - -); - =head2 GetClassSources my $sources = GetClassSources(); --- a/C4/ClassSplitRoutine.pm +++ a/C4/ClassSplitRoutine.pm @@ -20,7 +20,6 @@ package C4::ClassSplitRoutine; use Modern::Perl; require Exporter; -use Class::Factory::Util; use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -39,7 +38,7 @@ use C4::ClassSplitRoutine; @ISA = qw(Exporter); @EXPORT = qw( - &GetSplitRoutineNames + GetSplitRoutineNames ); =head2 GetSplitRoutineNames --- a/C4/Context.pm +++ a/C4/Context.pm @@ -35,12 +35,11 @@ BEGIN { } }; -use Carp; +use Carp qw( carp ); use DateTime::TimeZone; use Encode; use File::Spec; -use Module::Load::Conditional qw(can_load); -use POSIX (); +use POSIX; use YAML::XS; use ZOOM; --- a/C4/Contract.pm +++ a/C4/Contract.pm @@ -25,14 +25,14 @@ use vars qw(@ISA @EXPORT); BEGIN { require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetContracts - &GetContract - &AddContract - &ModContract - &DelContract - ); + @ISA = qw(Exporter); + @EXPORT = qw( + GetContracts + GetContract + AddContract + ModContract + DelContract + ); } =head1 NAME --- a/C4/CourseReserves.pm +++ a/C4/CourseReserves.pm @@ -17,43 +17,42 @@ package C4::CourseReserves; use Modern::Perl; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); use C4::Context; -use C4::Circulation qw(GetOpenIssue); +use C4::Circulation qw( GetOpenIssue ); use Koha::Courses; use Koha::Course::Instructors; use Koha::Course::Items; use Koha::Course::Reserves; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS @FIELDS); - +use vars qw(@FIELDS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw( - &GetCourse - &ModCourse - &GetCourses - &DelCourse + GetCourse + ModCourse + GetCourses + DelCourse - &GetCourseInstructors - &ModCourseInstructors + GetCourseInstructors + ModCourseInstructors - &GetCourseItem - &ModCourseItem + GetCourseItem + ModCourseItem - &GetCourseReserve - &ModCourseReserve - &GetCourseReserves - &DelCourseReserve + GetCourseReserve + ModCourseReserve + GetCourseReserves + DelCourseReserve - &SearchCourses + SearchCourses - &GetItemCourseReservesInfo + GetItemCourseReservesInfo ); - %EXPORT_TAGS = ( 'all' => \@EXPORT_OK ); @FIELDS = ( 'itype', 'ccode', 'homebranch', 'holdingbranch', 'location' ); } --- a/C4/Creators.pm +++ a/C4/Creators.pm @@ -38,7 +38,23 @@ BEGIN { get_unit_values html_table ); - use C4::Creators::Lib; + use C4::Creators::Lib qw( + get_all_image_names + get_all_layouts + get_all_profiles + get_all_templates + get_barcode_types + get_batch_summary + get_card_summary + get_font_types + get_label_summary + get_label_types + get_output_formats + get_table_names + get_text_justification_types + get_unit_values + html_table +); use C4::Creators::PDF; } --- a/C4/Creators/Lib.pm +++ a/C4/Creators/Lib.pm @@ -18,7 +18,7 @@ package C4::Creators::Lib; # along with Koha; if not, see . use Modern::Perl; -use Storable qw(dclone); +use Storable qw( dclone ); use autouse 'Data::Dumper' => qw(Dumper); --- a/C4/Creators/PDF.pm +++ a/C4/Creators/PDF.pm @@ -19,10 +19,41 @@ package C4::Creators::PDF; use strict; use warnings; -use PDF::Reuse; +use PDF::Reuse qw( + prAdd + prAltJpeg + prBookmark + prCompress + prDoc + prDocDir + prDocForm + prEnd + prExtract + prField + prFile + prFont + prFontSize + prForm + prGetLogBuffer + prGraphState + prImage + prInit + prInitVars + prJpeg + prJs + prLink + prLog + prLogDir + prMbox + prPage + prSinglePage + prStrWidth + prText + prTTFont +); use PDF::Reuse::Barcode; use File::Temp; -use List::Util qw/first/; +use List::Util qw( first ); sub _InitVars { --- a/C4/Creators/Profile.pm +++ a/C4/Creators/Profile.pm @@ -6,7 +6,7 @@ use warnings; use autouse 'Data::Dumper' => qw(Dumper); use C4::Context; -use C4::Creators::Lib qw(get_unit_values); +use C4::Creators::Lib qw( get_unit_values ); sub _check_params { --- a/C4/Creators/Template.pm +++ a/C4/Creators/Template.pm @@ -2,12 +2,12 @@ package C4::Creators::Template; use strict; use warnings; -use POSIX qw(ceil); +use POSIX qw( ceil ); use autouse 'Data::Dumper' => qw(Dumper); use C4::Context; use C4::Creators::Profile; -use C4::Creators::Lib qw(get_unit_values); +use C4::Creators::Lib qw( get_unit_values ); sub _check_params { --- a/C4/External/BakerTaylor.pm +++ a/C4/External/BakerTaylor.pm @@ -19,21 +19,20 @@ package C4::External::BakerTaylor; # along with Koha; if not, see . use XML::Simple; -use LWP::Simple; -use HTTP::Request::Common; +use LWP::Simple qw( get ); use C4::Context; use Modern::Perl; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION); +use vars qw(%EXPORT_TAGS $VERSION); +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); + require Exporter; + @ISA = qw(Exporter); $VERSION = 3.07.00.049; - @EXPORT_OK = qw(&availability &content_cafe &image_url &link_url &http_jacket_link); - %EXPORT_TAGS = (all=>\@EXPORT_OK); + @EXPORT_OK = qw(availability content_cafe_url image_url link_url http_jacket_link); } # These variables are plack safe: they are initialized each time --- a/C4/External/OverDrive.pm +++ a/C4/External/OverDrive.pm @@ -21,7 +21,7 @@ use strict; use warnings; use Koha; -use JSON; +use JSON qw( from_json ); use Koha::Caches; use HTTP::Request; use HTTP::Request::Common; --- a/C4/External/Syndetics.pm +++ a/C4/External/Syndetics.pm @@ -17,11 +17,10 @@ package C4::External::Syndetics; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use XML::Simple; +use XML::Simple qw( XMLout ); use XML::LibXML; -use LWP::Simple; +use LWP::Simple qw( $ua ); use LWP::UserAgent; -use HTTP::Request::Common; use strict; use warnings; @@ -32,13 +31,13 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &get_syndetics_index - &get_syndetics_summary - &get_syndetics_toc - &get_syndetics_editions - &get_syndetics_excerpt - &get_syndetics_reviews - &get_syndetics_anotes + get_syndetics_index + get_syndetics_summary + get_syndetics_toc + get_syndetics_editions + get_syndetics_excerpt + get_syndetics_reviews + get_syndetics_anotes ); } --- a/C4/Heading.pm +++ a/C4/Heading.pm @@ -19,11 +19,9 @@ package C4::Heading; use Modern::Perl; -use MARC::Record; use MARC::Field; use C4::Context; -use Module::Load; -use Carp; +use Module::Load qw( load ); =head1 NAME --- a/C4/Heading/MARC21.pm +++ a/C4/Heading/MARC21.pm @@ -19,7 +19,6 @@ package C4::Heading::MARC21; use strict; use warnings; -use MARC::Record; use MARC::Field; --- a/C4/Heading/UNIMARC.pm +++ a/C4/Heading/UNIMARC.pm @@ -20,7 +20,6 @@ package C4::Heading::UNIMARC; use 5.010; use strict; use warnings; -use MARC::Record; use MARC::Field; use C4::Context; --- a/C4/HoldsQueue.pm +++ a/C4/HoldsQueue.pm @@ -24,29 +24,26 @@ use warnings; use C4::Context; use C4::Search; -use C4::Items; -use C4::Circulation; -use C4::Members; -use C4::Biblio; -use Koha::DateUtils; +use C4::Circulation qw( GetTransfers GetBranchItemRule ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::Patrons; use Koha::Libraries; -use List::Util qw(shuffle); -use List::MoreUtils qw(any); -use Data::Dumper; +use List::Util qw( shuffle ); +use List::MoreUtils qw( any ); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw( - &CreateQueue - &GetHoldsQueueItems + CreateQueue + GetHoldsQueueItems - &TransportCostMatrix - &UpdateTransportCostMatrix + TransportCostMatrix + UpdateTransportCostMatrix + GetPendingHoldRequestsForBib ); } --- a/C4/ILSDI/Services.pm +++ a/C4/ILSDI/Services.pm @@ -21,19 +21,17 @@ use strict; use warnings; use C4::Members; -use C4::Items; -use C4::Circulation; +use C4::Items qw( get_hostitemnumbers_of ); +use C4::Circulation qw( CanBookBeRenewed barcodedecode CanBookBeIssued AddRenewal ); use C4::Accounts; -use C4::Biblio; -use C4::Reserves qw(AddReserve CanBookBeReserved CanItemBeReserved IsAvailableForItemLevelRequest); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Reserves qw( CanBookBeReserved IsAvailableForItemLevelRequest CalculatePriority AddReserve CanItemBeReserved ); use C4::Context; -use C4::AuthoritiesMarc; -use XML::Simple; -use HTML::Entities; +use C4::Auth; use CGI qw ( -utf8 ); use DateTime; use C4::Auth; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Biblios; use Koha::Checkouts; --- a/C4/ImportBatch.pm +++ a/C4/ImportBatch.pm @@ -21,67 +21,78 @@ use strict; use warnings; use C4::Context; -use C4::Koha; -use C4::Biblio; -use C4::Items; -use C4::Charset; +use C4::Koha qw( GetNormalizedISBN ); +use C4::Biblio qw( + AddBiblio + DelBiblio + GetMarcFromKohaField + GetXmlBiblio + ModBiblio + TransformMarcToKoha +); +use C4::Items qw( AddItemFromMarc ModItemFromMarc ); +use C4::Charset qw( MarcToUTF8Record SetUTF8Flag StripNonXmlChars ); use C4::AuthoritiesMarc; -use C4::MarcModificationTemplates; +use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); use Koha::Items; use Koha::Plugins::Handler; use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - GetZ3950BatchId - GetWebserviceBatchId - GetImportRecordMarc - GetImportRecordMarcXML - AddImportBatch - GetImportBatch - AddAuthToBatch - AddBiblioToBatch - AddItemsToImportBiblio - ModAuthorityInBatch - ModBiblioInBatch - - BatchStageMarcRecords - BatchFindDuplicates - BatchCommitRecords - BatchRevertRecords - CleanBatch - DeleteBatch - - GetAllImportBatches - GetStagedWebserviceBatches - GetImportBatchRangeDesc - GetNumberOfNonZ3950ImportBatches - GetImportBiblios - GetImportRecordsRange - GetItemNumbersFromImportBatch - - GetImportBatchStatus - SetImportBatchStatus - GetImportBatchOverlayAction - SetImportBatchOverlayAction - GetImportBatchNoMatchAction - SetImportBatchNoMatchAction - GetImportBatchItemAction - SetImportBatchItemAction - GetImportBatchMatcher - SetImportBatchMatcher - GetImportRecordOverlayStatus - SetImportRecordOverlayStatus - GetImportRecordStatus - SetImportRecordStatus - SetMatchedBiblionumber - GetImportRecordMatches - SetImportRecordMatches - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetZ3950BatchId + GetWebserviceBatchId + GetImportRecordMarc + GetImportRecordMarcXML + GetRecordFromImportBiblio + AddImportBatch + GetImportBatch + AddAuthToBatch + AddBiblioToBatch + AddItemsToImportBiblio + ModAuthorityInBatch + ModBiblioInBatch + + BatchStageMarcRecords + BatchFindDuplicates + BatchCommitRecords + BatchRevertRecords + CleanBatch + DeleteBatch + + GetAllImportBatches + GetStagedWebserviceBatches + GetImportBatchRangeDesc + GetNumberOfNonZ3950ImportBatches + GetImportBiblios + GetImportRecordsRange + GetItemNumbersFromImportBatch + + GetImportBatchStatus + SetImportBatchStatus + GetImportBatchOverlayAction + SetImportBatchOverlayAction + GetImportBatchNoMatchAction + SetImportBatchNoMatchAction + GetImportBatchItemAction + SetImportBatchItemAction + GetImportBatchMatcher + SetImportBatchMatcher + GetImportRecordOverlayStatus + SetImportRecordOverlayStatus + GetImportRecordStatus + SetImportRecordStatus + SetMatchedBiblionumber + GetImportRecordMatches + SetImportRecordMatches + + RecordsFromMARCXMLFile + RecordsFromISO2709File + RecordsFromMarcPlugin + ); } =head1 NAME --- a/C4/ImportExportFramework.pm +++ a/C4/ImportExportFramework.pm @@ -21,23 +21,22 @@ use strict; use warnings; use XML::LibXML; use XML::LibXML::XPathContext; -use Digest::MD5 qw(); -use POSIX qw(strftime); +use Digest::MD5; +use POSIX qw( strftime ); use Text::CSV_XS; -use List::MoreUtils qw(indexes); +use List::MoreUtils qw( indexes ); use C4::Context; use Koha::Logger; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &ExportFramework - &ImportFramework - &createODS + @EXPORT_OK = qw( + ExportFramework + ImportFramework + createODS ); } --- a/C4/InstallAuth.pm +++ a/C4/InstallAuth.pm @@ -18,24 +18,23 @@ package C4::InstallAuth; # along with Koha; if not, see . use Modern::Perl; -use Digest::MD5 qw(md5_base64); use CGI::Session; use File::Spec; require Exporter; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Templates; -use C4::Koha; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - -@ISA = qw(Exporter); -@EXPORT = qw( - &checkauth - &get_template_and_user -); +our (@ISA, @EXPORT_OK); +BEGIN { + @ISA = qw(Exporter); + @EXPORT_OK = qw( + checkauth + get_template_and_user + ); +} =head1 NAME --- a/C4/Installer.pm +++ a/C4/Installer.pm @@ -19,7 +19,7 @@ package C4::Installer; use Modern::Perl; -use Encode qw( encode is_utf8 ); +use Encode; use DBIx::RunSQL; use YAML::XS; use C4::Context; @@ -30,7 +30,7 @@ use vars qw(@ISA @EXPORT); BEGIN { require Exporter; @ISA = qw( Exporter ); - push @EXPORT, qw( primary_key_exists foreign_key_exists index_exists column_exists TableExists); + push @EXPORT, qw( primary_key_exists foreign_key_exists index_exists column_exists TableExists marc_framework_sql_list); }; =head1 NAME --- a/C4/Installer/PerlModules.pm +++ a/C4/Installer/PerlModules.pm @@ -3,8 +3,7 @@ package C4::Installer::PerlModules; use warnings; use strict; -use File::Spec; -use File::Basename; +use File::Basename qw( dirname ); use Module::CPANfile; sub new { --- a/C4/Installer/UpgradeBackup.pm +++ a/C4/Installer/UpgradeBackup.pm @@ -18,10 +18,10 @@ package C4::Installer::UpgradeBackup; # along with Koha; if not, see . use Modern::Perl; -use File::Compare qw(compare); -use Cwd qw(cwd); +use File::Compare qw( compare ); +use Cwd qw( cwd ); use File::Copy; -use File::Find; +use File::Find qw( find ); use File::Spec; use Exporter; --- a/C4/ItemCirculationAlertPreference.pm +++ a/C4/ItemCirculationAlertPreference.pm @@ -20,7 +20,7 @@ package C4::ItemCirculationAlertPreference; use strict; use warnings; use C4::Context; -use Carp qw(carp croak); +use Carp qw( carp croak ); use Koha::ItemTypes; use Koha::Patron::Categories; --- a/C4/Items.pm +++ a/C4/Items.pm @@ -20,12 +20,12 @@ package C4::Items; use Modern::Perl; -use vars qw(@ISA @EXPORT); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( AddItemFromMarc AddItemBatchFromMarc ModItemFromMarc @@ -39,30 +39,30 @@ BEGIN { GetHostItemsInfo get_hostitemnumbers_of GetHiddenItemnumbers + GetMarcItem MoveItemFromBiblio CartToShelf GetAnalyticsCount SearchItems PrepareItemrecordDisplay + ToggleNewStatus ); } -use Carp; -use Try::Tiny; +use Carp qw( croak ); use C4::Context; use C4::Koha; -use C4::Biblio; -use Koha::DateUtils; +use C4::Biblio qw( GetMarcStructure TransformMarcToKoha ); +use Koha::DateUtils qw( dt_from_string output_pref ); use MARC::Record; -use C4::ClassSource; -use C4::Log; -use List::MoreUtils qw(any); +use C4::ClassSource qw( GetClassSort GetClassSources GetClassSource ); +use C4::Log qw( logaction ); +use List::MoreUtils qw( any ); use DateTime::Format::MySQL; -use Data::Dumper; # used as part of logging item record changes, not just for # debugging; so please don't remove this use Koha::AuthorisedValues; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::Biblioitems; --- a/C4/Koha.pm +++ a/C4/Koha.pm @@ -30,34 +30,35 @@ use Koha::MarcSubfieldStructures; use Business::ISBN; use Business::ISSN; use autouse 'Data::cselectall_arrayref' => qw(Dumper); -use vars qw(@ISA @EXPORT @EXPORT_OK); +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetItemTypesCategorized - &getallthemes - &getFacets - &getnbpages - &getitemtypeimagedir - &getitemtypeimagesrc - &getitemtypeimagelocation - &GetAuthorisedValues - &GetNormalizedUPC - &GetNormalizedISBN - &GetNormalizedEAN - &GetNormalizedOCLCNumber - &xml_escape - - &GetVariationsOfISBN - &GetVariationsOfISBNs - &NormalizeISBN - &GetVariationsOfISSN - &GetVariationsOfISSNs - &NormalizeISSN - - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + GetItemTypesCategorized + getallthemes + getFacets + getImageSets + getnbpages + getitemtypeimagedir + getitemtypeimagesrc + getitemtypeimagelocation + GetAuthorisedValues + GetNormalizedUPC + GetNormalizedISBN + GetNormalizedEAN + GetNormalizedOCLCNumber + xml_escape + + GetVariationsOfISBN + GetVariationsOfISBNs + NormalizeISBN + GetVariationsOfISSN + GetVariationsOfISSNs + NormalizeISSN + + ); } =head1 NAME --- a/C4/Labels/Label.pm +++ a/C4/Labels/Label.pm @@ -3,14 +3,13 @@ package C4::Labels::Label; use strict; use warnings; -use Text::Wrap; -use Algorithm::CheckDigits; +use Text::Wrap qw( wrap ); +use Algorithm::CheckDigits qw( CheckDigits ); use Text::CSV_XS; -use Data::Dumper; use Text::Bidi qw( log2vis ); use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ); use Koha::ClassSources; use Koha::ClassSortRules; use Koha::ClassSplitRules; --- a/C4/Languages.pm +++ a/C4/Languages.pm @@ -22,24 +22,24 @@ package C4::Languages; use strict; use warnings; -use Carp; +use Carp qw( carp ); use CGI; use List::MoreUtils qw( any ); use C4::Context; use Koha::Caches; use Koha::Cache::Memory::Lite; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &getFrameworkLanguages - &getTranslatedLanguages - &getLanguages - &getAllLanguages + @EXPORT_OK = qw( + getFrameworkLanguages + getTranslatedLanguages + getLanguages + getAllLanguages ); - @EXPORT_OK = qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage); + push @EXPORT_OK, qw(getFrameworkLanguages getTranslatedLanguages getAllLanguages getLanguages get_bidi regex_lang_subtags language_get_description accept_language getlanguage get_rfc4646_from_iso639); } =head1 NAME --- a/C4/Letters.pm +++ a/C4/Letters.pm @@ -20,36 +20,47 @@ package C4::Letters; use Modern::Perl; use MIME::Lite; -use Date::Calc qw( Add_Delta_Days ); -use Encode; -use Carp; +use Carp qw( carp croak ); use Template; -use Module::Load::Conditional qw(can_load); +use Module::Load::Conditional qw( can_load ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Members; -use C4::Log; +use C4::Log qw( logaction ); use C4::SMS; use C4::Templates; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::SMS::Providers; use Koha::Email; use Koha::Notice::Messages; use Koha::Notice::Templates; -use Koha::DateUtils qw( format_sqldatetime dt_from_string ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; use Koha::SMTP::Servers; use Koha::Subscriptions; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &EnqueueLetter &GetLetters &GetLettersAvailableForALibrary &GetLetterTemplates &DelLetter &GetPreparedLetter &GetWrappedLetter &SendAlerts &GetPrintMessages &GetMessageTransportTypes + @EXPORT_OK = qw( + GetLetters + GetLettersAvailableForALibrary + GetLetterTemplates + DelLetter + GetPreparedLetter + GetWrappedLetter + SendAlerts + GetPrintMessages + GetQueuedMessages + GetMessage + GetMessageTransportTypes + + EnqueueLetter + SendQueuedMessages + ResendMessage ); } --- a/C4/Linker.pm +++ a/C4/Linker.pm @@ -47,7 +47,6 @@ to the preferred form. use strict; use warnings; -use Carp; use C4::Context; use base qw(Class::Accessor); --- a/C4/Linker/Default.pm +++ a/C4/Linker/Default.pm @@ -19,7 +19,6 @@ package C4::Linker::Default; use strict; use warnings; -use Carp; use MARC::Field; use C4::Heading; --- a/C4/Linker/FirstMatch.pm +++ a/C4/Linker/FirstMatch.pm @@ -19,7 +19,6 @@ package C4::Linker::FirstMatch; use strict; use warnings; -use Carp; use C4::Heading; use C4::Linker::Default; # Use Default for flipping --- a/C4/Linker/LastMatch.pm +++ a/C4/Linker/LastMatch.pm @@ -19,7 +19,6 @@ package C4::Linker::LastMatch; use strict; use warnings; -use Carp; use C4::Heading; use C4::Linker::Default; # Use Default for flipping --- a/C4/Log.pm +++ a/C4/Log.pm @@ -27,7 +27,6 @@ use warnings; use JSON qw( to_json ); use C4::Context; -use Koha::DateUtils; use Koha::Logger; use vars qw(@ISA @EXPORT); @@ -35,7 +34,7 @@ use vars qw(@ISA @EXPORT); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw(&logaction &cronlogaction); + @EXPORT = qw(logaction cronlogaction); } =head1 NAME --- a/C4/MarcModificationTemplates.pm +++ a/C4/MarcModificationTemplates.pm @@ -22,29 +22,38 @@ use Modern::Perl; use DateTime; use C4::Context; -use Koha::SimpleMARC; +use Koha::SimpleMARC qw( + add_field + copy_and_replace_field + copy_field + delete_field + field_equals + field_exists + move_field + update_field +); use Koha::MoreUtils; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use vars qw(@ISA @EXPORT); BEGIN { - @ISA = qw(Exporter); + @ISA = qw(Exporter); @EXPORT = qw( - &GetModificationTemplates - &AddModificationTemplate - &DelModificationTemplate + GetModificationTemplates + AddModificationTemplate + DelModificationTemplate - &GetModificationTemplateAction - &GetModificationTemplateActions + GetModificationTemplateAction + GetModificationTemplateActions - &AddModificationTemplateAction - &ModModificationTemplateAction - &DelModificationTemplateAction - &MoveModificationTemplateAction + AddModificationTemplateAction + ModModificationTemplateAction + DelModificationTemplateAction + MoveModificationTemplateAction - &ModifyRecordsWithTemplate - &ModifyRecordWithTemplate + ModifyRecordsWithTemplate + ModifyRecordWithTemplate ); } --- a/C4/Matcher.pm +++ a/C4/Matcher.pm @@ -19,12 +19,17 @@ package C4::Matcher; use Modern::Perl; -use MARC::Record; use Koha::SearchEngine; use Koha::SearchEngine::Search; use Koha::SearchEngine::QueryBuilder; -use Koha::Util::Normalize qw/legacy_default remove_spaces upper_case lower_case ISBN/; +use Koha::Util::Normalize qw( + ISBN + legacy_default + lower_case + remove_spaces + upper_case +); =head1 NAME --- a/C4/Members.pm +++ a/C4/Members.pm @@ -22,47 +22,41 @@ package C4::Members; use Modern::Perl; use C4::Context; -use String::Random qw( random_string ); use Scalar::Util qw( looks_like_number ); -use Date::Calc qw/Today check_date Date_to_Days/; -use List::MoreUtils qw( uniq ); -use JSON qw(to_json); -use C4::Log; # logaction -use C4::Overdues; +use Date::Calc qw( check_date Date_to_Days ); +use C4::Overdues qw( checkoverdues ); use C4::Reserves; use C4::Accounts; -use C4::Biblio; -use C4::Letters; +use C4::Letters qw( GetPreparedLetter ); use DateTime; use Koha::Database; -use Koha::DateUtils; -use Koha::AuthUtils qw(hash_password); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::Holds; -use Koha::List::Patron; use Koha::News; use Koha::Patrons; use Koha::Patron::Categories; -our (@ISA,@EXPORT,@EXPORT_OK); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - #Get data - push @EXPORT, qw( + @EXPORT_OK = qw( + GetMemberDetails + GetMember - &GetAllIssues + GetAllIssues - &GetBorrowersToExpunge + GetBorrowersToExpunge - &IssueSlip - ); + IssueSlip + + checkuserpassword + get_cardnumber_length + checkcardnumber - #Check data - push @EXPORT, qw( - &checkuserpassword - &checkcardnumber + DeleteUnverifiedOpacRegistrations + DeleteExpiredOpacRegistrations ); } --- a/C4/Members/Statistics.pm +++ a/C4/Members/Statistics.pm @@ -26,16 +26,17 @@ use Modern::Perl; use C4::Context; -our ( @ISA, @EXPORT, @EXPORT_OK ); +our ( @ISA, @EXPORT_OK ); BEGIN { require Exporter; @ISA = qw(Exporter); - push @EXPORT, qw( - &GetTotalIssuesTodayByBorrower - &GetTotalIssuesReturnedTodayByBorrower - &GetPrecedentStateByBorrower + @EXPORT_OK = qw( + get_fields + GetTotalIssuesTodayByBorrower + GetTotalIssuesReturnedTodayByBorrower + GetPrecedentStateByBorrower ); } --- a/C4/Message.pm +++ a/C4/Message.pm @@ -22,10 +22,10 @@ package C4::Message; use strict; use warnings; use C4::Context; -use C4::Letters; -use YAML::XS; +use C4::Letters qw( GetPreparedLetter EnqueueLetter ); +use YAML::XS qw( Dump ); use Encode; -use Carp; +use Carp qw( carp ); =head1 NAME --- a/C4/OAI/Sets.pm +++ a/C4/OAI/Sets.pm @@ -38,10 +38,10 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &GetOAISets &GetOAISet &GetOAISetBySpec &ModOAISet &DelOAISet &AddOAISet - &GetOAISetsMappings &GetOAISetMappings &ModOAISetMappings - &GetOAISetsBiblio &ModOAISetsBiblios &AddOAISetsBiblios - &CalcOAISetsBiblio &UpdateOAISetsBiblio &DelOAISetsBiblio + GetOAISets GetOAISet GetOAISetBySpec ModOAISet DelOAISet AddOAISet + GetOAISetsMappings GetOAISetMappings ModOAISetMappings + GetOAISetsBiblio ModOAISetsBiblios AddOAISetsBiblios + CalcOAISetsBiblio UpdateOAISetsBiblio DelOAISetsBiblio ); } --- a/C4/Output.pm +++ a/C4/Output.pm @@ -30,30 +30,23 @@ use Modern::Perl; use URI::Escape; use Scalar::Util qw( looks_like_number ); -use C4::Auth qw(get_template_and_user); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Templates; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; - @ISA = qw(Exporter); - @EXPORT_OK = qw(&is_ajax ajax_fail); # More stuff should go here instead - %EXPORT_TAGS = ( all =>[qw(setlanguagecookie pagination_bar parametrized_url - &output_with_http_headers &output_ajax_with_http_headers &output_html_with_http_headers)], - ajax =>[qw(&output_with_http_headers &output_ajax_with_http_headers is_ajax)], - html =>[qw(&output_with_http_headers &output_html_with_http_headers)] - ); - push @EXPORT, qw( + @ISA = qw(Exporter); + @EXPORT_OK = qw( + is_ajax + ajax_fail setlanguagecookie getlanguagecookie pagination_bar parametrized_url + output_html_with_http_headers output_ajax_with_http_headers output_with_http_headers + output_and_exit_if_error output_and_exit output_error ); - push @EXPORT, qw( - &output_html_with_http_headers &output_ajax_with_http_headers &output_with_http_headers - &output_and_exit_if_error &output_and_exit &output_error - ); - } =head1 NAME --- a/C4/Output/JSONStream.pm +++ a/C4/Output/JSONStream.pm @@ -39,7 +39,7 @@ This module allows you to build JSON incrementally. use strict; use warnings; -use JSON; +use JSON qw( to_json ); sub new { my $class = shift; --- a/C4/Overdues.pm +++ a/C4/Overdues.pm @@ -20,45 +20,38 @@ package C4::Overdues; # along with Koha; if not, see . use Modern::Perl; -use Date::Calc qw/Today Date_to_Days/; -use Date::Manip qw/UnixDate/; +use Date::Calc qw( Today ); +use Date::Manip qw( UnixDate ); use List::MoreUtils qw( uniq ); -use POSIX qw( floor ceil ); -use Locale::Currency::Format 1.28; -use Carp; +use POSIX qw( ceil floor ); +use Locale::Currency::Format 1.28 qw( currency_format FMT_SYMBOL ); +use Carp qw( carp ); -use C4::Circulation; use C4::Context; use C4::Accounts; -use C4::Log; # logaction use Koha::Logger; -use Koha::DateUtils; use Koha::Account::Lines; use Koha::Account::Offsets; use Koha::Libraries; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); # subs to rename (and maybe merge some...) - push @EXPORT, qw( - &CalcFine - &Getoverdues - &checkoverdues - &UpdateFine - &GetFine - &get_chargeable_units - &GetOverduesForBranch - &GetOverdueMessageTransportTypes - &parse_overdues_letter - ); - - # subs to move to Circulation.pm - push @EXPORT, qw( - &GetIssuesIteminfo + @EXPORT_OK = qw( + CalcFine + Getoverdues + checkoverdues + UpdateFine + GetFine + GetBranchcodesWithOverdueRules + get_chargeable_units + GetOverduesForBranch + GetOverdueMessageTransportTypes + parse_overdues_letter + GetIssuesIteminfo ); } --- a/C4/Patroncards.pm +++ a/C4/Patroncards.pm @@ -16,7 +16,16 @@ BEGIN { ); use C4::Patroncards::Batch; use C4::Patroncards::Layout; - use C4::Patroncards::Lib; + use C4::Patroncards::Lib qw( + box + get_borrower_attributes + get_image + leading + put_image + rm_image + text_alignment + unpack_UTF8 +); use C4::Patroncards::Patroncard; use C4::Patroncards::Profile; use C4::Patroncards::Template; --- a/C4/Patroncards/Patroncard.pm +++ a/C4/Patroncards/Patroncard.pm @@ -21,12 +21,16 @@ use strict; use warnings; use autouse 'Data::Dumper' => qw(Dumper); -use Text::Wrap qw(wrap); #use Font::TTFMetrics; -use C4::Creators::Lib qw(get_font_types get_unit_values); +use C4::Creators::Lib qw( get_unit_values ); use C4::Creators::PDF qw(StrWidth); -use C4::Patroncards::Lib qw(unpack_UTF8 text_alignment leading box get_borrower_attributes); +use C4::Patroncards::Lib qw( + box + get_borrower_attributes + leading + text_alignment +); =head1 NAME --- a/C4/Record.pm +++ a/C4/Record.pm @@ -25,20 +25,20 @@ use Modern::Perl; use MARC::Record; # marc2marcxml, marcxml2marc, changeEncoding use MARC::File::XML; # marc2marcxml, marcxml2marc, changeEncoding use Biblio::EndnoteStyle; -use Unicode::Normalize; # _entity_encode -use C4::Biblio; #marc2bibtex +use Unicode::Normalize qw( NFC ); # _entity_encode +use C4::Biblio qw( GetFrameworkCode GetMarcBiblio ); use C4::Koha; #marc2csv -use C4::XSLT (); +use C4::XSLT; use YAML::XS; #marcrecords2csv use Encode; use Template; use Text::CSV::Encoded; #marc2csv use Koha::Items; -use Koha::SimpleMARC qw(read_field); +use Koha::SimpleMARC qw( read_field ); use Koha::XSLT::Base; use Koha::CsvProfiles; use Koha::AuthorisedValues; -use Carp; +use Carp qw( carp croak ); use vars qw(@ISA @EXPORT); @@ -48,16 +48,17 @@ use vars qw(@ISA @EXPORT); # only export API methods @EXPORT = qw( - &marc2endnote - &marc2marc - &marc2marcxml - &marcxml2marc - &marc2dcxml - &marc2modsxml - &marc2madsxml - &marc2bibtex - &marc2csv - &changeEncoding + marc2endnote + marc2marc + marc2marcxml + marcxml2marc + marc2dcxml + marc2modsxml + marc2madsxml + marc2bibtex + marc2csv + marcrecord2csv + changeEncoding ); =head1 NAME --- a/C4/Reports.pm +++ a/C4/Reports.pm @@ -20,13 +20,13 @@ package C4::Reports; use Modern::Perl; use CGI qw ( -utf8 ); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use C4::Context; +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( GetDelimiterChoices ); } --- a/C4/Reports/Guided.pm +++ a/C4/Reports/Guided.pm @@ -19,40 +19,42 @@ package C4::Reports::Guided; use Modern::Perl; use CGI qw ( -utf8 ); -use Carp; +use Carp qw( carp croak ); use JSON qw( from_json ); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use C4::Context; use C4::Templates qw/themelanguage/; -use C4::Koha; -use Koha::DateUtils; +use C4::Koha qw( GetAuthorisedValues ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; use Koha::Reports; use C4::Output; -use C4::Log; +use C4::Log qw( logaction ); use Koha::Notice::Templates; -use C4::Letters; use Koha::Logger; use Koha::AuthorisedValues; use Koha::Patron::Categories; use Koha::SharedContent; +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( get_report_types get_report_areas get_report_groups get_columns build_query get_criteria save_report get_saved_reports execute_query get_column_type get_distinct_values save_dictionary get_from_dictionary - delete_definition delete_report format_results get_sql + delete_definition delete_report store_results format_results get_sql get_results nb_rows update_sql + strip_limit + convert_sql GetReservedAuthorisedValues GetParametersFromSQL IsAuthorisedValueValid ValidateSQLParameters nb_rows update_sql + EmailReport ); } --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -24,12 +24,11 @@ package C4::Reserves; use Modern::Perl; use C4::Accounts; -use C4::Biblio; -use C4::Circulation; +use C4::Circulation qw( CheckIfIssuedToPatron GetAgeRestriction GetBranchItemRule ); use C4::Context; -use C4::Items; +use C4::Items qw( CartToShelf get_hostitemnumbers_of ); use C4::Letters; -use C4::Log; +use C4::Log qw( logaction ); use C4::Members::Messaging; use C4::Members; use Koha::Account::Lines; @@ -37,7 +36,7 @@ use Koha::Biblios; use Koha::Calendar; use Koha::CirculationRules; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Hold; use Koha::Holds; use Koha::ItemTypes; @@ -47,11 +46,8 @@ use Koha::Old::Hold; use Koha::Patrons; use Koha::Plugins; -use Carp; -use Data::Dumper; -use List::MoreUtils qw( firstidx any ); - -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +use Data::Dumper qw( Dumper ); +use List::MoreUtils qw( any ); =head1 NAME @@ -99,49 +95,57 @@ This modules provides somes functions to deal with reservations. =cut +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &AddReserve + @EXPORT_OK = qw( + AddReserve + + GetReserveStatus + + GetOtherReserves + ChargeReserveFee + GetReserveFee + + ModReserveFill + ModReserveAffect + ModReserve + ModReserveStatus + ModReserveCancelAll + ModReserveMinusPriority + MoveReserve - &GetReserveStatus + CheckReserves + CanBookBeReserved + CanItemBeReserved + CanReserveBeCanceledFromOpac + CancelExpiredReserves - &GetOtherReserves + AutoUnsuspendReserves - &ModReserveFill - &ModReserveAffect - &ModReserve - &ModReserveStatus - &ModReserveCancelAll - &ModReserveMinusPriority - &MoveReserve + IsAvailableForItemLevelRequest + ItemsAnyAvailableAndNotRestricted - &CheckReserves - &CanBookBeReserved - &CanItemBeReserved - &CanReserveBeCanceledFromOpac - &CancelExpiredReserves + AlterPriority + ToggleLowestPriority - &AutoUnsuspendReserves + ReserveSlip + ToggleSuspend + SuspendAll - &IsAvailableForItemLevelRequest - ItemsAnyAvailableAndNotRestricted + GetReservesControlBranch - &AlterPriority - &ToggleLowestPriority + CalculatePriority - &ReserveSlip - &ToggleSuspend - &SuspendAll + IsItemOnHoldAndFound - &GetReservesControlBranch + GetMaxPatronHoldsForRecord - IsItemOnHoldAndFound + MergeHolds - GetMaxPatronHoldsForRecord + RevertWaitingStatus ); - @EXPORT_OK = qw( MergeHolds ); } =head2 AddReserve --- a/C4/Ris.pm +++ a/C4/Ris.pm @@ -62,12 +62,12 @@ package C4::Ris; use Modern::Perl; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use YAML::XS; use Encode; use vars qw(@ISA @EXPORT); -use Koha::SimpleMARC qw(read_field); +use Koha::SimpleMARC qw( read_field ); @ISA = qw(Exporter); @@ -75,7 +75,7 @@ use Koha::SimpleMARC qw(read_field); # only export API methods @EXPORT = qw( - &marc2ris + marc2ris ); our $marcprint = 0; # Debug flag; --- a/C4/RotatingCollections.pm +++ a/C4/RotatingCollections.pm @@ -25,12 +25,10 @@ package C4::RotatingCollections; use Modern::Perl; use C4::Context; -use C4::Circulation; use C4::Reserves qw(CheckReserves); use Koha::Database; -use DBI; -use Try::Tiny; +use Try::Tiny qw( catch try ); use vars qw(@ISA @EXPORT); @@ -61,6 +59,8 @@ BEGIN { TransferCollection GetCollectionItemBranches + isItemInAnyCollection + isItemInThisCollection ); } --- a/C4/SIP/ILS.pm +++ a/C4/SIP/ILS.pm @@ -6,7 +6,7 @@ package C4::SIP::ILS; use warnings; use strict; -use C4::SIP::Sip qw(siplog); +use C4::SIP::Sip qw( siplog ); use Data::Dumper; use C4::SIP::ILS::Item; --- a/C4/SIP/ILS/Item.pm +++ a/C4/SIP/ILS/Item.pm @@ -17,11 +17,11 @@ use C4::SIP::ILS::Transaction; use C4::SIP::Sip qw(add_field); use C4::Biblio; -use C4::Circulation; +use C4::Circulation qw( barcodedecode ); use C4::Context; use C4::Items; use C4::Members; -use C4::Reserves; +use C4::Reserves qw( ModReserveFill ); use Koha::Biblios; use Koha::Checkouts::ReturnClaims; use Koha::Checkouts; --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ a/C4/SIP/ILS/Transaction/Checkin.pm @@ -11,9 +11,9 @@ use strict; use C4::SIP::ILS::Transaction; -use C4::Circulation; +use C4::Circulation qw( AddReturn LostItem ); use C4::Items qw( ModItemTransfer ); -use C4::Reserves qw( ModReserveAffect ); +use C4::Reserves qw( ModReserve ModReserveAffect ); use Koha::DateUtils qw( dt_from_string ); use Koha::Items; --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ a/C4/SIP/ILS/Transaction/Checkout.pm @@ -8,14 +8,14 @@ use warnings; use strict; use POSIX qw(strftime); -use C4::SIP::Sip qw(siplog); +use C4::SIP::Sip qw( siplog ); use Data::Dumper; use CGI qw ( -utf8 ); use C4::SIP::ILS::Transaction; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued ); use C4::Members; use C4::Reserves qw(ModReserveFill); use Koha::DateUtils; --- a/C4/SIP/ILS/Transaction/Hold.pm +++ a/C4/SIP/ILS/Transaction/Hold.pm @@ -7,13 +7,13 @@ use Modern::Perl; use C4::SIP::ILS::Transaction; -use C4::Reserves; # AddReserve +use C4::Reserves qw( CalculatePriority AddReserve ModReserve ); use Koha::Holds; use Koha::Patrons; -use parent qw(C4::SIP::ILS::Transaction); - use Koha::Items; +use parent qw(C4::SIP::ILS::Transaction); + my %fields = ( expiration_date => 0, pickup_location => undef, --- a/C4/SIP/ILS/Transaction/Renew.pm +++ a/C4/SIP/ILS/Transaction/Renew.pm @@ -7,7 +7,7 @@ package C4::SIP::ILS::Transaction::Renew; use warnings; use strict; -use C4::Circulation; +use C4::Circulation qw( CanBookBeRenewed GetIssuingCharges AddIssue ); use Koha::Patrons; use Koha::DateUtils; --- a/C4/SIP/ILS/Transaction/RenewAll.pm +++ a/C4/SIP/ILS/Transaction/RenewAll.pm @@ -6,7 +6,7 @@ package C4::SIP::ILS::Transaction::RenewAll; use strict; use warnings; -use C4::SIP::Sip qw(siplog); +use C4::SIP::Sip qw( siplog ); use C4::SIP::ILS::Item; --- a/C4/SIP/SIPServer.pm +++ a/C4/SIP/SIPServer.pm @@ -21,8 +21,8 @@ use C4::SIP::Sip::MsgType qw( handle login_core ); use C4::SIP::Logger qw(set_logger); use Koha::Caches; - use Koha::Logger; + use C4::SIP::Trapper; tie *STDERR, "C4::SIP::Trapper"; --- a/C4/SIP/Sip.pm +++ a/C4/SIP/Sip.pm @@ -15,7 +15,7 @@ use List::Util qw(first); use C4::SIP::Sip::Constants qw(SIP_DATETIME FID_SCREEN_MSG); use C4::SIP::Sip::Checksum qw(checksum); -use C4::SIP::Logger qw(get_logger); +use C4::SIP::Logger qw( get_logger ); use base qw(Exporter); --- a/C4/Scheduler.pm +++ a/C4/Scheduler.pm @@ -19,15 +19,14 @@ package C4::Scheduler; use Modern::Perl; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use C4::Context; use Schedule::At; +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = - qw(get_jobs get_at_jobs get_at_job add_at_job remove_at_job); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw(get_jobs get_at_jobs get_at_job add_at_job remove_at_job); } =head1 NAME --- a/C4/Scrubber.pm +++ a/C4/Scrubber.pm @@ -21,7 +21,7 @@ package C4::Scrubber; use strict; use warnings; -use Carp; +use Carp qw( croak ); use HTML::Scrubber; use C4::Context; --- a/C4/Search.pm +++ a/C4/Search.pm @@ -16,28 +16,44 @@ package C4::Search; # along with Koha; if not, see . use Modern::Perl; -require Exporter; use C4::Context; -use C4::Biblio; # GetMarcFromKohaField, GetBiblioData -use C4::Koha; # getFacets +use C4::Biblio qw( TransformMarcToKoha GetMarcFromKohaField GetFrameworkCode GetAuthorisedValueDesc GetBiblioData ); +use C4::Koha qw( getFacets GetVariationsOfISBN GetNormalizedUPC GetNormalizedEAN GetNormalizedOCLCNumber GetNormalizedISBN getitemtypeimagelocation ); use Koha::DateUtils; use Koha::Libraries; use Lingua::Stem; use XML::Simple; -use C4::XSLT; -use C4::Reserves; # GetReserveStatus -use C4::Charset; -use Koha::Logger; +use C4::XSLT qw( XSLTParse4Display ); +use C4::Reserves qw( GetReserveStatus ); +use C4::Charset qw( SetUTF8Flag ); use Koha::AuthorisedValues; use Koha::ItemTypes; use Koha::Libraries; +use Koha::Logger; use Koha::Patrons; use Koha::RecordProcessor; use URI::Escape; use Business::ISBN; use MARC::Record; use MARC::Field; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); + +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + FindDuplicate + SimpleSearch + searchResults + getRecords + buildQuery + GetDistinctValues + enabled_staff_search_views + new_record_from_zebra + z3950_search_args + getIndexes + ); +} =head1 NAME @@ -55,17 +71,6 @@ This module provides searching functions for Koha's bibliographic databases =cut -@ISA = qw(Exporter); -@EXPORT = qw( - &FindDuplicate - &SimpleSearch - &searchResults - &getRecords - &buildQuery - &GetDistinctValues - &enabled_staff_search_views -); - # make all your functions, whether exported or not; =head2 FindDuplicate --- a/C4/Search/History.pm +++ a/C4/Search/History.pm @@ -4,11 +4,10 @@ use Modern::Perl; use C4::Auth qw( get_session ); use C4::Context; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); -use JSON qw( encode_json decode_json ); -use URI::Escape; -use Encode; +use JSON qw( decode_json encode_json ); +use URI::Escape qw( uri_escape uri_unescape ); sub add { my ($params) = @_; --- a/C4/Search/PazPar2.pm +++ a/C4/Search/PazPar2.pm @@ -22,7 +22,7 @@ use Modern::Perl; use LWP::UserAgent; use URI; use URI::QueryParam; -use XML::Simple; +use XML::Simple qw( XMLin ); =head1 NAME --- a/C4/Serials.pm +++ a/C4/Serials.pm @@ -20,25 +20,30 @@ package C4::Serials; use Modern::Perl; -use C4::Auth qw(haspermission); +use C4::Auth qw( haspermission ); use C4::Context; use DateTime; -use Date::Calc qw(:all); -use POSIX qw(strftime); -use C4::Biblio; -use C4::Log; # logaction -use C4::Serials::Frequency; +use Date::Calc qw( + Add_Delta_Days + Add_Delta_YM + check_date + Delta_Days + N_Delta_YMD + Today +); +use POSIX qw( strftime ); +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ModBiblio ); +use C4::Log qw( logaction ); # logaction +use C4::Serials::Frequency qw( GetSubscriptionFrequency ); use C4::Serials::Numberpattern; use Koha::AdditionalFieldValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Serial; use Koha::Subscriptions; use Koha::Subscription::Histories; use Koha::SharedContent; use Scalar::Util qw( looks_like_number ); -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - # Define statuses use constant { EXPECTED => 1, @@ -61,31 +66,39 @@ use constant MISSING_STATUSES => ( MISSING_LOST ); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &NewSubscription &ModSubscription &DelSubscription - &GetSubscription &CountSubscriptionFromBiblionumber &GetSubscriptionsFromBiblionumber - &SearchSubscriptions - &GetFullSubscriptionsFromBiblionumber &GetFullSubscription &ModSubscriptionHistory - &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire - &GetSubscriptionHistoryFromSubscriptionId - - &GetNextSeq &GetSeq &NewIssue &GetSerials - &GetLatestSerials &ModSerialStatus &GetNextDate &GetSerials2 - &GetSubscriptionLength &ReNewSubscription &GetLateOrMissingIssues - &GetSerialInformation &AddItem2Serial - &PrepareSerialsData &GetNextExpected &ModNextExpected - &GetPreviousSerialid - - &GetSuppliersWithLateIssues - &getroutinglist &delroutingmember &addroutingmember - &reorder_members - &check_routing &updateClaim - &CountIssues + @EXPORT_OK = qw( + NewSubscription ModSubscription DelSubscription + GetSubscription CountSubscriptionFromBiblionumber GetSubscriptionsFromBiblionumber + SearchSubscriptions + GetFullSubscriptionsFromBiblionumber GetFullSubscription ModSubscriptionHistory + HasSubscriptionStrictlyExpired HasSubscriptionExpired GetExpirationDate abouttoexpire + GetFictiveIssueNumber + GetSubscriptionHistoryFromSubscriptionId + + GetNextSeq GetSeq NewIssue GetSerials + GetLatestSerials ModSerialStatus GetNextDate + CloseSubscription ReopenSubscription + subscriptionCurrentlyOnOrder + can_claim_subscription can_edit_subscription can_show_subscription + GetSerials2 + GetSubscriptionLength ReNewSubscription GetLateOrMissingIssues + GetSerialInformation AddItem2Serial + PrepareSerialsData GetNextExpected ModNextExpected + GetSubscriptionIrregularities + GetPreviousSerialid + + GetSuppliersWithLateIssues + getroutinglist delroutingmember addroutingmember + reorder_members + check_routing updateClaim + CountIssues HasItems - &subscriptionCurrentlyOnOrder + + findSerialsByStatus ); } --- a/C4/Serials/Frequency.pm +++ a/C4/Serials/Frequency.pm @@ -28,13 +28,13 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &GetSubscriptionFrequencies - &GetSubscriptionFrequency - &AddSubscriptionFrequency - &ModSubscriptionFrequency - &DelSubscriptionFrequency + GetSubscriptionFrequencies + GetSubscriptionFrequency + AddSubscriptionFrequency + ModSubscriptionFrequency + DelSubscriptionFrequency - &GetSubscriptionsWithFrequency + GetSubscriptionsWithFrequency ); } --- a/C4/Serials/Numberpattern.pm +++ a/C4/Serials/Numberpattern.pm @@ -29,14 +29,14 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( - &GetSubscriptionNumberpatterns - &GetSubscriptionNumberpattern - &GetSubscriptionNumberpatternByName - &AddSubscriptionNumberpattern - &ModSubscriptionNumberpattern - &DelSubscriptionNumberpattern - - &GetSubscriptionsWithNumberpattern + GetSubscriptionNumberpatterns + GetSubscriptionNumberpattern + GetSubscriptionNumberpatternByName + AddSubscriptionNumberpattern + ModSubscriptionNumberpattern + DelSubscriptionNumberpattern + + GetSubscriptionsWithNumberpattern ); } --- a/C4/Service.pm +++ a/C4/Service.pm @@ -43,7 +43,7 @@ use warnings; use CGI qw ( -utf8 ); use C4::Auth qw( check_api_auth ); -use C4::Output qw( :ajax ); +use C4::Output qw( output_with_http_headers ); use C4::Output::JSONStream; use JSON; --- a/C4/ShelfBrowser.pm +++ a/C4/ShelfBrowser.pm @@ -20,21 +20,18 @@ package C4::ShelfBrowser; use strict; use warnings; -use C4::Biblio; +use C4::Biblio qw( GetAuthorisedValueDesc GetMarcBiblio ); use C4::Context; -use C4::Koha; +use C4::Koha qw( GetNormalizedUPC GetNormalizedOCLCNumber GetNormalizedISBN GetNormalizedEAN ); use Koha::Biblios; use Koha::Libraries; -use vars qw(@ISA @EXPORT @EXPORT_OK); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT = qw( - &GetNearbyItems - ); + require Exporter; + @ISA = qw(Exporter); @EXPORT_OK = qw( + GetNearbyItems ); } --- a/C4/SocialData.pm +++ a/C4/SocialData.pm @@ -19,7 +19,7 @@ use Modern::Perl; use C4::Context; use Business::ISBN; -use C4::Koha; +use C4::Koha qw( GetNormalizedISBN ); =head1 NAME --- a/C4/Stats.pm +++ a/C4/Stats.pm @@ -20,7 +20,7 @@ package C4::Stats; use Modern::Perl; require Exporter; -use Carp; +use Carp qw( croak ); use C4::Context; use Koha::DateUtils qw( dt_from_string ); @@ -30,10 +30,10 @@ use Koha::PseudonymizedTransactions; use vars qw(@ISA @EXPORT); BEGIN { - @ISA = qw(Exporter); - @EXPORT = qw( - &UpdateStats - ); + @ISA = qw(Exporter); + @EXPORT = qw( + UpdateStats + ); } --- a/C4/Suggestions.pm +++ a/C4/Suggestions.pm @@ -25,10 +25,9 @@ use C4::Context; use C4::Output; use C4::Letters; use C4::Biblio qw( GetMarcFromKohaField ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Suggestions; -use List::MoreUtils qw(any); use base qw(Exporter); our @EXPORT = qw( --- a/C4/Tags.pm +++ a/C4/Tags.pm @@ -20,35 +20,36 @@ package C4::Tags; use strict; use warnings; -use Carp; +use Carp qw( carp ); use Exporter; use C4::Context; -use Module::Load::Conditional qw/check_install/; +use Module::Load::Conditional qw( check_install ); #use Data::Dumper; use constant TAG_FIELDS => qw(tag_id borrowernumber biblionumber term language date_created); use constant TAG_SELECT => "SELECT " . join(',', TAG_FIELDS) . "\n FROM tags_all\n"; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { - @ISA = qw(Exporter); + @ISA = qw(Exporter); @EXPORT_OK = qw( - &get_tag &get_tags &get_tag_rows - &add_tags &add_tag - &delete_tag_row_by_id - &remove_tag - &delete_tag_rows_by_ids - &get_approval_rows - &blacklist - &whitelist - &is_approved - &approval_counts - &get_count_by_tag_status - &get_filters + get_tag get_tags get_tag_rows + add_tags + add_tag + add_tag_approval + add_tag_index + delete_tag_row_by_id + remove_tag + delete_tag_rows_by_ids + get_approval_rows + blacklist + whitelist + is_approved + approval_counts + get_count_by_tag_status + get_filters stratify_tags ); - # %EXPORT_TAGS = (); my $ext_dict = C4::Context->preference('TagsExternalDictionary'); if ( $ext_dict && ! check_install( module => 'Lingua::Ispell' ) ) { warn "Ignoring TagsExternalDictionary, because Lingua::Ispell is not installed."; --- a/C4/Templates.pm +++ a/C4/Templates.pm @@ -2,9 +2,9 @@ package C4::Templates; use strict; use warnings; -use Carp; +use Carp qw( carp ); use CGI qw ( -utf8 ); -use List::MoreUtils qw/ any uniq /; +use List::MoreUtils qw( uniq ); # Copyright 2009 Chris Cormack and The Koha Dev Team # @@ -31,8 +31,7 @@ C4::Templates - Object for manipulating templates for use with Koha use base qw(Class::Accessor); use Template; -use Template::Constants qw( :debug ); -use C4::Languages qw(getTranslatedLanguages get_bidi regex_lang_subtags language_get_description accept_language ); +use C4::Languages qw( get_bidi getTranslatedLanguages regex_lang_subtags ); use C4::Context; --- a/C4/TmplTokenType.pm +++ a/C4/TmplTokenType.pm @@ -20,8 +20,6 @@ package C4::TmplTokenType; use Modern::Perl; require Exporter; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - ############################################################################### =head1 NAME @@ -38,25 +36,28 @@ The predefined constants are ############################################################################### -@ISA = qw(Exporter); -@EXPORT_OK = qw( - &TEXT - &TEXT_PARAMETRIZED - &CDATA - &TAG - &DECL - &PI - &DIRECTIVE - &COMMENT - &UNKNOWN -); - ############################################################################### use vars qw( $_text $_text_parametrized $_cdata $_tag $_decl $_pi $_directive $_comment $_null $_unknown ); +our (@ISA, @EXPORT_OK); BEGIN { + + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + TEXT + TEXT_PARAMETRIZED + CDATA + TAG + DECL + PI + DIRECTIVE + COMMENT + UNKNOWN + ); + my $new = sub { my $this = 'C4::TmplTokenType';#shift; my $class = ref($this) || $this; --- a/C4/UsageStats.pm +++ a/C4/UsageStats.pm @@ -19,9 +19,9 @@ package C4::UsageStats; use Modern::Perl; use C4::Context; -use POSIX qw(strftime); +use POSIX qw( strftime ); use LWP::UserAgent; -use JSON; +use JSON qw( decode_json encode_json ); use Koha::Libraries; --- a/C4/Utils/DataTables/Members.pm +++ a/C4/Utils/DataTables/Members.pm @@ -2,8 +2,8 @@ package C4::Utils::DataTables::Members; use Modern::Perl; use C4::Context; -use C4::Utils::DataTables; -use Koha::DateUtils; +use C4::Utils::DataTables qw( dt_build_orderby ); +use Koha::DateUtils qw( dt_from_string output_pref ); sub search { my ( $params ) = @_; --- a/C4/Utils/DataTables/VirtualShelves.pm +++ a/C4/Utils/DataTables/VirtualShelves.pm @@ -2,7 +2,7 @@ package C4::Utils::DataTables::VirtualShelves; use Modern::Perl; use C4::Context; -use C4::Utils::DataTables; +use C4::Utils::DataTables qw( dt_build_orderby ); use Koha::Virtualshelves; sub search { --- a/C4/XISBN.pm +++ a/C4/XISBN.pm @@ -21,24 +21,22 @@ use Modern::Perl; use XML::Simple; #use LWP::Simple; use C4::Biblio; -use C4::Koha; -use C4::Search; -use C4::External::Syndetics qw(get_syndetics_editions); +use C4::Koha qw( GetNormalizedISBN ); +use C4::Search qw( new_record_from_zebra ); +use C4::External::Syndetics qw( get_syndetics_editions ); use LWP::UserAgent; -use HTTP::Request::Common; use Koha::Biblios; use Koha::SearchEngine; use Koha::SearchEngine::Search; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +our (@ISA, @EXPORT_OK); BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT_OK = qw( - &get_xisbns - ); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + get_xisbns + ); } =head1 NAME --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -24,30 +24,29 @@ package C4::XSLT; use Modern::Perl; use C4::Context; -use C4::Items; -use C4::Koha; -use C4::Biblio; -use C4::Circulation; -use C4::Reserves; +use C4::Koha qw( xml_escape ); +use C4::Biblio qw( GetAuthorisedValueDesc GetFrameworkCode GetMarcStructure ); use Koha::AuthorisedValues; use Koha::ItemTypes; use Koha::XSLT::Base; use Koha::Libraries; -use Encode; -use vars qw(@ISA @EXPORT); my $engine; #XSLT Handler object my %authval_per_framework; # Cache for tagfield-tagsubfield to decode per framework. # Should be preferably be placed in Koha-core... +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( - &XSLTParse4Display + @EXPORT_OK = qw( + transformMARCXML4XSLT + getAuthorisedValues4MARCSubfields + buildKohaItemsNamespace + XSLTParse4Display ); $engine=Koha::XSLT::Base->new( { do_not_return_source => 1 } ); } --- a/Koha/Account.pm +++ a/Koha/Account.pm @@ -20,9 +20,8 @@ package Koha::Account; use Modern::Perl; use Carp; -use Data::Dumper; -use List::MoreUtils qw( uniq ); -use Try::Tiny; +use Data::Dumper qw( Dumper ); +use Try::Tiny qw( catch try ); use C4::Circulation qw( ReturnLostItem CanBookBeRenewed AddRenewal ); use C4::Letters; @@ -34,7 +33,6 @@ use Koha::Patrons; use Koha::Account::Lines; use Koha::Account::Offsets; use Koha::Account::DebitTypes; -use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions; use Koha::Exceptions::Account; --- a/Koha/Account/CreditType.pm +++ a/Koha/Account/CreditType.pm @@ -18,7 +18,6 @@ package Koha::Account::CreditType; # along with Koha; if not, see . use Modern::Perl; -use List::Util qw/any/; use Koha::Database; use Koha::Exceptions; --- a/Koha/Account/CreditTypes.pm +++ a/Koha/Account/CreditTypes.pm @@ -18,7 +18,6 @@ package Koha::Account::CreditTypes; # along with Koha; if not, see . use Modern::Perl; -use List::Util qw/any/; use Koha::Database; use Koha::Account::CreditType; --- a/Koha/Account/DebitType.pm +++ a/Koha/Account/DebitType.pm @@ -18,7 +18,6 @@ package Koha::Account::DebitType; # along with Koha; if not, see . use Modern::Perl; -use List::Util qw/any/; use Koha::Database; use Koha::Exceptions; --- a/Koha/Account/DebitTypes.pm +++ a/Koha/Account/DebitTypes.pm @@ -18,7 +18,6 @@ package Koha::Account::DebitTypes; # along with Koha; if not, see . use Modern::Perl; -use List::Util qw/any/; use Koha::Database; use Koha::Account::DebitType; --- a/Koha/Account/Line.pm +++ a/Koha/Account/Line.pm @@ -17,17 +17,16 @@ package Koha::Account::Line; use Modern::Perl; -use Carp; -use Data::Dumper; +use Data::Dumper qw( Dumper ); -use C4::Log qw(logaction); -use C4::Overdues qw(GetFine); +use C4::Log qw( logaction ); +use C4::Overdues qw( UpdateFine ); use Koha::Account::CreditType; use Koha::Account::DebitType; use Koha::Account::Offsets; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Account; use Koha::Items; --- a/Koha/Account/Lines.pm +++ a/Koha/Account/Lines.pm @@ -17,7 +17,6 @@ package Koha::Account::Lines; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Account::Line; --- a/Koha/Account/Offset.pm +++ a/Koha/Account/Offset.pm @@ -17,7 +17,6 @@ package Koha::Account::Offset; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Account::Lines; --- a/Koha/Account/Offsets.pm +++ a/Koha/Account/Offsets.pm @@ -17,7 +17,6 @@ package Koha::Account::Offsets; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Acquisition/Basket.pm +++ a/Koha/Acquisition/Basket.pm @@ -25,7 +25,7 @@ use Koha::Acquisition::BasketGroups; use Koha::Acquisition::Orders; use Koha::Exceptions::Acquisition::Basket; use Koha::Patrons; -use C4::Log qw(logaction); +use C4::Log qw( logaction ); use base qw( Koha::Object Koha::Object::Mixin::AdditionalFields ); --- a/Koha/Acquisition/Bookseller/Contact.pm +++ a/Koha/Acquisition/Bookseller/Contact.pm @@ -4,7 +4,6 @@ use Modern::Perl; use base qw( Koha::Object ); -use Carp qw( croak ); sub _type { return 'Aqcontact'; --- a/Koha/Acquisition/Bookseller/Contacts.pm +++ a/Koha/Acquisition/Bookseller/Contacts.pm @@ -2,7 +2,6 @@ package Koha::Acquisition::Bookseller::Contacts; use Modern::Perl; -use Carp; use base qw( Koha::Objects ); --- a/Koha/Acquisition/Currencies.pm +++ a/Koha/Acquisition/Currencies.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Currencies; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Acquisition/Currency.pm +++ a/Koha/Acquisition/Currency.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Currency; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Acquisition/Invoice/Adjustment.pm +++ a/Koha/Acquisition/Invoice/Adjustment.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Invoice::Adjustment; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Acquisition::Invoices; --- a/Koha/Acquisition/Invoice/Adjustments.pm +++ a/Koha/Acquisition/Invoice/Adjustments.pm @@ -18,7 +18,6 @@ package Koha::Acquisition::Invoice::Adjustments; use Modern::Perl; use Koha::Acquisition::Invoice::Adjustment; -use Carp; use Koha::Database; --- a/Koha/Acquisition/Order.pm +++ a/Koha/Acquisition/Order.pm @@ -18,16 +18,15 @@ package Koha::Acquisition::Order; use Modern::Perl; use Carp qw( croak ); -use Try::Tiny; -use C4::Biblio qw(DelBiblio); +use C4::Biblio qw( DelBiblio ); use Koha::Acquisition::Baskets; use Koha::Acquisition::Funds; use Koha::Acquisition::Invoices; use Koha::Acquisition::Order::Claims; use Koha::Database; -use Koha::DateUtils qw( dt_from_string output_pref ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Object; use Koha::Biblios; use Koha::Holds; --- a/Koha/Acquisition/Order/Claim.pm +++ a/Koha/Acquisition/Order/Claim.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Order::Claim; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Acquisition/Order/Claims.pm +++ a/Koha/Acquisition/Order/Claims.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Order::Claims; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Acquisition/Orders.pm +++ a/Koha/Acquisition/Orders.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Orders; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/AdvancedEditorMacro.pm +++ a/Koha/AdvancedEditorMacro.pm @@ -16,7 +16,6 @@ package Koha::AdvancedEditorMacro; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/AdvancedEditorMacros.pm +++ a/Koha/AdvancedEditorMacros.pm @@ -16,7 +16,6 @@ package Koha::AdvancedEditorMacros; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/ApiKey.pm +++ a/Koha/ApiKey.pm @@ -19,7 +19,6 @@ package Koha::ApiKey; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; --- a/Koha/ApiKeys.pm +++ a/Koha/ApiKeys.pm @@ -19,7 +19,6 @@ package Koha::ApiKeys; use Modern::Perl; -use Carp; use Koha::Database; use Koha::ApiKey; --- a/Koha/ArticleRequest.pm +++ a/Koha/ArticleRequest.pm @@ -19,14 +19,13 @@ package Koha::ArticleRequest; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Patrons; use Koha::Biblios; use Koha::Items; use Koha::Libraries; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use base qw(Koha::Object); --- a/Koha/ArticleRequests.pm +++ a/Koha/ArticleRequests.pm @@ -19,7 +19,6 @@ package Koha::ArticleRequests; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/AudioAlert.pm +++ a/Koha/AudioAlert.pm @@ -19,7 +19,6 @@ package Koha::AudioAlert; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/AudioAlerts.pm +++ a/Koha/AudioAlerts.pm @@ -19,7 +19,6 @@ package Koha::AudioAlerts; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/AuthUtils.pm +++ a/Koha/AuthUtils.pm @@ -18,19 +18,22 @@ package Koha::AuthUtils; # along with Koha; if not, see . use Modern::Perl; -use Crypt::Eksblowfish::Bcrypt qw(bcrypt en_base64); -use Encode qw( encode is_utf8 ); -use Fcntl qw/O_RDONLY/; # O_RDONLY is used in generate_salt -use List::MoreUtils qw/ any /; +use Crypt::Eksblowfish::Bcrypt qw( bcrypt en_base64 ); +use Encode; +use Fcntl qw( O_RDONLY ); # O_RDONLY is used in generate_salt +use List::MoreUtils qw( any ); use String::Random qw( random_string ); use Koha::Exceptions::Password; use C4::Context; -use base 'Exporter'; - -our @EXPORT_OK = qw(hash_password get_script_name); +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw(hash_password get_script_name is_password_valid); +}; =head1 NAME Koha::AuthUtils - utility routines for authentication --- a/Koha/AuthorisedValue.pm +++ a/Koha/AuthorisedValue.pm @@ -19,7 +19,6 @@ package Koha::AuthorisedValue; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/AuthorisedValueCategories.pm +++ a/Koha/AuthorisedValueCategories.pm @@ -17,7 +17,6 @@ package Koha::AuthorisedValueCategories; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; --- a/Koha/AuthorisedValueCategory.pm +++ a/Koha/AuthorisedValueCategory.pm @@ -17,7 +17,6 @@ package Koha::AuthorisedValueCategory; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; --- a/Koha/AuthorisedValues.pm +++ a/Koha/AuthorisedValues.pm @@ -19,7 +19,6 @@ package Koha::AuthorisedValues; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Authorities.pm +++ a/Koha/Authorities.pm @@ -19,7 +19,6 @@ package Koha::Authorities; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Authority/MergeRequests.pm +++ a/Koha/Authority/MergeRequests.pm @@ -19,12 +19,11 @@ package Koha::Authority::MergeRequests; use Modern::Perl; use MARC::File::XML; -use MARC::Record; use C4::Context; use Koha::Authority::MergeRequest; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use parent qw(Koha::Objects); --- a/Koha/Authority/Type.pm +++ a/Koha/Authority/Type.pm @@ -17,7 +17,6 @@ package Koha::Authority::Type; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Authority/Types.pm +++ a/Koha/Authority/Types.pm @@ -17,7 +17,6 @@ package Koha::Authority::Types; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/BackgroundJob.pm +++ a/Koha/BackgroundJob.pm @@ -16,10 +16,10 @@ package Koha::BackgroundJob; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); +use JSON qw( decode_json encode_json ); use Carp qw( croak ); use Net::Stomp; -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; use Koha::DateUtils qw( dt_from_string ); --- a/Koha/BackgroundJob/BatchUpdateAuthority.pm +++ a/Koha/BackgroundJob/BatchUpdateAuthority.pm @@ -16,9 +16,9 @@ package Koha::BackgroundJob::BatchUpdateAuthority; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); +use JSON qw( decode_json encode_json ); -use C4::MarcModificationTemplates; +use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); use C4::AuthoritiesMarc; use Koha::BackgroundJobs; use Koha::DateUtils qw( dt_from_string ); --- a/Koha/BackgroundJob/BatchUpdateBiblio.pm +++ a/Koha/BackgroundJob/BatchUpdateBiblio.pm @@ -16,7 +16,7 @@ package Koha::BackgroundJob::BatchUpdateBiblio; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); +use JSON qw( decode_json encode_json ); use Koha::BackgroundJobs; use Koha::DateUtils qw( dt_from_string ); --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -19,13 +19,11 @@ package Koha::Biblio; use Modern::Perl; -use Carp; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); use URI; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); -use C4::Koha; -use C4::Biblio qw(); +use C4::Koha qw( GetNormalizedISBN ); use Koha::Database; use Koha::DateUtils qw( dt_from_string ); --- a/Koha/Biblio/Metadatas.pm +++ a/Koha/Biblio/Metadatas.pm @@ -17,7 +17,6 @@ package Koha::Biblio::Metadatas; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/BiblioFramework.pm +++ a/Koha/BiblioFramework.pm @@ -17,7 +17,6 @@ package Koha::BiblioFramework; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/BiblioFrameworks.pm +++ a/Koha/BiblioFrameworks.pm @@ -17,7 +17,6 @@ package Koha::BiblioFrameworks; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/BiblioUtils.pm +++ a/Koha/BiblioUtils.pm @@ -32,12 +32,11 @@ the new thing that should be used. =cut -use C4::Biblio; # EmbedItemsInMarcBiblio +use C4::Biblio; use Koha::MetadataIterator; use Koha::Database; use Modern::Perl; -use Data::Dumper; # TODO remove use base qw(Koha::MetadataRecord); --- a/Koha/BiblioUtils/Iterator.pm +++ a/Koha/BiblioUtils/Iterator.pm @@ -43,9 +43,9 @@ Returns biblionumber and marc in list context. =cut -use C4::Biblio; # :( - for EmbedItemsInMarcBiblio +use C4::Biblio; -use Carp; +use Carp qw( confess ); use MARC::Record; use MARC::File::XML; use Modern::Perl; --- a/Koha/Biblioitem.pm +++ a/Koha/Biblioitem.pm @@ -17,7 +17,6 @@ package Koha::Biblioitem; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Biblioitems.pm +++ a/Koha/Biblioitems.pm @@ -17,7 +17,6 @@ package Koha::Biblioitems; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Biblios.pm +++ a/Koha/Biblios.pm @@ -19,7 +19,6 @@ package Koha::Biblios; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Cache.pm +++ a/Koha/Cache.pm @@ -40,8 +40,8 @@ The first, traditional OO interface provides the following functions: use strict; use warnings; -use Carp; -use Module::Load::Conditional qw(can_load); +use Carp qw( croak ); +use Module::Load::Conditional qw( can_load ); use Sereal::Encoder; use Sereal::Decoder; --- a/Koha/Cache/Object.pm +++ a/Koha/Cache/Object.pm @@ -52,7 +52,6 @@ scalars and hashes, with arrays a potential future addition. use strict; use warnings; -use Carp; use base qw(Class::Accessor); --- a/Koha/Calendar.pm +++ a/Koha/Calendar.pm @@ -2,7 +2,7 @@ package Koha::Calendar; use Modern::Perl; -use Carp; +use Carp qw( croak ); use DateTime; use DateTime::Duration; use C4::Context; --- a/Koha/Cash/Register.pm +++ a/Koha/Cash/Register.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register; use Modern::Perl; -use Carp; use Koha::Account::Lines; use Koha::Account::Offsets; --- a/Koha/Cash/Register/Action.pm +++ a/Koha/Cash/Register/Action.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Action; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Cash/Register/Actions.pm +++ a/Koha/Cash/Register/Actions.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Actions; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Cash/Register/Cashup.pm +++ a/Koha/Cash/Register/Cashup.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Cashup; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Cash/Register/Cashups.pm +++ a/Koha/Cash/Register/Cashups.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Cashups; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Cash::Register::Cashup; --- a/Koha/Cash/Registers.pm +++ a/Koha/Cash/Registers.pm @@ -17,7 +17,6 @@ package Koha::Cash::Registers; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Charges/Fees.pm +++ a/Koha/Charges/Fees.pm @@ -19,7 +19,7 @@ package Koha::Charges::Fees; use Modern::Perl; -use Carp qw( carp confess ); +use Carp; use Koha::Calendar; use Koha::DateUtils qw( dt_from_string ); --- a/Koha/Checkout.pm +++ a/Koha/Checkout.pm @@ -20,14 +20,13 @@ package Koha::Checkout; use Modern::Perl; -use Carp; use DateTime; -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Circulation qw(MarkIssueReturned); +use C4::Circulation qw( LostItem MarkIssueReturned ); use Koha::Checkouts::ReturnClaims; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::Libraries; --- a/Koha/Checkouts.pm +++ a/Koha/Checkouts.pm @@ -19,13 +19,12 @@ package Koha::Checkouts; use Modern::Perl; -use Carp; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddReturn ); use Koha::Checkout; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use base qw(Koha::Objects); --- a/Koha/Checkouts/ReturnClaims.pm +++ a/Koha/Checkouts/ReturnClaims.pm @@ -19,7 +19,6 @@ package Koha::Checkouts::ReturnClaims; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/CirculationRules.pm +++ a/Koha/CirculationRules.pm @@ -18,7 +18,7 @@ package Koha::CirculationRules; # along with Koha; if not, see . use Modern::Perl; -use Carp qw(croak); +use Carp qw( croak ); use Koha::Exceptions; use Koha::CirculationRule; --- a/Koha/Cities.pm +++ a/Koha/Cities.pm @@ -17,7 +17,6 @@ package Koha::Cities; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/City.pm +++ a/Koha/City.pm @@ -17,7 +17,6 @@ package Koha::City; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/ClassSortRule.pm +++ a/Koha/ClassSortRule.pm @@ -17,7 +17,6 @@ package Koha::ClassSortRule; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/ClassSortRules.pm +++ a/Koha/ClassSortRules.pm @@ -17,7 +17,6 @@ package Koha::ClassSortRules; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/ClassSource.pm +++ a/Koha/ClassSource.pm @@ -17,7 +17,6 @@ package Koha::ClassSource; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/ClassSources.pm +++ a/Koha/ClassSources.pm @@ -17,7 +17,6 @@ package Koha::ClassSources; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/ClassSplitRule.pm +++ a/Koha/ClassSplitRule.pm @@ -17,7 +17,7 @@ package Koha::ClassSplitRule; use Modern::Perl; -use JSON qw(to_json from_json); +use JSON qw( from_json to_json ); use Koha::Database; --- a/Koha/Club.pm +++ a/Koha/Club.pm @@ -19,7 +19,6 @@ package Koha::Club; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Enrollment.pm +++ a/Koha/Club/Enrollment.pm @@ -19,12 +19,11 @@ package Koha::Club::Enrollment; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Clubs; use Koha::Patrons; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use DateTime; use base qw(Koha::Object); --- a/Koha/Club/Enrollment/Field.pm +++ a/Koha/Club/Enrollment/Field.pm @@ -19,7 +19,6 @@ package Koha::Club::Enrollment::Field; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Enrollment/Fields.pm +++ a/Koha/Club/Enrollment/Fields.pm @@ -19,7 +19,6 @@ package Koha::Club::Enrollment::Fields; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Enrollments.pm +++ a/Koha/Club/Enrollments.pm @@ -19,7 +19,6 @@ package Koha::Club::Enrollments; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Field.pm +++ a/Koha/Club/Field.pm @@ -19,7 +19,6 @@ package Koha::Club::Field; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Fields.pm +++ a/Koha/Club/Fields.pm @@ -19,7 +19,6 @@ package Koha::Club::Fields; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Hold.pm +++ a/Koha/Club/Hold.pm @@ -19,7 +19,6 @@ package Koha::Club::Hold; use Modern::Perl; -use Carp; use Koha::Database; @@ -32,7 +31,7 @@ use Koha::Club::Hold::PatronHold; use Koha::Clubs; use Koha::Patrons; -use List::Util 'shuffle'; +use List::Util qw( shuffle ); =head1 NAME --- a/Koha/Club/Hold/PatronHold.pm +++ a/Koha/Club/Hold/PatronHold.pm @@ -19,7 +19,6 @@ package Koha::Club::Hold::PatronHold; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Hold/PatronHolds.pm +++ a/Koha/Club/Hold/PatronHolds.pm @@ -19,7 +19,6 @@ package Koha::Club::Hold::PatronHolds; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Holds.pm +++ a/Koha/Club/Holds.pm @@ -19,7 +19,6 @@ package Koha::Club::Holds; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Template.pm +++ a/Koha/Club/Template.pm @@ -19,7 +19,6 @@ package Koha::Club::Template; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Template/EnrollmentField.pm +++ a/Koha/Club/Template/EnrollmentField.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::EnrollmentField; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Template/EnrollmentFields.pm +++ a/Koha/Club/Template/EnrollmentFields.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::EnrollmentFields; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Template/Field.pm +++ a/Koha/Club/Template/Field.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::Field; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Template/Fields.pm +++ a/Koha/Club/Template/Fields.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::Fields; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Club/Templates.pm +++ a/Koha/Club/Templates.pm @@ -19,7 +19,6 @@ package Koha::Club::Templates; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Clubs.pm +++ a/Koha/Clubs.pm @@ -19,7 +19,6 @@ package Koha::Clubs; use Modern::Perl; -use Carp; use Koha::Database; use Koha::DateUtils qw( dt_from_string ); --- a/Koha/Config.pm +++ a/Koha/Config.pm @@ -17,7 +17,7 @@ package Koha::Config; use Modern::Perl; -use XML::LibXML ':libxml'; +use XML::LibXML qw( XML_ELEMENT_NODE XML_TEXT_NODE ); # Default config file, if none is specified use constant CONFIG_FNAME => "/etc/koha/koha-conf.xml"; --- a/Koha/Config/SysPref.pm +++ a/Koha/Config/SysPref.pm @@ -19,7 +19,6 @@ package Koha::Config::SysPref; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Config/SysPrefs.pm +++ a/Koha/Config/SysPrefs.pm @@ -19,7 +19,6 @@ package Koha::Config::SysPrefs; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Course.pm +++ a/Koha/Course.pm @@ -17,7 +17,6 @@ package Koha::Course; use Modern::Perl; -use Carp; use base qw(Koha::Object); --- a/Koha/Course/Instructor.pm +++ a/Koha/Course/Instructor.pm @@ -17,7 +17,6 @@ package Koha::Course::Instructor; use Modern::Perl; -use Carp; use base qw(Koha::Object); --- a/Koha/Course/Instructors.pm +++ a/Koha/Course/Instructors.pm @@ -17,7 +17,6 @@ package Koha::Course::Instructors; use Modern::Perl; -use Carp; use Koha::Course::Instructor; --- a/Koha/Course/Item.pm +++ a/Koha/Course/Item.pm @@ -17,7 +17,6 @@ package Koha::Course::Item; use Modern::Perl; -use Carp; use base qw(Koha::Object); --- a/Koha/Course/Items.pm +++ a/Koha/Course/Items.pm @@ -17,7 +17,6 @@ package Koha::Course::Items; use Modern::Perl; -use Carp; use Koha::Course::Item; --- a/Koha/Course/Reserve.pm +++ a/Koha/Course/Reserve.pm @@ -17,7 +17,6 @@ package Koha::Course::Reserve; use Modern::Perl; -use Carp; use base qw(Koha::Object); --- a/Koha/Course/Reserves.pm +++ a/Koha/Course/Reserves.pm @@ -17,7 +17,6 @@ package Koha::Course::Reserves; use Modern::Perl; -use Carp; use Koha::Course::Reserve; --- a/Koha/Courses.pm +++ a/Koha/Courses.pm @@ -17,7 +17,6 @@ package Koha::Courses; use Modern::Perl; -use Carp; use Koha::Course; --- a/Koha/CoverImage.pm +++ a/Koha/CoverImage.pm @@ -17,7 +17,6 @@ package Koha::CoverImage; use Modern::Perl; -use Carp; use GD; use Koha::Database; --- a/Koha/CoverImages.pm +++ a/Koha/CoverImages.pm @@ -17,7 +17,6 @@ package Koha::CoverImages; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/CsvProfile.pm +++ a/Koha/CsvProfile.pm @@ -17,7 +17,6 @@ package Koha::CsvProfile; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/CsvProfiles.pm +++ a/Koha/CsvProfiles.pm @@ -17,7 +17,6 @@ package Koha::CsvProfiles; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Database.pm +++ a/Koha/Database.pm @@ -33,7 +33,6 @@ Koha::Database =cut use Modern::Perl; -use Carp; use C4::Context; use base qw(Class::Accessor); --- a/Koha/Desk.pm +++ a/Koha/Desk.pm @@ -18,7 +18,6 @@ package Koha::Desk; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Desks.pm +++ a/Koha/Desks.pm @@ -19,7 +19,6 @@ package Koha::Desks; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/EDI.pm +++ a/Koha/EDI.pm @@ -21,28 +21,44 @@ use strict; use warnings; use base qw(Exporter); use utf8; -use Carp; +use Carp qw( carp ); use English qw{ -no_match_vars }; use Business::ISBN; use DateTime; use C4::Context; use Koha::Database; -use Koha::DateUtils; -use C4::Acquisition qw( NewBasket ModOrder); +use Koha::DateUtils qw( dt_from_string ); +use C4::Acquisition qw( ModOrder NewBasket ); use C4::Suggestions qw( ModSuggestion ); -use C4::Biblio qw( AddBiblio TransformKohaToMarc GetMarcBiblio GetFrameworkCode GetMarcFromKohaField ); +use C4::Biblio qw( + AddBiblio + GetFrameworkCode + GetMarcFromKohaField + TransformKohaToMarc +); use Koha::Edifact::Order; use Koha::Edifact; -use C4::Log qw(logaction); +use C4::Log qw( logaction ); use Log::Log4perl; -use Text::Unidecode; +use Text::Unidecode qw( unidecode ); use Koha::Plugins::Handler; use Koha::Acquisition::Baskets; use Koha::Acquisition::Booksellers; our $VERSION = 1.1; -our @EXPORT_OK = - qw( process_quote process_invoice process_ordrsp create_edi_order get_edifact_ean ); + +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + process_quote + process_invoice + process_ordrsp + create_edi_order + get_edifact_ean + ); +}; sub create_edi_order { my $parameters = shift; --- a/Koha/Edifact.pm +++ a/Koha/Edifact.pm @@ -19,9 +19,8 @@ package Koha::Edifact; use strict; use warnings; -use File::Slurp; -use Carp; -use Encode qw( from_to ); +use File::Slurp qw( read_file ); +use Carp qw( carp croak ); use Koha::Edifact::Segment; use Koha::Edifact::Message; --- a/Koha/Edifact/Line.pm +++ a/Koha/Edifact/Line.pm @@ -23,7 +23,7 @@ use utf8; use MARC::Record; use MARC::Field; -use Carp; +use Carp qw( carp ); sub new { my ( $class, $data_array_ref ) = @_; --- a/Koha/Edifact/Order.pm +++ a/Koha/Edifact/Order.pm @@ -21,12 +21,11 @@ use utf8; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use Carp; +use Carp qw( carp ); use DateTime; -use Readonly; -use Business::ISBN; +use Readonly qw( Readonly ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use C4::Budgets qw( GetBudget ); use Koha::Acquisition::Orders; --- a/Koha/Edifact/Transport.pm +++ a/Koha/Edifact/Transport.pm @@ -21,15 +21,14 @@ use strict; use warnings; use utf8; use DateTime; -use Carp; +use Carp qw( carp ); use English qw{ -no_match_vars }; use Net::FTP; use Net::SFTP::Foreign; -use File::Slurp; -use File::Copy; -use File::Basename qw( fileparse ); +use File::Slurp qw( read_file ); +use File::Copy qw( copy move ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Encode qw( from_to ); sub new { --- a/Koha/Email.pm +++ a/Koha/Email.pm @@ -22,7 +22,7 @@ use Modern::Perl; use Email::Valid; use Email::MessageID; -use List::Util qw(pairs); +use List::Util qw( pairs ); use Koha::Exceptions; --- a/Koha/Exporter/Record.pm +++ a/Koha/Exporter/Record.pm @@ -5,11 +5,11 @@ use MARC::File::XML; use MARC::File::USMARC; use C4::AuthoritiesMarc; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField ); use C4::Record; use Koha::CsvProfiles; use Koha::Logger; -use List::Util qw(all any); +use List::Util qw( all any ); sub _get_record_for_export { my ($params) = @_; --- a/Koha/ExternalContent.pm +++ a/Koha/ExternalContent.pm @@ -18,7 +18,7 @@ package Koha::ExternalContent; use Modern::Perl; -use Carp; +use Carp qw( croak ); use base qw(Class::Accessor); use Koha; --- a/Koha/ExternalContent/OverDrive.pm +++ a/Koha/ExternalContent/OverDrive.pm @@ -18,7 +18,7 @@ package Koha::ExternalContent::OverDrive; use Modern::Perl; -use Carp; +use Carp qw( croak ); use base qw(Koha::ExternalContent); use WebService::ILS::OverDrive::Patron; --- a/Koha/ExternalContent/RecordedBooks.pm +++ a/Koha/ExternalContent/RecordedBooks.pm @@ -18,7 +18,7 @@ package Koha::ExternalContent::RecordedBooks; use Modern::Perl; -use Carp; +use Carp qw( croak ); use base qw(Koha::ExternalContent); use WebService::ILS::RecordedBooks::PartnerPatron; --- a/Koha/Filter/MARC/EmbedItemsAvailability.pm +++ a/Koha/Filter/MARC/EmbedItemsAvailability.pm @@ -32,7 +32,7 @@ Filter to embed items not on loan count information into MARC records. use Modern::Perl; -use C4::Biblio qw/GetMarcFromKohaField/; +use C4::Biblio qw( GetMarcFromKohaField ); use Koha::Items; use base qw(Koha::RecordProcessor::Base); --- a/Koha/Filter/MARC/EmbedSeeFromHeadings.pm +++ a/Koha/Filter/MARC/EmbedSeeFromHeadings.pm @@ -32,9 +32,8 @@ Filter to embed see from headings into MARC records. use strict; use warnings; -use Carp; use Koha::MetadataRecord::Authority; -use C4::Biblio qw/GetMarcFromKohaField/; +use C4::Biblio qw( GetMarcFromKohaField ); use base qw(Koha::RecordProcessor::Base); our $NAME = 'EmbedSeeFromHeadings'; --- a/Koha/Filter/MARC/Null.pm +++ a/Koha/Filter/MARC/Null.pm @@ -33,7 +33,6 @@ RecordProcessor. use strict; use warnings; -use Carp; use base qw(Koha::RecordProcessor::Base); our $NAME = 'Null'; --- a/Koha/Filter/MARC/ViewPolicy.pm +++ a/Koha/Filter/MARC/ViewPolicy.pm @@ -39,8 +39,7 @@ menu. =cut use Modern::Perl; -use Carp; -use C4::Biblio; +use C4::Biblio qw( GetMarcStructure ); use base qw(Koha::RecordProcessor::Base); our $NAME = 'MARC_ViewPolicy'; @@ -86,7 +85,7 @@ sub filter { my $result = $current_record; my $hide = _should_hide_on_interface(); - my $marcsubfieldstructure = GetMarcStructure( 0, $frameworkcode, { unsafe => 1 } ); + my $marcsubfieldstructure = C4::Biblio::GetMarcStructure( 0, $frameworkcode, { unsafe => 1 } ); #if ($marcsubfieldstructure->{'000'}->{'@'}->{hidden}>0) { # LDR field is excluded from $current_record->fields(). --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -20,16 +20,15 @@ package Koha::Hold; use Modern::Perl; -use Carp; -use Data::Dumper qw(Dumper); -use List::MoreUtils qw(any); +use Data::Dumper qw( Dumper ); +use List::MoreUtils qw( any ); use C4::Context qw(preference); -use C4::Letters; -use C4::Log; +use C4::Letters qw( GetPreparedLetter EnqueueLetter ); +use C4::Log qw( logaction ); use Koha::AuthorisedValues; -use Koha::DateUtils qw(dt_from_string output_pref); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use Koha::Biblios; use Koha::Items; --- a/Koha/Holds.pm +++ a/Koha/Holds.pm @@ -19,7 +19,6 @@ package Koha::Holds; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/I18N.pm +++ a/Koha/I18N.pm @@ -19,14 +19,21 @@ package Koha::I18N; use Modern::Perl; -use CGI; use C4::Languages; use C4::Context; use Encode; use List::Util qw( first ); -use Locale::Messages qw(:locale_h LC_MESSAGES); -use POSIX qw( setlocale ); +use Locale::Messages qw( + bindtextdomain + gettext + LC_MESSAGES + ngettext + npgettext + pgettext + textdomain +); +use POSIX; use Koha::Cache::Memory::Lite; use parent 'Exporter'; --- a/Koha/Illrequest.pm +++ a/Koha/Illrequest.pm @@ -19,16 +19,13 @@ package Koha::Illrequest; use Modern::Perl; -use Clone 'clone'; -use File::Basename qw( basename ); -use Encode qw( encode ); -use Try::Tiny; +use Clone qw( clone ); +use Try::Tiny qw( catch try ); use DateTime; use C4::Letters; -use C4::Members; use Koha::Database; -use Koha::DateUtils qw/ dt_from_string /; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Ill; use Koha::Illcomments; use Koha::Illrequestattributes; @@ -41,7 +38,7 @@ use Koha::Items; use Koha::ItemTypes; use Koha::Libraries; -use C4::Circulation qw( CanBookBeIssued AddIssue ); +use C4::Circulation qw( CanBookBeIssued AddIssue ); use base qw(Koha::Object); --- a/Koha/Illrequest/Config.pm +++ a/Koha/Illrequest/Config.pm @@ -19,7 +19,7 @@ package Koha::Illrequest::Config; use Modern::Perl; -use File::Basename qw/basename/; +use File::Basename qw( basename ); use C4::Context; --- a/Koha/Illrequest/Logger.pm +++ a/Koha/Illrequest/Logger.pm @@ -18,10 +18,9 @@ package Koha::Illrequest::Logger; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( to_json from_json ); -use Time::Local; +use JSON qw( from_json to_json ); -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); use C4::Context; use C4::Templates; use C4::Log qw( logaction ); --- a/Koha/Item.pm +++ a/Koha/Item.pm @@ -19,18 +19,16 @@ package Koha::Item; use Modern::Perl; -use Carp; -use List::MoreUtils qw(any); -use Data::Dumper; -use Try::Tiny; +use List::MoreUtils qw( any ); +use Data::Dumper qw( Dumper ); use Koha::Database; use Koha::DateUtils qw( dt_from_string ); use C4::Context; -use C4::Circulation; +use C4::Circulation qw( GetBranchItemRule ); use C4::Reserves; -use C4::ClassSource; # FIXME We would like to avoid that +use C4::ClassSource qw( GetClassSort ); use C4::Log qw( logaction ); use Koha::Checkouts; --- a/Koha/Item/Search/Field.pm +++ a/Koha/Item/Search/Field.pm @@ -1,15 +1,19 @@ package Koha::Item::Search::Field; use Modern::Perl; -use base qw( Exporter ); - -our @EXPORT_OK = qw( - AddItemSearchField - ModItemSearchField - DelItemSearchField - GetItemSearchField - GetItemSearchFields -); + +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + AddItemSearchField + ModItemSearchField + DelItemSearchField + GetItemSearchField + GetItemSearchFields + ); +}; use C4::Context; --- a/Koha/Item/Transfer.pm +++ a/Koha/Item/Transfer.pm @@ -17,12 +17,11 @@ package Koha::Item::Transfer; use Modern::Perl; -use Carp; -use C4::Items; +use C4::Items qw( CartToShelf ModDateLastSeen ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Item::Transfer; use base qw(Koha::Object); --- a/Koha/Item/Transfer/Limit.pm +++ a/Koha/Item/Transfer/Limit.pm @@ -18,7 +18,6 @@ package Koha::Item::Transfer::Limit; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Item/Transfers.pm +++ a/Koha/Item/Transfers.pm @@ -17,7 +17,6 @@ package Koha::Item::Transfers; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/ItemType.pm +++ a/Koha/ItemType.pm @@ -17,9 +17,8 @@ package Koha::ItemType; use Modern::Perl; -use Carp; -use C4::Koha; +use C4::Koha qw( getitemtypeimagelocation ); use C4::Languages; use Koha::Database; use Koha::CirculationRules; --- a/Koha/ItemTypes.pm +++ a/Koha/ItemTypes.pm @@ -17,7 +17,6 @@ package Koha::ItemTypes; use Modern::Perl; -use Carp; use C4::Languages; --- a/Koha/Items.pm +++ a/Koha/Items.pm @@ -19,7 +19,6 @@ package Koha::Items; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/KeyboardShortcut.pm +++ a/Koha/KeyboardShortcut.pm @@ -17,7 +17,6 @@ package Koha::KeyboardShortcut; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/KeyboardShortcuts.pm +++ a/Koha/KeyboardShortcuts.pm @@ -17,7 +17,6 @@ package Koha::KeyboardShortcuts; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Libraries.pm +++ a/Koha/Libraries.pm @@ -19,7 +19,6 @@ package Koha::Libraries; use Modern::Perl; -use Carp; use C4::Context; --- a/Koha/Library.pm +++ a/Koha/Library.pm @@ -19,7 +19,6 @@ package Koha::Library; use Modern::Perl; -use Carp; use C4::Context; --- a/Koha/Library/Group.pm +++ a/Koha/Library/Group.pm @@ -19,10 +19,9 @@ package Koha::Library::Group; use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Libraries; use base qw(Koha::Object); --- a/Koha/Library/Groups.pm +++ a/Koha/Library/Groups.pm @@ -19,7 +19,6 @@ package Koha::Library::Groups; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Library/OverDriveInfo.pm +++ a/Koha/Library/OverDriveInfo.pm @@ -17,7 +17,6 @@ package Koha::Library::OverDriveInfo; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Library/OverDriveInfos.pm +++ a/Koha/Library/OverDriveInfos.pm @@ -17,7 +17,6 @@ package Koha::Library::OverDriveInfos; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Linktracker.pm +++ a/Koha/Linktracker.pm @@ -32,7 +32,6 @@ Koha::Linktracker =cut use Modern::Perl; -use Carp; use C4::Context; use base qw(Class::Accessor); --- a/Koha/List/Patron.pm +++ a/Koha/List/Patron.pm @@ -27,7 +27,7 @@ Koha::List::Patron - Management of lists of patrons use Modern::Perl; -use Carp; +use Carp qw( carp croak ); use Koha::Database; --- a/Koha/Logger.pm +++ a/Koha/Logger.pm @@ -37,7 +37,6 @@ Koha::Logger use Modern::Perl; use Log::Log4perl; -use Carp; use C4::Context; --- a/Koha/MarcSubfieldStructure.pm +++ a/Koha/MarcSubfieldStructure.pm @@ -17,7 +17,6 @@ package Koha::MarcSubfieldStructure; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/MarcSubfieldStructures.pm +++ a/Koha/MarcSubfieldStructures.pm @@ -17,7 +17,6 @@ package Koha::MarcSubfieldStructures; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/MessageAttribute.pm +++ a/Koha/MessageAttribute.pm @@ -19,7 +19,6 @@ package Koha::MessageAttribute; use Modern::Perl; -use Carp; use base qw(Koha::Object); --- a/Koha/MessageAttributes.pm +++ a/Koha/MessageAttributes.pm @@ -19,7 +19,6 @@ package Koha::MessageAttributes; use Modern::Perl; -use Carp; use base qw(Koha::Objects); use Koha::MessageAttribute; --- a/Koha/MetaSearcher.pm +++ a/Koha/MetaSearcher.pm @@ -22,14 +22,14 @@ use Modern::Perl; use base 'Class::Accessor'; use C4::Charset qw( MarcToUTF8Record SetUTF8Flag ); -use C4::Search qw(); # Purely for new_record_from_zebra +use C4::Search qw( new_record_from_zebra ); use DBIx::Class::ResultClass::HashRefInflator; use IO::Select; use Koha::Caches; use Koha::Database; use Koha::MetadataRecord; use MARC::File::XML; -use Storable qw( store_fd fd_retrieve ); +use Storable qw( fd_retrieve store_fd ); use Time::HiRes qw( clock_gettime CLOCK_MONOTONIC ); use UUID; use ZOOM; --- a/Koha/MetadataRecord.pm +++ a/Koha/MetadataRecord.pm @@ -34,7 +34,7 @@ and authority) records in Koha. use Modern::Perl; -use Carp; +use Carp qw( carp ); use C4::Biblio; use Koha::Util::MARC; --- a/Koha/MetadataRecord/Authority.pm +++ a/Koha/MetadataRecord/Authority.pm @@ -33,11 +33,10 @@ Authority data. use strict; use warnings; -use Carp; use C4::Context; use MARC::Record; use MARC::File::XML; -use C4::Charset; +use C4::Charset qw( StripNonXmlChars ); use Koha::Util::MARC; use base qw(Koha::MetadataRecord); --- a/Koha/News.pm +++ a/Koha/News.pm @@ -19,7 +19,6 @@ package Koha::News; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; --- a/Koha/NewsItem.pm +++ a/Koha/NewsItem.pm @@ -19,10 +19,9 @@ package Koha::NewsItem; use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Libraries; use Koha::Patrons; --- a/Koha/Notice/Message.pm +++ a/Koha/Notice/Message.pm @@ -17,7 +17,6 @@ package Koha::Notice::Message; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Notice/Messages.pm +++ a/Koha/Notice/Messages.pm @@ -17,7 +17,6 @@ package Koha::Notice::Messages; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Notice/Template.pm +++ a/Koha/Notice/Template.pm @@ -17,7 +17,6 @@ package Koha::Notice::Template; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Notice/Templates.pm +++ a/Koha/Notice/Templates.pm @@ -17,7 +17,6 @@ package Koha::Notice::Templates; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/OAI/Server/Description.pm +++ a/Koha/OAI/Server/Description.pm @@ -20,7 +20,7 @@ package Koha::OAI::Server::Description; use Modern::Perl; use HTTP::OAI; -use HTTP::OAI::SAXHandler qw/ :SAX /; +use HTTP::OAI::SAXHandler qw( g_data_element ); sub new { --- a/Koha/OAI/Server/GetRecord.pm +++ a/Koha/OAI/Server/GetRecord.pm @@ -20,8 +20,7 @@ package Koha::OAI::Server::GetRecord; use Modern::Perl; use HTTP::OAI; -use C4::Biblio; -use C4::OAI::Sets; +use C4::OAI::Sets qw( GetOAISetsBiblio ); use MARC::File::XML; use base ("HTTP::OAI::GetRecord"); --- a/Koha/OAI/Server/ListBase.pm +++ a/Koha/OAI/Server/ListBase.pm @@ -28,12 +28,11 @@ Koha::OAI::Server::ListBase contains OAI-PMH functions shared by ListIdentifiers =cut use Modern::Perl; -use C4::Biblio; use HTTP::OAI; use Koha::OAI::Server::ResumptionToken; use Koha::OAI::Server::Record; use Koha::OAI::Server::DeletedRecord; -use C4::OAI::Sets; +use C4::OAI::Sets qw( GetOAISetBySpec GetOAISetsBiblio ); use MARC::File::XML; sub GetRecords { --- a/Koha/OAI/Server/ListSets.pm +++ a/Koha/OAI/Server/ListSets.pm @@ -22,7 +22,7 @@ use Modern::Perl; use HTTP::OAI; use Koha::OAI::Server::ResumptionToken; use Koha::OAI::Server::Description; -use C4::OAI::Sets; +use C4::OAI::Sets qw( GetOAISets ); use base ("HTTP::OAI::ListSets"); --- a/Koha/OAI/Server/Repository.pm +++ a/Koha/OAI/Server/Repository.pm @@ -21,7 +21,7 @@ package Koha::OAI::Server::Repository; use Modern::Perl; use HTTP::OAI; -use HTTP::OAI::Repository qw/:validate/; +use HTTP::OAI::Repository qw( validate_request ); use base ("HTTP::OAI::Repository"); @@ -35,7 +35,7 @@ use XML::SAX::Writer; use YAML::XS; use CGI qw/:standard -oldstyle_urls/; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ); use Koha::XSLT::Base; =head1 NAME --- a/Koha/Object.pm +++ a/Koha/Object.pm @@ -20,14 +20,14 @@ package Koha::Object; use Modern::Perl; -use Carp; +use Carp qw( croak ); use Mojo::JSON; use Scalar::Util qw( blessed looks_like_number ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Database; use Koha::Exceptions::Object; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Object::Message; =head1 NAME --- a/Koha/Object/Limit/Library.pm +++ a/Koha/Object/Limit/Library.pm @@ -21,7 +21,7 @@ use Koha::Database; use Koha::Exceptions; use Koha::Libraries; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/Objects.pm +++ a/Koha/Objects.pm @@ -19,7 +19,7 @@ package Koha::Objects; use Modern::Perl; -use Carp; +use Carp qw( carp ); use List::MoreUtils qw( none ); use Class::Inspector; --- a/Koha/Old/Holds.pm +++ a/Koha/Old/Holds.pm @@ -19,7 +19,6 @@ package Koha::Old::Holds; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Patron.pm +++ a/Koha/Patron.pm @@ -20,21 +20,20 @@ package Koha::Patron; use Modern::Perl; -use Carp; use List::MoreUtils qw( any uniq ); use JSON qw( to_json ); -use Unicode::Normalize; +use Unicode::Normalize qw( NFKD ); use C4::Context; -use C4::Log; +use C4::Log qw( logaction ); use Koha::Account; use Koha::ArticleRequests; -use C4::Letters qw( GetPreparedLetter EnqueueLetter ); +use C4::Letters; use Koha::AuthUtils; use Koha::Checkouts; use Koha::Club::Enrollments; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Password; use Koha::Holds; use Koha::Old::Checkouts; --- a/Koha/Patron/Category.pm +++ a/Koha/Patron/Category.pm @@ -17,13 +17,12 @@ package Koha::Patron::Category; use Modern::Perl; -use Carp; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); use C4::Members::Messaging; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use base qw(Koha::Object Koha::Object::Limit::Library); --- a/Koha/Patron/Discharge.pm +++ a/Koha/Patron/Discharge.pm @@ -2,11 +2,11 @@ package Koha::Patron::Discharge; use Modern::Perl; use CGI; -use File::Temp qw( :POSIX ); -use Carp; +use File::Temp qw( tmpnam ); +use Carp qw( carp ); use C4::Templates qw ( gettemplate ); -use C4::Letters qw ( GetPreparedLetter ); +use C4::Letters qw( GetPreparedLetter ); use Koha::Database; use Koha::DateUtils qw( dt_from_string output_pref ); --- a/Koha/Patron/Image.pm +++ a/Koha/Patron/Image.pm @@ -17,7 +17,6 @@ package Koha::Patron::Image; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Patron/Images.pm +++ a/Koha/Patron/Images.pm @@ -17,7 +17,6 @@ package Koha::Patron::Images; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Patron/Message.pm +++ a/Koha/Patron/Message.pm @@ -17,10 +17,9 @@ package Koha::Patron::Message; use Modern::Perl; -use Carp; use C4::Context; -use C4::Log qw( logaction ); +use C4::Log; use Koha::Database; --- a/Koha/Patron/Messages.pm +++ a/Koha/Patron/Messages.pm @@ -17,7 +17,6 @@ package Koha::Patron::Messages; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Patron/Modification.pm +++ a/Koha/Patron/Modification.pm @@ -19,7 +19,6 @@ package Koha::Patron::Modification; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions::Patron::Modification; @@ -27,9 +26,9 @@ use Koha::Patron::Attribute; use Koha::Patron::Attributes; use Koha::Patron::Modifications; -use JSON; -use List::MoreUtils qw( uniq any ); -use Try::Tiny; +use JSON qw( from_json ); +use List::MoreUtils qw( any uniq ); +use Try::Tiny qw( catch try ); use base qw(Koha::Object); --- a/Koha/Patron/Modifications.pm +++ a/Koha/Patron/Modifications.pm @@ -29,8 +29,8 @@ use C4::Context; use Koha::Patron::Attribute; use Koha::Patron::Modification; -use JSON; -use List::Util qw /any none/; +use JSON qw( from_json ); +use List::Util qw( none ); use base qw(Koha::Objects); --- a/Koha/Patron/Password/Recovery.pm +++ a/Koha/Patron/Password/Recovery.pm @@ -20,15 +20,14 @@ package Koha::Patron::Password::Recovery; use Modern::Perl; use C4::Context; use C4::Letters; -use Crypt::Eksblowfish::Bcrypt qw(en_base64); -use Koha::DateUtils; - -use vars qw(@ISA @EXPORT); +use Crypt::Eksblowfish::Bcrypt qw( en_base64 ); +use Koha::DateUtils qw( dt_from_string ); +our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @ISA = qw(Exporter); - push @EXPORT, qw( + @EXPORT_OK = qw( &ValidateBorrowernumber &SendPasswordRecoveryEmail &GetValidLinkInfo --- a/Koha/Patron/Relationship.pm +++ a/Koha/Patron/Relationship.pm @@ -17,9 +17,8 @@ package Koha::Patron::Relationship; use Modern::Perl; -use Carp; use List::MoreUtils qw( any ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Database; use Koha::Exceptions::Patron::Relationship; --- a/Koha/Patron/Relationships.pm +++ a/Koha/Patron/Relationships.pm @@ -17,7 +17,6 @@ package Koha::Patron::Relationships; use Modern::Perl; -use Carp; use List::MoreUtils qw( uniq ); use Koha::Database; --- a/Koha/Patrons.pm +++ a/Koha/Patrons.pm @@ -20,17 +20,15 @@ package Koha::Patrons; use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::ArticleRequests; use Koha::ArticleRequest::Status; use Koha::Patron; use Koha::Exceptions::Patron; use Koha::Patron::Categories; -use Date::Calc qw( Today Add_Delta_YMD ); use base qw(Koha::Objects); --- a/Koha/Patrons/Import.pm +++ a/Koha/Patrons/Import.pm @@ -17,20 +17,19 @@ package Koha::Patrons::Import; use Modern::Perl; use Moo; -use namespace::clean; -use Carp; +use Carp qw( carp ); use Text::CSV; use Encode qw( decode_utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Members; +use C4::Members qw( checkcardnumber ); use Koha::Libraries; use Koha::Patrons; use Koha::Patron::Categories; -use Koha::Patron::Debarments; -use Koha::DateUtils; +use Koha::Patron::Debarments qw( AddDebarment GetDebarments ); +use Koha::DateUtils qw( dt_from_string output_pref ); =head1 NAME --- a/Koha/Plugins.pm +++ a/Koha/Plugins.pm @@ -19,13 +19,14 @@ package Koha::Plugins; use Modern::Perl; -use Array::Utils qw(array_minus); +use Array::Utils qw( array_minus ); use Class::Inspector; -use List::MoreUtils qw(any); -use Module::Load::Conditional qw(can_load); -use Module::Load qw(load); +use List::MoreUtils qw( any ); +use Module::Load::Conditional qw( can_load ); +use Module::Load; use Module::Pluggable search_path => ['Koha::Plugin'], except => qr/::Edifact(|::Line|::Message|::Order|::Segment|::Transport)$/; + use C4::Context; use C4::Output; use Koha::Plugins::Methods; --- a/Koha/Plugins/Base.pm +++ a/Koha/Plugins/Base.pm @@ -19,14 +19,13 @@ package Koha::Plugins::Base; use Modern::Perl; -use Module::Pluggable require => 1; -use Cwd qw(abs_path); -use List::Util qw(max); +use Cwd qw( abs_path ); +use List::Util qw( max ); use base qw{Module::Bundled::Files}; use C4::Context; -use C4::Output qw(output_with_http_headers output_html_with_http_headers); +use C4::Output qw( output_with_http_headers ); =head1 NAME --- a/Koha/Plugins/Handler.pm +++ a/Koha/Plugins/Handler.pm @@ -19,10 +19,10 @@ package Koha::Plugins::Handler; use Modern::Perl; -use Array::Utils qw(array_minus); -use File::Path qw(remove_tree); +use Array::Utils qw( array_minus ); +use File::Path qw( remove_tree ); -use Module::Load qw(load); +use Module::Load qw( load ); use C4::Context; use Koha::Plugins::Methods; --- a/Koha/Plugins/Method.pm +++ a/Koha/Plugins/Method.pm @@ -17,7 +17,6 @@ package Koha::Plugins::Method; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Plugins/Methods.pm +++ a/Koha/Plugins/Methods.pm @@ -17,7 +17,6 @@ package Koha::Plugins::Methods; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/PseudonymizedTransaction.pm +++ a/Koha/PseudonymizedTransaction.pm @@ -16,8 +16,7 @@ package Koha::PseudonymizedTransaction; use Modern::Perl; -use Carp; -use Crypt::Eksblowfish::Bcrypt qw(bcrypt en_base64); +use Crypt::Eksblowfish::Bcrypt qw( bcrypt ); use Koha::Database; use Koha::Exceptions::Config; --- a/Koha/PseudonymizedTransactions.pm +++ a/Koha/PseudonymizedTransactions.pm @@ -16,7 +16,6 @@ package Koha::PseudonymizedTransactions; use Modern::Perl; -use Carp; use Koha::Database; use Koha::PseudonymizedTransaction; --- a/Koha/Quote.pm +++ a/Koha/Quote.pm @@ -16,7 +16,6 @@ package Koha::Quote; # along with Koha; if not, see . use Modern::Perl; -use Carp; use Koha::Database; use Koha::Quotes; --- a/Koha/Quotes.pm +++ a/Koha/Quotes.pm @@ -16,10 +16,9 @@ package Koha::Quotes; # along with Koha; if not, see . use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Quote; use base qw(Koha::Objects); --- a/Koha/REST/Plugin/PluginRoutes.pm +++ a/Koha/REST/Plugin/PluginRoutes.pm @@ -23,8 +23,8 @@ use Koha::Exceptions::Plugin; use Koha::Plugins; use Koha::Logger; -use Clone qw(clone); -use Try::Tiny; +use Clone qw( clone ); +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/Plugin/Query.pm +++ a/Koha/REST/Plugin/Query.pm @@ -18,9 +18,9 @@ package Koha::REST::Plugin::Query; use Modern::Perl; use Mojo::Base 'Mojolicious::Plugin'; -use List::MoreUtils qw(any); -use Scalar::Util qw(reftype); -use JSON qw(decode_json); +use List::MoreUtils qw( any ); +use Scalar::Util qw( reftype ); +use JSON qw( decode_json ); use Koha::Exceptions; --- a/Koha/REST/V1.pm +++ a/Koha/REST/V1.pm @@ -23,7 +23,7 @@ use C4::Context; use Koha::Logger; use JSON::Validator::OpenAPI::Mojolicious; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Acquisitions/Funds.pm +++ a/Koha/REST/V1/Acquisitions/Funds.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Acquisition::Funds; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Acquisitions/Orders.pm +++ a/Koha/REST/V1/Acquisitions/Orders.pm @@ -20,12 +20,10 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; use Koha::Acquisition::Orders; -use Koha::DateUtils; -use Clone 'clone'; -use JSON qw(decode_json); +use Clone qw( clone ); use Scalar::Util qw( blessed ); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Acquisitions/Vendors.pm +++ a/Koha/REST/V1/Acquisitions/Vendors.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Acquisition::Booksellers; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/AdvancedEditorMacro.pm +++ a/Koha/REST/V1/AdvancedEditorMacro.pm @@ -19,7 +19,7 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; use Koha::AdvancedEditorMacros; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 Name --- a/Koha/REST/V1/Auth.pm +++ a/Koha/REST/V1/Auth.pm @@ -38,10 +38,10 @@ use Koha::Exceptions; use Koha::Exceptions::Authentication; use Koha::Exceptions::Authorization; -use MIME::Base64; +use MIME::Base64 qw( decode_base64 ); use Module::Load::Conditional; use Scalar::Util qw( blessed ); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Biblios.pm +++ a/Koha/REST/V1/Biblios.pm @@ -21,12 +21,12 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Biblios; use Koha::RecordProcessor; -use C4::Biblio qw(DelBiblio); +use C4::Biblio qw( DelBiblio ); -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); use MARC::Record::MiJ; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API --- a/Koha/REST/V1/CashRegisters/Cashups.pm +++ a/Koha/REST/V1/CashRegisters/Cashups.pm @@ -19,8 +19,7 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Cash::Registers; --- a/Koha/REST/V1/Checkouts.pm +++ a/Koha/REST/V1/Checkouts.pm @@ -22,11 +22,11 @@ use Mojo::JSON; use C4::Auth qw( haspermission ); use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddRenewal ); use Koha::Checkouts; use Koha::Old::Checkouts; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/CirculationRules.pm +++ a/Koha/REST/V1/CirculationRules.pm @@ -21,7 +21,6 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::CirculationRules; -use Try::Tiny; =head1 API --- a/Koha/REST/V1/Cities.pm +++ a/Koha/REST/V1/Cities.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Cities; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API --- a/Koha/REST/V1/Clubs/Holds.pm +++ a/Koha/REST/V1/Clubs/Holds.pm @@ -19,7 +19,6 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use C4::Biblio; use C4::Reserves; use Koha::Items; @@ -27,11 +26,10 @@ use Koha::Patrons; use Koha::Holds; use Koha::Clubs; use Koha::Club::Hold; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); -use Scalar::Util qw(blessed); -use Try::Tiny; -use List::Util 'shuffle'; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); =head1 API --- a/Koha/REST/V1/Config/SMTP/Servers.pm +++ a/Koha/REST/V1/Config/SMTP/Servers.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::SMTP::Servers; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API --- a/Koha/REST/V1/Holds.pm +++ a/Koha/REST/V1/Holds.pm @@ -19,18 +19,17 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Mojo::JSON qw(decode_json); +use Mojo::JSON; -use C4::Biblio; use C4::Reserves; use Koha::Items; use Koha::Patrons; use Koha::Holds; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); -use List::MoreUtils qw(any); -use Try::Tiny; +use List::MoreUtils qw( any ); +use Try::Tiny qw( catch try ); =head1 API --- a/Koha/REST/V1/ImportBatchProfiles.pm +++ a/Koha/REST/V1/ImportBatchProfiles.pm @@ -22,7 +22,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::ImportBatchProfiles; use Koha::ImportBatchProfile; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Items.pm +++ a/Koha/REST/V1/Items.pm @@ -21,8 +21,8 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Items; -use List::MoreUtils qw(any); -use Try::Tiny; +use List::MoreUtils qw( any ); +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Libraries.pm +++ a/Koha/REST/V1/Libraries.pm @@ -22,7 +22,7 @@ use Koha::Libraries; use Scalar::Util qw( blessed ); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/OAuth.pm +++ a/Koha/REST/V1/OAuth.pm @@ -21,7 +21,7 @@ use Module::Load::Conditional; use C4::Context; use Koha::OAuth; -use MIME::Base64; +use MIME::Base64 qw( decode_base64 ); use Mojo::Base 'Mojolicious::Controller'; --- a/Koha/REST/V1/Patrons.pm +++ a/Koha/REST/V1/Patrons.pm @@ -20,11 +20,10 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; use Koha::Database; -use Koha::DateUtils; use Koha::Patrons; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Patrons/Account.pm +++ a/Koha/REST/V1/Patrons/Account.pm @@ -21,8 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Patrons; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Patrons/Attributes.pm +++ a/Koha/REST/V1/Patrons/Attributes.pm @@ -22,8 +22,8 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Patron::Attributes; use Koha::Patrons; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Patrons/Password.pm +++ a/Koha/REST/V1/Patrons/Password.pm @@ -23,8 +23,8 @@ use C4::Auth qw(checkpw_internal); use Koha::Patrons; -use Scalar::Util qw(blessed); -use Try::Tiny; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/REST/V1/Quotes.pm +++ a/Koha/REST/V1/Quotes.pm @@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::Quotes; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API --- a/Koha/REST/V1/ReturnClaims.pm +++ a/Koha/REST/V1/ReturnClaims.pm @@ -19,11 +19,10 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Checkouts::ReturnClaims; use Koha::Checkouts; -use Koha::DateUtils qw( dt_from_string output_pref ); =head1 NAME --- a/Koha/REST/V1/Static.pm +++ a/Koha/REST/V1/Static.pm @@ -19,7 +19,7 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 API --- a/Koha/REST/V1/TransferLimits.pm +++ a/Koha/REST/V1/TransferLimits.pm @@ -25,7 +25,7 @@ use Koha::Exceptions::TransferLimit; use Scalar::Util qw( blessed ); -use Try::Tiny; +use Try::Tiny qw( catch try ); =head1 NAME --- a/Koha/Rating.pm +++ a/Koha/Rating.pm @@ -17,7 +17,6 @@ package Koha::Rating; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Ratings.pm +++ a/Koha/Ratings.pm @@ -17,7 +17,6 @@ package Koha::Ratings; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/RecordProcessor.pm +++ a/Koha/RecordProcessor.pm @@ -59,7 +59,7 @@ clone it I to passing it off to the RecordProcessor. use Modern::Perl; -use Module::Load::Conditional qw(can_load); +use Module::Load::Conditional qw( can_load ); use Module::Pluggable::Object; use base qw(Class::Accessor); --- a/Koha/Report.pm +++ a/Koha/Report.pm @@ -17,10 +17,8 @@ package Koha::Report; use Modern::Perl; -use Carp; use Koha::Database; -use JSON; use Koha::Reports; use Koha::DateUtils qw( dt_from_string output_pref ); --- a/Koha/Reports.pm +++ a/Koha/Reports.pm @@ -17,7 +17,6 @@ package Koha::Reports; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Review.pm +++ a/Koha/Review.pm @@ -17,7 +17,6 @@ package Koha::Review; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Reviews.pm +++ a/Koha/Reviews.pm @@ -17,7 +17,6 @@ package Koha::Reviews; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/SMS/Provider.pm +++ a/Koha/SMS/Provider.pm @@ -19,7 +19,6 @@ package Koha::SMS::Provider; use Modern::Perl; -use Carp; use Koha::Patrons; --- a/Koha/SMS/Providers.pm +++ a/Koha/SMS/Providers.pm @@ -19,7 +19,6 @@ package Koha::SMS::Providers; use Modern::Perl; -use Carp; use Koha::SMS::Provider; --- a/Koha/Schema/Loader/mysql.pm +++ a/Koha/Schema/Loader/mysql.pm @@ -24,7 +24,7 @@ use Modern::Perl; use base 'DBIx::Class::Schema::Loader::DBI::mysql'; use mro 'c3'; -use Scalar::Util 'blessed'; +use Scalar::Util qw( blessed ); # This is being upstreamed, but for now lets make sure whatever version of DBIx::Class::Schema::Loader you are using, # we will catch MariaDB current_timestamp() and convert it to \"current_timestamp" correctly. --- a/Koha/Script.pm +++ a/Koha/Script.pm @@ -35,8 +35,8 @@ This class should be used in all scripts. It sets the interface and userenv appr =cut -use File::Basename; -use Fcntl qw(:flock); +use File::Basename qw( fileparse ); +use Fcntl qw( LOCK_EX LOCK_NB ); use C4::Context; use Koha::Exceptions; --- a/Koha/SearchEngine.pm +++ a/Koha/SearchEngine.pm @@ -19,7 +19,7 @@ package Koha::SearchEngine; # along with Koha; if not, see . use Modern::Perl; -use Readonly; +use Readonly qw( Readonly ); =head1 NAME --- a/Koha/SearchEngine/Elasticsearch.pm +++ a/Koha/SearchEngine/Elasticsearch.pm @@ -28,23 +28,22 @@ use Koha::SearchFields; use Koha::SearchMarcMaps; use Koha::Caches; use C4::Heading; -use C4::AuthoritiesMarc; +use C4::AuthoritiesMarc qw( GuessAuthTypeCode ); -use Carp; -use Clone qw(clone); -use JSON; +use Carp qw( carp croak ); +use Clone qw( clone ); use Modern::Perl; -use Readonly; +use Readonly qw( Readonly ); use Search::Elasticsearch; -use Try::Tiny; +use Try::Tiny qw( catch try ); use YAML::XS; -use List::Util qw( sum0 reduce all ); +use List::Util qw( sum0 ); use MARC::File::XML; -use MIME::Base64; -use Encode qw(encode); +use MIME::Base64 qw( encode_base64 ); +use Encode qw( encode ); use Business::ISBN; -use Scalar::Util qw(looks_like_number); +use Scalar::Util qw( looks_like_number ); __PACKAGE__->mk_ro_accessors(qw( index index_name )); __PACKAGE__->mk_accessors(qw( sort_fields )); --- a/Koha/SearchEngine/Elasticsearch/Indexer.pm +++ a/Koha/SearchEngine/Elasticsearch/Indexer.pm @@ -17,12 +17,11 @@ package Koha::SearchEngine::Elasticsearch::Indexer; # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use Carp; +use Carp qw( carp croak ); use Modern::Perl; -use Try::Tiny; -use List::Util qw(any); +use Try::Tiny qw( catch try ); +use List::Util qw( any ); use base qw(Koha::SearchEngine::Elasticsearch); -use Data::Dumper; use Koha::Exceptions; use Koha::Exceptions::Elasticsearch; --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -40,11 +40,10 @@ provides something that can be given to elasticsearch to get answers. =cut use base qw(Koha::SearchEngine::Elasticsearch); -use Carp; use JSON; -use List::MoreUtils qw/ each_array /; +use List::MoreUtils qw( each_array ); use Modern::Perl; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); use C4::Context; use Koha::Exceptions; --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ a/Koha/SearchEngine/Elasticsearch/Search.pm @@ -50,9 +50,7 @@ use Koha::SearchEngine::Search; use Koha::Exceptions::Elasticsearch; use MARC::Record; use MARC::File::XML; -use Data::Dumper; #TODO remove -use Carp qw(cluck); -use MIME::Base64; +use MIME::Base64 qw( decode_base64 ); Koha::SearchEngine::Elasticsearch::Search->mk_accessors(qw( store )); --- a/Koha/SearchEngine/Indexer.pm +++ a/Koha/SearchEngine/Indexer.pm @@ -45,7 +45,6 @@ Creates a new C of whatever the relevant type is. use Modern::Perl; use C4::Context; -use C4::Biblio qw//; sub new { my $engine = C4::Context->preference("SearchEngine") // 'Zebra'; --- a/Koha/SearchEngine/QueryBuilder.pm +++ a/Koha/SearchEngine/QueryBuilder.pm @@ -45,7 +45,7 @@ Creates a new C of whatever the relevant type is. use C4::Context; use Modern::Perl; -use Carp; +use Carp qw( croak ); sub new { my $engine = C4::Context->preference("SearchEngine"); --- a/Koha/SearchEngine/Search.pm +++ a/Koha/SearchEngine/Search.pm @@ -45,8 +45,8 @@ Creates a new C of whatever the relevant type is. use Modern::Perl; use C4::Context; -use C4::Biblio qw//; -use POSIX qw(ceil floor); +use C4::Biblio; +use POSIX qw( ceil ); sub new { my $engine = C4::Context->preference("SearchEngine") // 'Zebra'; --- a/Koha/SearchEngine/Zebra/Indexer.pm +++ a/Koha/SearchEngine/Zebra/Indexer.pm @@ -18,7 +18,7 @@ package Koha::SearchEngine::Zebra::Indexer; # along with Koha; if not, see . use Modern::Perl; -use C4::Biblio qw(ModZebra); # FIXME This is terrible, we should move the indexation code outside of C4::Biblio +use C4::Biblio qw( ModZebra ); # FIXME This is terrible, we should move the indexation code outside of C4::Biblio use base qw(Class::Accessor); =head1 NAME --- a/Koha/SearchEngine/Zebra/Search.pm +++ a/Koha/SearchEngine/Zebra/Search.pm @@ -21,7 +21,7 @@ use Modern::Perl; use base qw(Class::Accessor); -use C4::Search; # :( +use C4::Search qw( getRecords ); # :( use C4::AuthoritiesMarc; use Koha::SearchEngine::Search; @@ -62,7 +62,7 @@ This passes straight through to C4::Search::getRecords. sub search_compat { shift; # get rid of $self - return getRecords(@_); + return C4::Search::getRecords(@_); } =head2 simple_search_compat --- a/Koha/SearchField.pm +++ a/Koha/SearchField.pm @@ -17,7 +17,6 @@ package Koha::SearchField; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/SearchFields.pm +++ a/Koha/SearchFields.pm @@ -17,7 +17,6 @@ package Koha::SearchFields; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/SearchMarcMap.pm +++ a/Koha/SearchMarcMap.pm @@ -17,7 +17,6 @@ package Koha::SearchMarcMap; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/SearchMarcMaps.pm +++ a/Koha/SearchMarcMaps.pm @@ -17,7 +17,6 @@ package Koha::SearchMarcMaps; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Serial.pm +++ a/Koha/Serial.pm @@ -19,7 +19,6 @@ package Koha::Serial; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Serial/Item.pm +++ a/Koha/Serial/Item.pm @@ -19,7 +19,6 @@ package Koha::Serial::Item; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Serial/Items.pm +++ a/Koha/Serial/Items.pm @@ -19,7 +19,6 @@ package Koha::Serial::Items; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Serials.pm +++ a/Koha/Serials.pm @@ -19,7 +19,6 @@ package Koha::Serials; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/SharedContent.pm +++ a/Koha/SharedContent.pm @@ -18,7 +18,7 @@ package Koha::SharedContent; # along with Koha; if not, see . use Modern::Perl; -use JSON; +use JSON qw( from_json to_json ); use HTTP::Request; use LWP::UserAgent; --- a/Koha/SimpleMARC.pm +++ a/Koha/SimpleMARC.pm @@ -18,29 +18,23 @@ package Koha::SimpleMARC; use Modern::Perl; -#use MARC::Record; - -require Exporter; - -our @ISA = qw(Exporter); -our %EXPORT_TAGS = ( 'all' => [ qw( - -) ] ); - -our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); - -our @EXPORT = qw( - read_field - add_field - update_field - copy_field - copy_and_replace_field - move_field - delete_field - field_exists - field_equals -); - +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + our @ISA = qw(Exporter); + + @EXPORT_OK = qw( + read_field + add_field + update_field + copy_field + copy_and_replace_field + move_field + delete_field + field_exists + field_equals + ); +} =head1 NAME --- a/Koha/Sitemapper/Writer.pm +++ a/Koha/Sitemapper/Writer.pm @@ -23,7 +23,7 @@ use Moo; use Modern::Perl; use XML::Writer; use IO::File; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); my $MAX = 50000; --- a/Koha/Statistic.pm +++ a/Koha/Statistic.pm @@ -17,7 +17,6 @@ package Koha::Statistic; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Items; --- a/Koha/Statistics.pm +++ a/Koha/Statistics.pm @@ -17,7 +17,6 @@ package Koha::Statistics; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/StockRotationItem.pm +++ a/Koha/StockRotationItem.pm @@ -22,11 +22,11 @@ use Modern::Perl; use DateTime; use DateTime::Duration; use Koha::Database; -use Koha::DateUtils qw/dt_from_string/; +use Koha::DateUtils qw( dt_from_string ); use Koha::Item::Transfer; use Koha::Item; use Koha::StockRotationStage; -use Try::Tiny; +use Try::Tiny qw( catch try ); use base qw(Koha::Object); --- a/Koha/Subscription.pm +++ a/Koha/Subscription.pm @@ -19,7 +19,6 @@ package Koha::Subscription; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Biblios; @@ -28,7 +27,6 @@ use Koha::Biblioitems; use Koha::Subscriptions; use Koha::Subscription::Frequencies; use Koha::Subscription::Numberpatterns; -use JSON; use base qw(Koha::Object Koha::Object::Mixin::AdditionalFields); --- a/Koha/Subscription/Frequencies.pm +++ a/Koha/Subscription/Frequencies.pm @@ -17,7 +17,6 @@ package Koha::Subscription::Frequencies; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Subscription/Frequency.pm +++ a/Koha/Subscription/Frequency.pm @@ -17,7 +17,6 @@ package Koha::Subscription::Frequency; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Subscription/Histories.pm +++ a/Koha/Subscription/Histories.pm @@ -19,7 +19,6 @@ package Koha::Subscription::Histories; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Subscription/History.pm +++ a/Koha/Subscription/History.pm @@ -19,7 +19,6 @@ package Koha::Subscription::History; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Subscription/Routinglist.pm +++ a/Koha/Subscription/Routinglist.pm @@ -18,7 +18,6 @@ package Koha::Subscription::Routinglist; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Subscriptions; --- a/Koha/Subscription/Routinglists.pm +++ a/Koha/Subscription/Routinglists.pm @@ -18,7 +18,6 @@ package Koha::Subscription::Routinglists; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Subscription::Routinglist; --- a/Koha/Subscriptions.pm +++ a/Koha/Subscriptions.pm @@ -19,7 +19,6 @@ package Koha::Subscriptions; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Suggestion.pm +++ a/Koha/Suggestion.pm @@ -19,10 +19,9 @@ package Koha::Suggestion; use Modern::Perl; -use Carp; use Koha::Database; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use base qw(Koha::Object); --- a/Koha/SuggestionEngine.pm +++ a/Koha/SuggestionEngine.pm @@ -53,7 +53,7 @@ B - create a new plugin object use strict; use warnings; -use Module::Load::Conditional qw(can_load); +use Module::Load::Conditional qw( can_load ); use Module::Pluggable::Object; use base qw(Class::Accessor); --- a/Koha/SuggestionEngine/Plugin/AuthorityFile.pm +++ a/Koha/SuggestionEngine/Plugin/AuthorityFile.pm @@ -31,7 +31,6 @@ Plugin to get suggestions from Koha's authority file =cut use Modern::Perl; -use Carp; use base qw(Koha::SuggestionEngine::Base); --- a/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm +++ a/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm @@ -32,7 +32,6 @@ subjects to subject searches. =cut use Modern::Perl; -use Carp; use C4::Templates qw(gettemplate); # This is necessary for translatability use base qw(Koha::SuggestionEngine::Base); --- a/Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm +++ a/Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm @@ -18,7 +18,7 @@ package Koha::SuggestionEngine::Plugin::LibrisSpellcheck; use Modern::Perl; use LWP::UserAgent; -use XML::Simple qw(XMLin); +use XML::Simple qw( XMLin ); use C4::Context; use base qw(Koha::SuggestionEngine::Base); --- a/Koha/SuggestionEngine/Plugin/Null.pm +++ a/Koha/SuggestionEngine/Plugin/Null.pm @@ -33,7 +33,6 @@ SuggestionEngine. use strict; use warnings; -use Carp; use base qw(Koha::SuggestionEngine::Base); --- a/Koha/Suggestions.pm +++ a/Koha/Suggestions.pm @@ -19,7 +19,6 @@ package Koha::Suggestions; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Tag.pm +++ a/Koha/Tag.pm @@ -17,7 +17,6 @@ package Koha::Tag; use Modern::Perl; -use Carp; use base qw(Koha::Object); --- a/Koha/Tags.pm +++ a/Koha/Tags.pm @@ -17,7 +17,6 @@ package Koha::Tags; use Modern::Perl; -use Carp; use Koha::Tag; --- a/Koha/Tags/Approval.pm +++ a/Koha/Tags/Approval.pm @@ -17,7 +17,6 @@ package Koha::Tags::Approval; use Modern::Perl; -use Carp; use base qw(Koha::Object); --- a/Koha/Tags/Approvals.pm +++ a/Koha/Tags/Approvals.pm @@ -17,7 +17,6 @@ package Koha::Tags::Approvals; use Modern::Perl; -use Carp; use Koha::Tags::Approval; --- a/Koha/Tags/Index.pm +++ a/Koha/Tags/Index.pm @@ -17,7 +17,6 @@ package Koha::Tags::Index; use Modern::Perl; -use Carp; use base qw(Koha::Object); --- a/Koha/Tags/Indexes.pm +++ a/Koha/Tags/Indexes.pm @@ -17,7 +17,6 @@ package Koha::Tags::Indexes; use Modern::Perl; -use Carp; use Koha::Tags::Index; --- a/Koha/Template/Plugin/Asset.pm +++ a/Koha/Template/Plugin/Asset.pm @@ -45,7 +45,7 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use File::Basename; +use File::Basename qw( fileparse ); use File::Spec; use C4::Context; use Koha; --- a/Koha/Template/Plugin/AudioAlerts.pm +++ a/Koha/Template/Plugin/AudioAlerts.pm @@ -19,8 +19,7 @@ package Koha::Template::Plugin::AudioAlerts; use Modern::Perl; -use Encode qw( encode ); -use JSON; +use JSON qw( encode_json ); use base qw( Template::Plugin ); --- a/Koha/Template/Plugin/AuthorisedValues.pm +++ a/Koha/Template/Plugin/AuthorisedValues.pm @@ -21,7 +21,7 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); use Koha::AuthorisedValues; sub GetByCode { --- a/Koha/Template/Plugin/Categories.pm +++ a/Koha/Template/Plugin/Categories.pm @@ -20,7 +20,7 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use List::Util qw(any); +use List::Util qw( any ); use Koha::Patron::Categories; sub all { --- a/Koha/Template/Plugin/I18N.pm +++ a/Koha/Template/Plugin/I18N.pm @@ -22,7 +22,7 @@ use Modern::Perl; use base qw( Template::Plugin ); use C4::Context; -use Koha::I18N; +use Koha::I18N qw( __ __n __np __npx __nx __p __px __x __xn ); =head1 NAME --- a/Koha/Template/Plugin/KohaDates.pm +++ a/Koha/Template/Plugin/KohaDates.pm @@ -22,7 +22,7 @@ use Modern::Perl; use Template::Plugin::Filter; use base qw( Template::Plugin::Filter ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use C4::Context; our $DYNAMIC = 1; --- a/Koha/Template/Plugin/KohaPlugins.pm +++ a/Koha/Template/Plugin/KohaPlugins.pm @@ -21,7 +21,7 @@ use Modern::Perl; use base qw( Template::Plugin ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Plugins; --- a/Koha/Template/Plugin/To.pm +++ a/Koha/Template/Plugin/To.pm @@ -22,7 +22,7 @@ use Modern::Perl; use Template::Plugin::Filter; use base qw( Template::Plugin::Filter ); -use JSON qw( to_json ); +use JSON; our $DYNAMIC = 1; sub json { --- a/Koha/Token.pm +++ a/Koha/Token.pm @@ -49,11 +49,11 @@ Koha::Token - Tokenizer =cut use Modern::Perl; -use Bytes::Random::Secure (); -use String::Random (); -use WWW::CSRF (); -use Digest::MD5 qw(md5_base64); -use Encode qw( encode ); +use Bytes::Random::Secure; +use String::Random; +use WWW::CSRF; +use Digest::MD5 qw( md5_base64 ); +use Encode; use Koha::Exceptions::Token; use base qw(Class::Accessor); use constant HMAC_SHA1_LENGTH => 20; --- a/Koha/UploadedFiles.pm +++ a/Koha/UploadedFiles.pm @@ -19,9 +19,9 @@ package Koha::UploadedFiles; use Modern::Perl; -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::UploadedFile; use parent qw(Koha::Objects); --- a/Koha/Uploader.pm +++ a/Koha/Uploader.pm @@ -69,7 +69,6 @@ use Modern::Perl; use CGI; # no utf8 flag, since it may interfere with binary uploads use Digest::MD5; use Encode; -use File::Spec; use IO::File; use Time::HiRes; --- a/Koha/Util/FrameworkPlugin.pm +++ a/Koha/Util/FrameworkPlugin.pm @@ -22,11 +22,10 @@ package Koha::Util::FrameworkPlugin; use Modern::Perl; -our ( @ISA, @EXPORT, @EXPORT_OK ); +our ( @ISA, @EXPORT_OK ); BEGIN { require Exporter; @ISA = qw( Exporter ); - @EXPORT = qw( ); @EXPORT_OK = qw( wrapper date_entered ); } --- a/Koha/Util/MARC.pm +++ a/Koha/Util/MARC.pm @@ -18,7 +18,6 @@ package Koha::Util::MARC; # along with Koha; if not, see . use Modern::Perl; -use MARC::Record; =head1 NAME --- a/Koha/Util/OpenDocument.pm +++ a/Koha/Util/OpenDocument.pm @@ -19,10 +19,8 @@ package Koha::Util::OpenDocument; use Modern::Perl; -use Encode qw( decode ); -use File::Temp; use File::Basename qw( dirname ); -use OpenOffice::OODoc; +use OpenOffice::OODoc qw( odfDocument odfWorkingDirectory ); use parent qw( Exporter ); --- a/Koha/Virtualshelf.pm +++ a/Koha/Virtualshelf.pm @@ -17,9 +17,8 @@ package Koha::Virtualshelf; use Modern::Perl; -use Carp; -use C4::Auth; +use C4::Auth qw( haspermission ); use Koha::Patrons; use Koha::Database; --- a/Koha/Virtualshelfcontent.pm +++ a/Koha/Virtualshelfcontent.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelfcontent; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; --- a/Koha/Virtualshelfcontents.pm +++ a/Koha/Virtualshelfcontents.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelfcontents; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Virtualshelfshare.pm +++ a/Koha/Virtualshelfshare.pm @@ -17,12 +17,11 @@ package Koha::Virtualshelfshare; use Modern::Perl; -use Carp; use DateTime; use DateTime::Duration; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions; use base qw(Koha::Object); --- a/Koha/Virtualshelfshares.pm +++ a/Koha/Virtualshelfshares.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelfshares; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Virtualshelves.pm +++ a/Koha/Virtualshelves.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelves; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/XSLT/Security.pm +++ a/Koha/XSLT/Security.pm @@ -36,7 +36,6 @@ Koha::XSLT::Security - Add security features to Koha::XSLT::Base =cut use Modern::Perl; -use Data::Dumper qw/Dumper/; use XML::LibXSLT; use C4::Context; --- a/Koha/Z3950Responder/Session.pm +++ a/Koha/Z3950Responder/Session.pm @@ -22,7 +22,7 @@ use Modern::Perl; use C4::Circulation qw( GetTransfers ); use C4::Context; use C4::Reserves qw( GetReserveStatus ); -use C4::Search qw(); +use C4::Search qw( new_record_from_zebra ); use Koha::Items; use Koha::Logger; --- a/Koha/Z3950Server.pm +++ a/Koha/Z3950Server.pm @@ -17,7 +17,6 @@ package Koha::Z3950Server; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/Z3950Servers.pm +++ a/Koha/Z3950Servers.pm @@ -17,7 +17,6 @@ package Koha::Z3950Servers; use Modern::Perl; -use Carp; use Koha::Database; --- a/Koha/pdfformat/layout2pages.pm +++ a/Koha/pdfformat/layout2pages.pm @@ -22,12 +22,11 @@ package Koha::pdfformat::layout2pages; #you can use any PDF::API2 module, all you need to do is return the stringifyed pdf object from the printpdf sub. use vars qw(@ISA @EXPORT); -use MIME::Base64; use Modern::Perl; use utf8; use Koha::Number::Price; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; BEGIN { --- a/Koha/pdfformat/layout2pagesde.pm +++ a/Koha/pdfformat/layout2pagesde.pm @@ -21,20 +21,18 @@ package Koha::pdfformat::layout2pagesde; # along with Koha; if not, see . #you can use any PDF::API2 module, all you need to do is return the stringifyed pdf object from the printpdf sub. -use vars qw(@ISA @EXPORT); -use MIME::Base64; use Modern::Perl; use utf8; use Koha::Number::Price; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; +our (@ISA, @EXPORT_OK); BEGIN { - use Exporter (); - our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); - @ISA = qw(Exporter); - @EXPORT = qw(printpdf); + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw(printpdf); } --- a/Koha/pdfformat/layout3pages.pm +++ a/Koha/pdfformat/layout3pages.pm @@ -22,14 +22,13 @@ package Koha::pdfformat::layout3pages; #you can use any PDF::API2 module, all you need to do is return the stringifyed pdf object from the printpdf sub. use vars qw(@ISA @EXPORT); -use MIME::Base64; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use Modern::Perl; use utf8; -use C4::Acquisition; +use C4::Acquisition qw( get_rounded_price ); use Koha::Number::Price; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; BEGIN { --- a/Koha/pdfformat/layout3pagesfr.pm +++ a/Koha/pdfformat/layout3pagesfr.pm @@ -23,7 +23,7 @@ package Koha::pdfformat::layout3pagesfr; use vars qw(@ISA @EXPORT); use MIME::Base64; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use Modern::Perl; use utf8; --- a/about.pl +++ a/about.pl @@ -24,25 +24,22 @@ use Modern::Perl; use CGI qw ( -utf8 ); use DateTime::TimeZone; -use File::Spec; -use File::Slurp; -use List::MoreUtils qw/ any /; -use LWP::Simple; -use Module::Load::Conditional qw(can_load); -use XML::Simple; -use Config; +use File::Slurp qw( read_file ); +use List::MoreUtils qw( any ); +use Module::Load::Conditional qw( can_load ); +use Config qw( %Config ); use Search::Elasticsearch; -use Try::Tiny; +use Try::Tiny qw( catch try ); use YAML::XS; use Encode; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user get_user_subpermissions ); use C4::Context; use C4::Installer::PerlModules; use Koha; -use Koha::DateUtils qw(dt_from_string output_pref); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Currencies; use Koha::BackgroundJob; use Koha::BiblioFrameworks; --- a/acqui/acqui-home.pl +++ a/acqui/acqui-home.pl @@ -29,10 +29,9 @@ this script is the main page for acqui use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Acquisition; -use C4::Budgets; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); use C4::Members; use Koha::Acquisition::Currencies; use Koha::Patrons; --- a/acqui/add_user_search.pl +++ a/acqui/add_user_search.pl @@ -20,11 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; -use Koha::Patron::Categories; +use Koha::Patron::Categories ; my $input = CGI->new; --- a/acqui/addorder.pl +++ a/acqui/addorder.pl @@ -119,16 +119,21 @@ if it is an order from an existing suggestion : the id of this suggestion. use Modern::Perl; use CGI qw ( -utf8 ); -use JSON qw ( to_json ); -use C4::Auth; # get_template_and_user -use C4::Acquisition; # ModOrder -use C4::Suggestions; # ModStatus -use C4::Biblio; # AddBiblio TransformKohaToMarc -use C4::Budgets; -use C4::Items; -use C4::Output; -use C4::Log qw(logaction); -use Koha::Acquisition::Currencies; +use JSON qw( to_json ); +use C4::Auth qw( get_template_and_user ); +use C4::Acquisition qw( FillWithDefaultValues populate_order_with_prices ModOrder ModOrderUsers ); +use C4::Suggestions qw( ModSuggestion ); +use C4::Biblio qw( + AddBiblio + GetMarcFromKohaField + TransformHtmlToXml + TransformKohaToMarc +); +use C4::Budgets qw( GetBudget GetBudgetSpent GetBudgetOrdered ); +use C4::Items qw( AddItemFromMarc ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Log qw( logaction ); +use Koha::Acquisition::Currencies qw( get_active ); use Koha::Acquisition::Orders; use Koha::Acquisition::Baskets; use C4::Barcodes; --- a/acqui/addorderiso2709.pl +++ a/acqui/addorderiso2709.pl @@ -23,23 +23,27 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Carp; use YAML::XS; -use List::MoreUtils qw/uniq/; +use List::MoreUtils; use Encode; use C4::Context; -use C4::Auth; -use C4::Output; -use C4::ImportBatch; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::ImportBatch qw( GetImportRecordsRange GetImportRecordMarc GetImportRecordMatches sub SetImportRecordStatus SetMatchedBiblionumber SetImportBatchStatus GetImportBatch GetImportBatchRangeDesc GetNumberOfNonZ3950ImportBatches GetImportBatchOverlayAction GetImportBatchNoMatchAction GetImportBatchItemAction ); use C4::Matcher; -use C4::Search qw/FindDuplicate/; -use C4::Acquisition; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Budgets; -use C4::Acquisition; +use C4::Search qw( FindDuplicate ); +use C4::Acquisition qw( populate_order_with_prices ); +use C4::Biblio qw( + AddBiblio + GetMarcFromKohaField + GetMarcPrice + GetMarcQuantity + TransformHtmlToXml +); +use C4::Items qw( PrepareItemrecordDisplay sub AddItemFromMarc ); +use C4::Budgets qw( GetBudget GetBudgets GetBudgetHierarchy CanUserUseBudget GetBudgetByCode ); +use C4::Acquisition qw( populate_order_with_prices ); use C4::Suggestions; # GetSuggestion use C4::Members; --- a/acqui/ajax-getauthvaluedropbox.pl +++ a/acqui/ajax-getauthvaluedropbox.pl @@ -48,8 +48,8 @@ Default value for the dropbox. use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Charset; -use C4::Auth qw/check_api_auth/; +use C4::Charset qw( NormalizeString ); +use C4::Auth qw( check_api_auth ); use Koha::AuthorisedValues; my $query = CGI->new(); --- a/acqui/basket.pl +++ a/acqui/basket.pl @@ -21,25 +21,22 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user haspermission ); +use C4::Output qw( output_html_with_http_headers output_and_exit ); use CGI qw ( -utf8 ); -use C4::Acquisition; -use C4::Budgets; -use C4::Contract; -use C4::Biblio; -use C4::Items; -use C4::Suggestions; +use C4::Acquisition qw( GetBasket CanUserManageBasket GetBasketAsCSV NewBasket NewBasketgroup ModBasket ReopenBasket ModBasketUsers GetBasketgroup GetBasketgroups GetBasketUsers GetOrders GetOrder get_rounded_price ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); +use C4::Contract qw( GetContract ); +use C4::Suggestions qw( GetSuggestion GetSuggestionInfoFromBiblionumber GetSuggestionInfo ); use Koha::Biblios; use Koha::Acquisition::Baskets; use Koha::Acquisition::Booksellers; use Koha::Acquisition::Orders; use Koha::Libraries; -use C4::Letters qw/SendAlerts/; -use Date::Calc qw/Add_Delta_Days/; +use C4::Letters qw( SendAlerts ); +use Date::Calc qw( Add_Delta_Days ); use Koha::Database; -use Koha::EDI qw( create_edi_order get_edifact_ean ); +use Koha::EDI qw( create_edi_order ); use Koha::CsvProfiles; use Koha::Patrons; --- a/acqui/basketgroup.pl +++ a/acqui/basketgroup.pl @@ -44,15 +44,15 @@ The bookseller who we want to display the baskets (and basketgroups) of. =cut use Modern::Perl; -use Carp; +use Carp qw( croak ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); use File::Spec; -use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV get_rounded_price/; -use Koha::EDI qw/create_edi_order get_edifact_ean/; +use C4::Acquisition qw( GetOrders GetOrder get_rounded_price GetBasket GetBasketgroup GetBasketsByBasketgroup GetBasketgroups GetBasketsByBookseller ModBasket CloseBasketgroup GetBasketGroupAsCSV DelBasketgroup ReOpenBasketgroup ModBasketgroup NewBasket NewBasketgroup ); +use Koha::EDI qw( get_edifact_ean create_edi_order ); use Koha::Biblioitems; use Koha::Acquisition::Booksellers; --- a/acqui/basketheader.pl +++ a/acqui/basketheader.pl @@ -48,10 +48,10 @@ If it exists, C<$basketno> is the basket we edit use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Acquisition qw/GetBasket NewBasket ModBasketHeader/; -use C4::Contract qw/GetContracts/; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Acquisition qw( GetBasket ModBasket ModBasketHeader NewBasket ); +use C4::Contract qw( GetContracts GetContract ); use Koha::Acquisition::Booksellers; use Koha::Acquisition::Baskets; --- a/acqui/booksellers.pl +++ a/acqui/booksellers.pl @@ -52,13 +52,12 @@ The id of the supplier whose baskets we will display =cut use Modern::Perl; -use C4::Auth; -use C4::Biblio; -use C4::Budgets; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Acquisition qw/ GetBasketsInfosByBookseller CanUserManageBasket /; +use C4::Acquisition qw( GetBasket GetBasketsInfosByBookseller CanUserManageBasket GetBasketgroup ); use C4::Context; use Koha::Acquisition::Booksellers; --- a/acqui/cancelorder.pl +++ a/acqui/cancelorder.pl @@ -32,9 +32,8 @@ and add possibility to indicate a reason for cancellation use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; -use C4::Acquisition; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Acquisition::Baskets; my $input = CGI->new; --- a/acqui/check_budget_total.pl +++ a/acqui/check_budget_total.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Budgets; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( GetBudget ); =head1 DESCRIPTION --- a/acqui/check_uniqueness.pl +++ a/acqui/check_uniqueness.pl @@ -32,9 +32,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON; -use C4::Output; -use C4::Items; +use JSON qw( to_json ); +use C4::Output qw( output_with_http_headers ); +use C4::Items qw( SearchItems ); my $input = CGI->new; my @field = $input->multi_param('field[]'); --- a/acqui/duplicate_orders.pl +++ a/acqui/duplicate_orders.pl @@ -21,14 +21,14 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Acquisition qw(GetHistory); -use C4::Budgets qw(GetBudgetPeriods GetBudgetHierarchy CanUserUseBudget); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Acquisition qw( GetHistory ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget GetBudgetPeriods GetBudgetPeriod ); use Koha::Acquisition::Baskets; use Koha::Acquisition::Currencies; use Koha::Acquisition::Orders; -use Koha::DateUtils qw(dt_from_string output_pref); +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my $basketno = $input->param('basketno'); --- a/acqui/edi_ean.pl +++ a/acqui/edi_ean.pl @@ -23,9 +23,8 @@ # use Modern::Perl; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; use CGI; my $schema = Koha::Database->new()->schema(); --- a/acqui/edifactmsgs.pl +++ a/acqui/edifactmsgs.pl @@ -20,11 +20,10 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; -use Koha::EDI qw(process_invoice); +use Koha::EDI qw( process_invoice ); my $q = CGI->new; my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( --- a/acqui/edimsg.pl +++ a/acqui/edimsg.pl @@ -19,10 +19,10 @@ use Modern::Perl; use CGI; -use Koha::Database; +use Koha::Databas; use C4::Koha; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $q = CGI->new; my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( --- a/acqui/finishreceive.pl +++ a/acqui/finishreceive.pl @@ -22,19 +22,18 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Output; use C4::Context; -use C4::Acquisition; -use C4::Biblio; -use C4::Items; +use C4::Acquisition qw( GetInvoice GetOrder populate_order_with_prices ModReceiveOrder ); +use C4::Biblio qw( GetFrameworkCode GetMarcFromKohaField TransformHtmlToXml ); +use C4::Items qw( GetMarcItem ModItemFromMarc AddItemFromMarc ); use C4::Search; use Koha::Number::Price; use Koha::Acquisition::Booksellers; use Koha::Acquisition::Orders; -use List::MoreUtils qw/any/; my $input=CGI->new; my $flagsrequired = {acquisition => 'order_receive'}; --- a/acqui/histsearch.pl +++ a/acqui/histsearch.pl @@ -51,12 +51,11 @@ to filter on ended date. use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # get_template_and_user -use C4::Output; -use C4::Acquisition; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Acquisition qw( GetHistory ); use Koha::AdditionalFields; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my $do_search = $input->param('do_search') || 0; --- a/acqui/invoice-files.pl +++ a/acqui/invoice-files.pl @@ -30,9 +30,9 @@ Manage files associated with invoice use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; -use C4::Acquisition; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Acquisition qw( GetInvoice GetInvoiceDetails ); use Koha::Misc::Files; my $input = CGI->new; --- a/acqui/invoice.pl +++ a/acqui/invoice.pl @@ -29,14 +29,14 @@ Invoice details use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Acquisition; -use C4::Budgets; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Acquisition qw( CloseInvoice ReopenInvoice ModInvoice MergeInvoices DelInvoice GetInvoice GetInvoiceDetails get_rounded_price ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); use Koha::Acquisition::Booksellers; -use Koha::Acquisition::Currencies; -use Koha::DateUtils; +use Koha::Acquisition::Currencies qw( get_active ); +use Koha::DateUtils qw( output_pref ); use Koha::Misc::Files; use Koha::Acquisition::Invoice::Adjustments; --- a/acqui/invoices.pl +++ a/acqui/invoices.pl @@ -29,12 +29,12 @@ Search for invoices use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Acquisition qw/GetInvoices/; -use C4::Budgets; -use Koha::DateUtils; +use C4::Acquisition qw( GetInvoices GetInvoice ); +use C4::Budgets qw( GetBudget GetBudgets CanUserUseBudget ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Booksellers; my $input = CGI->new; --- a/acqui/lateorders-export.pl +++ a/acqui/lateorders-export.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use Encode; -use C4::Auth; -use C4::Acquisition; +use C4::Auth qw( get_template_and_user ); +use C4::Acquisition qw( GetOrder ); use C4::Output; use C4::Context; --- a/acqui/lateorders.pl +++ a/acqui/lateorders.pl @@ -45,14 +45,12 @@ To know on which branch this script have to display late order. use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Acquisition; -use C4::Letters; -use Koha::DateUtils; -use Koha::Acquisition::Orders; +use C4::Letters qw( SendAlerts GetLetters ); +use Koha::DateUtils qw( dt_from_string output_pref ); +use Koha::Acquisition::Orders qw( filter_by_lates ); use Koha::CsvProfiles; my $input = CGI->new; --- a/acqui/modordernotes.pl +++ a/acqui/modordernotes.pl @@ -29,9 +29,9 @@ Modify just notes when basket is closed. use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Acquisition; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Acquisition qw( GetOrder GetBasket ModOrder ); use Koha::Acquisition::Booksellers; --- a/acqui/neworderempty.pl +++ a/acqui/neworderempty.pl @@ -68,24 +68,30 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Budgets; - -use C4::Acquisition; -use C4::Contract; -use C4::Suggestions; # GetSuggestion -use C4::Biblio; # GetBiblioData GetMarcPrice -use C4::Items; #PrepareItemRecord -use C4::Output; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( GetBudget GetBudgetHierarchy CanUserUseBudget ); + +use C4::Acquisition qw( GetOrder GetBasket FillWithDefaultValues GetOrderUsers ); +use C4::Contract qw( GetContract ); +use C4::Suggestions qw( GetSuggestion GetSuggestionInfo ); +use C4::Biblio qw( + AddBiblio + GetBiblioData + GetMarcBiblio + GetMarcFromKohaField + GetMarcPrice + GetMarcStructure + IsMarcStructureInternal +); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Members; -use C4::Search qw/FindDuplicate/; +use C4::Search qw( FindDuplicate ); #needed for z3950 import: -use C4::ImportBatch qw/GetImportRecordMarc SetImportRecordStatus SetMatchedBiblionumber/; +use C4::ImportBatch qw( SetImportRecordStatus SetMatchedBiblionumber GetImportRecordMarc ); use Koha::Acquisition::Booksellers; -use Koha::Acquisition::Currencies; +use Koha::Acquisition::Currencies qw( get_active ); use Koha::BiblioFrameworks; use Koha::DateUtils qw( dt_from_string ); use Koha::MarcSubfieldStructures; --- a/acqui/newordersubscription.pl +++ a/acqui/newordersubscription.pl @@ -19,11 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Acquisition; -use C4::Auth; +use C4::Acquisition qw( GetBasket ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Serials; +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( SearchSubscriptions subscriptionCurrentlyOnOrder check_routing ); use Koha::Acquisition::Booksellers; --- a/acqui/newordersuggestion.pl +++ a/acqui/newordersuggestion.pl @@ -91,10 +91,9 @@ can be equal to use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # get_template_and_user -use C4::Output; -use C4::Suggestions; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Suggestions qw( ConnectSuggestionAndBiblio SearchSuggestion ); use C4::Budgets; use Koha::Acquisition::Booksellers; --- a/acqui/ordered.pl +++ a/acqui/ordered.pl @@ -30,10 +30,10 @@ this script is to show orders ordered but not yet received use C4::Context; use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Acquisition::Invoice::Adjustments; -use C4::Acquisition; +use C4::Acquisition qw( get_rounded_price ); my $dbh = C4::Context->dbh; my $input = CGI->new; --- a/acqui/orderreceive.pl +++ a/acqui/orderreceive.pl @@ -62,18 +62,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Acquisition; -use C4::Auth; -use C4::Output; -use C4::Budgets qw/ GetBudget GetBudgetHierarchy CanUserUseBudget GetBudgetPeriods /; +use C4::Acquisition qw( GetInvoice ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Budgets qw( GetBudget GetBudgetPeriods GetBudgetPeriod GetBudgetHierarchy CanUserUseBudget ); use C4::Members; -use C4::Items; -use C4::Biblio; -use C4::Suggestions; -use C4::Koha; +use C4::Biblio qw( GetMarcStructure ); +use C4::Suggestions qw( GetSuggestion GetSuggestionInfoFromBiblionumber GetSuggestionInfo ); use Koha::Acquisition::Booksellers; -use Koha::Acquisition::Currencies; +use Koha::Acquisition::Currencies qw( get_active ); use Koha::Acquisition::Orders; use Koha::DateUtils qw( dt_from_string ); use Koha::ItemTypes; --- a/acqui/parcel.pl +++ a/acqui/parcel.pl @@ -56,23 +56,18 @@ To filter the results list on this given date. use Modern::Perl; -use C4::Auth; -use C4::Acquisition; -use C4::Budgets; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Acquisition qw( CancelReceipt GetInvoice GetInvoiceDetails get_rounded_price ); +use C4::Budgets qw( _round GetBudget GetBudgetByOrderNumber GetBudgetName ); use CGI qw ( -utf8 ); -use C4::Output; -use C4::Suggestions; +use C4::Output qw( output_html_with_http_headers ); +use C4::Suggestions qw( GetSuggestion GetSuggestionInfoFromBiblionumber GetSuggestionInfo ); use Koha::Acquisition::Baskets; use Koha::Acquisition::Bookseller; use Koha::Acquisition::Orders; use Koha::Biblios; -use Koha::DateUtils; -use Koha::Biblios; -use JSON; my $input = CGI->new; --- a/acqui/parcels.pl +++ a/acqui/parcels.pl @@ -68,11 +68,11 @@ To know how many results have to be display / page. use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Acquisition; -use C4::Budgets; +use C4::Acquisition qw( GetInvoices GetInvoice AddInvoice ); +use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); use Koha::Acquisition::Booksellers; use Koha::DateUtils qw( output_pref dt_from_string ); --- a/acqui/showorder.pl +++ a/acqui/showorder.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Acquisition::Orders; use Koha::Patrons; --- a/acqui/spent.pl +++ a/acqui/spent.pl @@ -30,11 +30,11 @@ this script is designed to show the spent amount in budgets =cut use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Acquisition; +use C4::Acquisition qw( get_rounded_price ); use Koha::Acquisition::Invoice::Adjustments; my $dbh = C4::Context->dbh; --- a/acqui/supplier.pl +++ a/acqui/supplier.pl @@ -41,10 +41,9 @@ To know the bookseller this script has to display details. =cut use Modern::Perl; -use C4::Auth; -use C4::Contract; -use C4::Biblio; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Contract qw( GetContracts GetContract ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Budgets; --- a/acqui/transferorder.pl +++ a/acqui/transferorder.pl @@ -22,10 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Acquisition; +use C4::Acquisition qw( GetOrder GetBasket TransferOrder GetBasketsByBookseller SearchOrders ); use Koha::Acquisition::Booksellers; my $input = CGI->new; --- a/acqui/uncertainprice.pl +++ a/acqui/uncertainprice.pl @@ -45,12 +45,11 @@ The bookseller who we want to display the orders of. use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Acquisition qw/SearchOrders GetOrder ModOrder/; -use C4::Biblio qw/GetBiblioData/; +use C4::Acquisition qw( SearchOrders GetOrder ModOrder ); use Koha::Acquisition::Booksellers; use Koha::Acquisition::Baskets; --- a/acqui/updatesupplier.pl +++ a/acqui/updatesupplier.pl @@ -47,11 +47,9 @@ contact_serialsprimary. =cut use Modern::Perl; -use List::Util; use C4::Context; -use C4::Auth; +use C4::Auth qw( checkauth ); -use C4::Biblio; use C4::Output; use Koha::Acquisition::Bookseller::Contacts; --- a/acqui/z3950_search.pl +++ a/acqui/z3950_search.pl @@ -22,11 +22,10 @@ use Modern::Perl; use CGI qw/-utf8/; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Breeding; -use C4::Koha; +use C4::Breeding qw( Z3950Search ); use Koha::Acquisition::Booksellers; use Koha::BiblioFrameworks; --- a/admin/add_user_search.pl +++ a/admin/add_user_search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; --- a/admin/additional-fields.pl +++ a/admin/additional-fields.pl @@ -18,9 +18,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AdditionalFields; my $input = CGI->new; --- a/admin/admin-home.pl +++ a/admin/admin-home.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Plugins; my $query = CGI->new; --- a/admin/adveditorshortcuts.pl +++ a/admin/adveditorshortcuts.pl @@ -34,13 +34,11 @@ This script allows the user to redefine the keyboard shortcuts for the advacned =cut use Modern::Perl; -use Encode; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Koha; use Koha::KeyboardShortcuts; my $input = CGI->new; --- a/admin/aqbudgetperiods.pl +++ a/admin/aqbudgetperiods.pl @@ -47,15 +47,14 @@ script to administer the budget periods table use Modern::Perl; use CGI qw ( -utf8 ); -use List::Util qw/min/; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Database; use C4::Koha; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Acquisition; -use C4::Budgets; +use C4::Budgets qw( GetBudgetPeriod GetBudgetPeriods ModBudgetPeriod AddBudgetPeriod GetBudgets DelBudgetPeriod CloneBudgetPeriod MoveOrders ); use Koha::Acquisition::Currencies; my $dbh = C4::Context->dbh; @@ -176,7 +175,7 @@ elsif ( $op eq 'duplicate_budget' ){ my $mark_original_budget_as_inactive = $input->param('mark_original_budget_as_inactive'); my $reset_all_budgets = $input->param('reset_all_budgets'); - my $new_budget_period_id = C4::Budgets::CloneBudgetPeriod( + my $new_budget_period_id = CloneBudgetPeriod( { budget_period_id => $budget_period_id, budget_period_startdate => $budget_period_startdate, @@ -198,7 +197,7 @@ elsif ( $op eq 'close_form' ) { my $budget_period = GetBudgetPeriod($budget_period_id); my $active_budget_periods = - C4::Budgets::GetBudgetPeriods( { budget_period_active => 1 } ); + GetBudgetPeriods( { budget_period_active => 1 } ); # Remove the budget period from the list $active_budget_periods = @@ -235,7 +234,7 @@ elsif ( $op eq 'close_form' ) { elsif ( $op eq 'close_confirmed' ) { my $to_budget_period_id = $input->param('to_budget_period_id'); my $move_remaining_unspent = $input->param('move_remaining_unspent'); - my $report = C4::Budgets::MoveOrders( + my $report = MoveOrders( { from_budget_period_id => $budget_period_id, to_budget_period_id => $to_budget_period_id, --- a/admin/aqbudgets.pl +++ a/admin/aqbudgets.pl @@ -22,16 +22,26 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::Util qw/min/; use Koha::Database; -use C4::Auth qw/get_user_subpermissions/; -use C4::Auth; -use C4::Acquisition; -use C4::Budgets; +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( + AddBudget + BudgetHasChildren + CanUserModifyBudget + CanUserUseBudget + DelBudget + GetBudget + GetBudgetAuthCats + GetBudgetHierarchy + GetBudgetPeriod + GetBudgetPeriods + GetBudgetUsers + ModBudget + ModBudgetUsers +); use C4::Context; -use C4::Output; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers output_and_exit ); use Koha::Acquisition::Currencies; use Koha::Patrons; --- a/admin/aqcontract.pl +++ a/admin/aqcontract.pl @@ -23,10 +23,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Contract; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Contract qw( + AddContract + DelContract + GetContract + GetContracts + ModContract +); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Booksellers; --- a/admin/aqplan.pl +++ a/admin/aqplan.pl @@ -22,17 +22,24 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::Util qw/min/; -use Date::Calc qw/Delta_YMD Easter_Sunday Today Decode_Date_EU/; -use Date::Manip qw/ ParseDate UnixDate DateCalc/; +use Date::Calc qw( Delta_YMD ); +use Date::Manip qw( DateCalc UnixDate ); use Text::CSV_XS; -use C4::Acquisition; -use C4::Budgets; +use C4::Budgets qw( + CanUserUseBudget + GetBudgetAuthCats + GetBudgetHierarchy + GetBudgetPeriod + GetBudgetsPlanCell + GetCols + GetPeriodsCount + HideCols + ModBudgetPlan +); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Acquisition::Currencies; our $input = CGI->new; --- a/admin/audio_alerts.pl +++ a/admin/audio_alerts.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AudioAlert; use Koha::AudioAlerts; --- a/admin/auth_subfields_structure.pl +++ a/admin/auth_subfields_structure.pl @@ -18,11 +18,10 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Koha; use Koha::Authority::Types; use Koha::AuthorisedValues; --- a/admin/auth_tag_structure.pl +++ a/admin/auth_tag_structure.pl @@ -20,10 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Authority::Types; --- a/admin/authorised_values.pl +++ a/admin/authorised_values.pl @@ -20,12 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Output; +use C4::Koha qw( getitemtypeimagelocation ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AuthorisedValues; use Koha::AuthorisedValueCategories; --- a/admin/authtypes.pl +++ a/admin/authtypes.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Authorities; use Koha::Authority::Types; --- a/admin/background_jobs.pl +++ a/admin/background_jobs.pl @@ -17,12 +17,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON qw( decode_json ); -use Try::Tiny; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::BackgroundJobs; use Koha::Virtualshelves; --- a/admin/biblio_framework.pl +++ a/admin/biblio_framework.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Biblios; use Koha::BiblioFramework; use Koha::BiblioFrameworks; --- a/admin/branch_transfer_limits.pl +++ a/admin/branch_transfer_limits.pl @@ -21,11 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit }; +use C4::Output qw( output_html_with_http_headers ); +use C4::Circulation qw( DeleteBranchTransferLimits CreateBranchTransferLimit IsBranchTransferAllowed ); my $input = CGI->new; --- a/admin/branches.pl +++ a/admin/branches.pl @@ -21,11 +21,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Koha; use Koha::Database; --- a/admin/cash_registers.pl +++ a/admin/cash_registers.pl @@ -21,13 +21,13 @@ use strict; use warnings; use CGI; -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use Koha::Libraries; use C4::Koha; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Cash::Registers; my $cgi = CGI->new(); --- a/admin/categories.pl +++ a/admin/categories.pl @@ -22,12 +22,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Form::MessagingPreferences; use Koha::Patrons; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patron::Categories; use Koha::Libraries; --- a/admin/check_budget_parent.pl +++ a/admin/check_budget_parent.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Budgets; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( CheckBudgetParent GetBudget ); =head1 DESCRIPTION --- a/admin/check_parent_total.pl +++ a/admin/check_parent_total.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Budgets; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Budgets qw( GetBudget GetBudgetPeriod ); =head1 DESCRIPTION --- a/admin/checkmarc.pl +++ a/admin/checkmarc.pl @@ -19,11 +19,10 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Biblio; my $input = CGI->new; --- a/admin/cities.pl +++ a/admin/cities.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Cities; --- a/admin/classsources.pl +++ a/admin/classsources.pl @@ -21,12 +21,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::ClassSortRoutine; -use C4::ClassSplitRoutine; +use C4::Output qw( output_html_with_http_headers ); +use C4::ClassSortRoutine qw( GetSortRoutineNames ); +use C4::ClassSplitRoutine qw( GetSplitRoutineNames ); use Koha::ClassSources; use Koha::ClassSortRules; use Koha::ClassSplitRules; --- a/admin/clone-rules.pl +++ a/admin/clone-rules.pl @@ -28,9 +28,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::CirculationRules; my $input = CGI->new; --- a/admin/columns_settings.pl +++ a/admin/columns_settings.pl @@ -2,9 +2,9 @@ use Modern::Perl; use CGI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Utils::DataTables::TablesSettings qw( get_modules ); my $input = CGI->new; --- a/admin/credit_types.pl +++ a/admin/credit_types.pl @@ -19,11 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Account::CreditType; use Koha::Account::CreditTypes; --- a/admin/currency.pl +++ a/admin/currency.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Acquisition::Booksellers; use Koha::Acquisition::Currencies; --- a/admin/debit_types.pl +++ a/admin/debit_types.pl @@ -19,11 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Account::DebitType; use Koha::Account::DebitTypes; --- a/admin/desks.pl +++ a/admin/desks.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Desks; --- a/admin/didyoumean.pl +++ a/admin/didyoumean.pl @@ -3,11 +3,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::SuggestionEngine; -use Module::Load::Conditional qw(can_load); -use JSON; +use Module::Load::Conditional qw( can_load ); +use JSON qw( from_json ); my $input = CGI->new; --- a/admin/edi_accounts.pl +++ a/admin/edi_accounts.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; use Koha::Plugins; --- a/admin/edi_ean_accounts.pl +++ a/admin/edi_ean_accounts.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; my $input = CGI->new(); --- a/admin/import_export_framework.pl +++ a/admin/import_export_framework.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use CGI::Cookie; use C4::Context; -use C4::Auth qw/check_cookie_auth/; -use C4::ImportExportFramework; +use C4::Auth qw( check_cookie_auth ); +use C4::ImportExportFramework qw( createODS ExportFramework ImportFramework ); my %cookies = CGI::Cookie->fetch(); my $authenticated = 0; --- a/admin/item_circulation_alerts.pl +++ a/admin/item_circulation_alerts.pl @@ -18,15 +18,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use File::Basename; -use Encode; -use JSON; +use JSON qw( encode_json ); #use Data::Dump 'pp'; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::ItemCirculationAlertPreference; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::ItemTypes; use Koha::Patron::Categories; --- a/admin/items_search_field.pl +++ a/admin/items_search_field.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Item::Search::Field qw(GetItemSearchField ModItemSearchField); --- a/admin/items_search_fields.pl +++ a/admin/items_search_fields.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Item::Search::Field qw(AddItemSearchField GetItemSearchFields DelItemSearchField); --- a/admin/itemtypes.pl +++ a/admin/itemtypes.pl @@ -25,12 +25,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use File::Spec; -use C4::Koha; +use C4::Koha qw( getImageSets GetAuthorisedValues ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::ItemTypes; use Koha::ItemType; use Koha::Localizations; --- a/admin/koha2marclinks.pl +++ a/admin/koha2marclinks.pl @@ -22,9 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use Koha::Database; -use C4::Auth; -use C4::Biblio; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::BiblioFrameworks; use Koha::Caches; use Koha::MarcSubfieldStructures; --- a/admin/library_groups.pl +++ a/admin/library_groups.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; use Koha::Library::Group; --- a/admin/localization.pl +++ a/admin/localization.pl @@ -18,8 +18,8 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Localization; use Koha::Localizations; --- a/admin/marc_subfields_structure.pl +++ a/admin/marc_subfields_structure.pl @@ -18,8 +18,8 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; --- a/admin/marctagstructure.pl +++ a/admin/marctagstructure.pl @@ -20,10 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Caches; --- a/admin/matching-rules.pl +++ a/admin/matching-rules.pl @@ -21,10 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); use C4::Matcher qw/valid_normalization_routines/; my $script_name = "/cgi-bin/koha/admin/matching-rules.pl"; --- a/admin/oai_set_mappings.pl +++ a/admin/oai_set_mappings.pl @@ -33,11 +33,10 @@ the OR operator will be applied. use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::OAI::Sets; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::OAI::Sets qw( GetOAISet GetOAISetMappings ModOAISetMappings ); -use Data::Dumper; my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { --- a/admin/oai_sets.pl +++ a/admin/oai_sets.pl @@ -29,11 +29,10 @@ Admin page to describe OAI SETs use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::OAI::Sets; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::OAI::Sets qw( AddOAISet DelOAISet GetOAISet GetOAISets ModOAISet ); -use Data::Dumper; my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { --- a/admin/overdrive.pl +++ a/admin/overdrive.pl @@ -19,9 +19,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; use Koha::Library::OverDriveInfos; --- a/admin/patron-attr-types.pl +++ a/admin/patron-attr-types.pl @@ -22,12 +22,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patron::Attribute::Types; use Koha::AuthorisedValues; --- a/admin/preferences.pl +++ a/admin/preferences.pl @@ -20,20 +20,18 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Languages qw(getTranslatedLanguages); -use C4::ClassSource; -use C4::Log; -use C4::Output; +use C4::Koha qw( getallthemes ); +use C4::Languages qw( getTranslatedLanguages ); +use C4::ClassSource qw( GetClassSources GetClassSource ); +use C4::Output qw( output_html_with_http_headers ); use C4::Templates; use Koha::Acquisition::Currencies; -use File::Spec; use IO::File; use YAML::XS; use Encode; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); # use Smart::Comments; # --- a/admin/searchengine/elasticsearch/mappings.pl +++ a/admin/searchengine/elasticsearch/mappings.pl @@ -17,9 +17,8 @@ use Modern::Perl; use CGI; -use Scalar::Util qw(looks_like_number); +use Scalar::Util qw( looks_like_number ); use List::Util qw( first ); -use C4::Koha; use C4::Output; use C4::Auth; use C4::Log; @@ -30,8 +29,8 @@ use Koha::SearchMarcMaps; use Koha::SearchFields; use Koha::Caches; -use Try::Tiny; -use Module::Load::Conditional qw(can_load); +use Try::Tiny qw( catch try ); +use Module::Load::Conditional qw( can_load ); my $input = CGI->new; --- a/admin/share_content.pl +++ a/admin/share_content.pl @@ -18,11 +18,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON; +use JSON qw( to_json ); use HTTP::Request; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::SharedContent; --- a/admin/smart-rules.pl +++ a/admin/smart-rules.pl @@ -20,10 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Koha; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::Logger; use Koha::Libraries; --- a/admin/sms_providers.pl +++ a/admin/sms_providers.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::SMS::Provider; use Koha::SMS::Providers; --- a/admin/smtp_servers.pl +++ a/admin/smtp_servers.pl @@ -20,11 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Scalar::Util qw(blessed); -use Try::Tiny; +use Scalar::Util qw( blessed ); +use Try::Tiny qw( catch try ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; use Koha::SMTP::Servers; --- a/admin/sru_modmapping.pl +++ a/admin/sru_modmapping.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); # Initialize CGI, template --- a/admin/systempreferences.pl +++ a/admin/systempreferences.pl @@ -43,13 +43,13 @@ ALSO : use Modern::Perl; use CGI qw ( -utf8 ); -use MIME::Base64; -use C4::Auth; +use MIME::Base64 qw( encode_base64 ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Languages qw(getTranslatedLanguages); -use C4::ClassSource; -use C4::Output; +use C4::Koha qw( getallthemes ); +use C4::Languages qw( getTranslatedLanguages ); +use C4::ClassSource qw( GetClassSources GetClassSource ); +use C4::Output qw( output_html_with_http_headers ); use YAML::XS; my %tabsysprefs; #we do no longer need to keep track of a tab per pref (yaml) --- a/admin/transfer_limits.pl +++ a/admin/transfer_limits.pl @@ -20,12 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Circulation - qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit }; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $input = CGI->new; --- a/admin/transport-cost-matrix.pl +++ a/admin/transport-cost-matrix.pl @@ -20,14 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Koha; -use C4::HoldsQueue qw(TransportCostMatrix UpdateTransportCostMatrix); +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::HoldsQueue qw( TransportCostMatrix UpdateTransportCostMatrix ); use Koha::Libraries; -use Data::Dumper; my $input = CGI->new; --- a/admin/usage_statistics.pl +++ a/admin/usage_statistics.pl @@ -18,9 +18,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::DateUtils qw( dt_from_string output_pref ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::DateUtils qw( output_pref ); use Koha::Libraries; my $query = CGI->new; --- a/admin/z3950servers.pl +++ a/admin/z3950servers.pl @@ -27,8 +27,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; use Koha::Z3950Servers; --- a/api/v1/app.pl +++ a/api/v1/app.pl @@ -17,5 +17,5 @@ use Modern::Perl; -require Mojolicious::Commands; +use Mojolicious::Commands; Mojolicious::Commands->start_app('Koha::REST::V1'); --- a/authorities/auth_finder.pl +++ a/authorities/auth_finder.pl @@ -21,11 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Acquisition; -use C4::Koha; use Koha::SearchEngine::Search; use Koha::SearchEngine::QueryBuilder; --- a/authorities/authorities-home.pl +++ a/authorities/authorities-home.pl @@ -20,16 +20,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); use POSIX qw( ceil ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::AuthoritiesMarc; -use C4::Acquisition; -use C4::Koha; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit pagination_bar output_html_with_http_headers ); +use C4::AuthoritiesMarc qw( DelAuthority ); use C4::Search::History; use Koha::Authority::Types; --- a/authorities/authorities.pl +++ a/authorities/authorities.pl @@ -21,16 +21,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::AuthoritiesMarc; -use C4::ImportBatch; #GetImportRecordMarc +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::AuthoritiesMarc qw( GetAuthority ); +use C4::ImportBatch qw( GetImportRecordMarc ); use C4::Context; -use C4::Koha; -use Date::Calc qw(Today); +use Date::Calc qw( Today ); use MARC::File::USMARC; use MARC::File::XML; -use C4::Biblio; +use C4::Biblio qw( TransformHtmlToMarc ); use Koha::Authority::Types; use Koha::ItemTypes; use vars qw( $tagslib); --- a/authorities/blinddetail-biblio-search.pl +++ a/authorities/blinddetail-biblio-search.pl @@ -38,13 +38,11 @@ parameters tables. use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); +use C4::AuthoritiesMarc qw( GetAuthority ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use MARC::Record; -use C4::Koha; use Koha::Authorities; use Koha::Authority::Types; --- a/authorities/detail-biblio-search.pl +++ a/authorities/detail-biblio-search.pl @@ -38,13 +38,11 @@ parameters tables. use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); +use C4::AuthoritiesMarc qw( GetAuthority ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use MARC::Record; -use C4::Koha; # use C4::Biblio; # use C4::Catalogue; --- a/authorities/detail.pl +++ a/authorities/detail.pl @@ -38,12 +38,11 @@ parameters tables. use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); +use C4::AuthoritiesMarc qw( GetAuthority GenerateHierarchy ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use MARC::Record; use C4::Koha; use Koha::Authorities; --- a/authorities/export.pl +++ a/authorities/export.pl @@ -2,9 +2,9 @@ use Modern::Perl; use C4::Record; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; -use C4::AuthoritiesMarc; +use C4::AuthoritiesMarc qw( GetAuthority ); use CGI qw ( -utf8 ); my $query = CGI->new; --- a/authorities/merge.pl +++ a/authorities/merge.pl @@ -19,11 +19,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::AuthoritiesMarc; -use C4::Koha; -use C4::Biblio; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::AuthoritiesMarc qw( GetAuthority ModAuthority DelAuthority ); +use C4::Biblio qw( TransformHtmlToMarc ); use Koha::Authority::MergeRequests; use Koha::Authority::Types; --- a/authorities/merge_ajax.pl +++ a/authorities/merge_ajax.pl @@ -4,11 +4,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before CGI parses the POST request -use JSON; +use JSON qw( encode_json ); use C4::Context; -use C4::Auth qw/check_cookie_auth/; -use C4::AuthoritiesMarc; +use C4::Auth qw( check_cookie_auth ); +use C4::AuthoritiesMarc qw( GetTagsLabels ); my %cookies = CGI::Cookie->fetch; my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => 'edit_catalogue' }); --- a/authorities/ysearch.pl +++ a/authorities/ysearch.pl @@ -29,12 +29,12 @@ This script allows ajax call for dynamic authorities search use CGI qw ( -utf8 ); use Modern::Perl; -use JSON; +use JSON qw( to_json ); use C4::Context; -use C4::Charset; -use C4::Auth qw/check_cookie_auth/; -use C4::Output; +use C4::Charset qw( nsb_clean ); +use C4::Auth qw( check_cookie_auth ); +use C4::Output qw( output_with_http_headers ); use Koha::SearchEngine::Search; use Koha::SearchEngine::QueryBuilder; --- a/basket/basket.pl +++ a/basket/basket.pl @@ -19,10 +19,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Koha; -use C4::Biblio; -use C4::Items; -use C4::Auth; -use C4::Output; +use C4::Biblio qw( + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcSeries + GetMarcSubjects + GetMarcUrls +); +use C4::Items qw( GetItemsInfo ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AuthorisedValues; use Koha::Biblios; --- a/basket/downloadcart.pl +++ a/basket/downloadcart.pl @@ -20,14 +20,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); +use Encode qw( encode ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Output qw( output_html_with_http_headers ); use C4::Record; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::CsvProfiles; --- a/basket/sendbasket.pl +++ a/basket/sendbasket.pl @@ -18,15 +18,20 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); -use Carp; -use Try::Tiny; - -use C4::Biblio; -use C4::Items; -use C4::Auth; -use C4::Output; -use C4::Templates (); +use Encode; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); + +use C4::Biblio qw( + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcSubjects +); +use C4::Items qw( GetItemsInfo ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Templates; use Koha::Email; use Koha::Token; --- a/catalogue/ISBDdetail.pl +++ a/catalogue/ISBDdetail.pl @@ -36,15 +36,13 @@ This script needs a biblionumber as parameter use Modern::Perl; use HTML::Entities; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Koha; -use C4::Biblio; -use C4::Items; -use C4::Serials; # CountSubscriptionFromBiblionumber -use C4::Search; # enabled_staff_search_views +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetISBDView GetMarcBiblio ); +use C4::Serials qw( CountSubscriptionFromBiblionumber GetSubscription GetSubscriptionsFromBiblionumber ); +use C4::Search qw( z3950_search_args enabled_staff_search_views ); use Koha::Biblios; use Koha::Patrons; --- a/catalogue/MARCdetail.pl +++ a/catalogue/MARCdetail.pl @@ -47,21 +47,25 @@ use Modern::Perl; use CGI qw ( -utf8 ); use HTML::Entities; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Koha; -use MARC::Record; -use C4::Biblio; -use C4::Items; -use C4::Acquisition; -use C4::Serials; #uses getsubscriptionsfrombiblionumber GetSubscriptionsFromBiblionumber -use C4::Search; # enabled_staff_search_views +use C4::Biblio qw( + GetAuthorisedValueDesc + GetBiblioData + GetFrameworkCode + GetMarcBiblio + GetMarcFromKohaField + GetMarcStructure +); +use C4::Serials qw( CountSubscriptionFromBiblionumber GetSubscription GetSubscriptionsFromBiblionumber ); +use C4::Search qw( z3950_search_args enabled_staff_search_views ); use Koha::Biblios; use Koha::BiblioFrameworks; use Koha::Patrons; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::Virtualshelves; use List::MoreUtils qw( uniq ); --- a/catalogue/detail.pl +++ a/catalogue/detail.pl @@ -20,26 +20,31 @@ use Modern::Perl; use CGI qw ( -utf8 ); use HTML::Entities; -use Try::Tiny; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Serials; #uses getsubscriptionfrom biblionumber -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Circulation; +use C4::Koha qw( + GetAuthorisedValues + getitemtypeimagelocation + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); +use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetMarcBiblio ); +use C4::Items qw( GetAnalyticsCount GetHostItemsInfo GetItemsInfo ); +use C4::Circulation qw( GetTransfers ); use C4::Reserves; -use C4::Serials; -use C4::XISBN qw(get_xisbns); -use C4::External::Amazon; -use C4::Search; # enabled_staff_search_views -use C4::Tags qw(get_tags); -use C4::XSLT; -use Koha::DateUtils; +use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); +use C4::XISBN qw( get_xisbns ); +use C4::External::Amazon qw( get_amazon_tld ); +use C4::Search qw( z3950_search_args enabled_staff_search_views ); +use C4::Tags qw( get_tags ); +use C4::XSLT qw( XSLTParse4Display ); +use Koha::DateUtils qw( format_sqldatetime ); use C4::HTML5Media; -use C4::CourseReserves qw(GetItemCourseReservesInfo); -use C4::Acquisition qw(GetOrdersByBiblionumber); +use C4::CourseReserves qw( GetItemCourseReservesInfo ); use Koha::AuthorisedValues; use Koha::Biblios; use Koha::CoverImages; --- a/catalogue/export.pl +++ a/catalogue/export.pl @@ -2,11 +2,11 @@ use Modern::Perl; use C4::Record; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio GetMarcControlnumber ); use CGI qw ( -utf8 ); -use C4::Ris; +use C4::Ris qw( marc2ris ); --- a/catalogue/getitem-ajax.pl +++ a/catalogue/getitem-ajax.pl @@ -19,13 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON; +use JSON qw( to_json ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Output; +use C4::Auth qw( check_api_auth ); +use C4::Biblio qw( GetMarcStructure ); +use C4::Output qw( output_with_http_headers ); use Koha::Libraries; use Koha::AuthorisedValues; --- a/catalogue/imageviewer.pl +++ a/catalogue/imageviewer.pl @@ -20,11 +20,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; -use C4::Search; +use C4::Auth qw( get_template_and_user ); +use C4::Items qw( GetItemsInfo ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Search qw( enabled_staff_search_views ); use Koha::Biblios; use Koha::Items; --- a/catalogue/issuehistory.pl +++ a/catalogue/issuehistory.pl @@ -19,12 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Biblio; # GetBiblio -use C4::Search; # enabled_staff_search_views -use C4::Serials; +use C4::Search qw( enabled_staff_search_views ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); use Koha::Checkouts; use Koha::Old::Checkouts; --- a/catalogue/item-export.pl +++ a/catalogue/item-export.pl @@ -21,7 +21,7 @@ use Modern::Perl; use CGI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; my $cgi = CGI->new; --- a/catalogue/itemsearch.pl +++ a/catalogue/itemsearch.pl @@ -19,13 +19,12 @@ use Modern::Perl; use CGI; -use JSON; +use JSON qw( to_json ); -use C4::Auth; -use C4::Output; -use C4::Items; -use C4::Biblio; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers output_html_with_http_headers ); +use C4::Items qw( SearchItems ); +use C4::Koha qw( GetAuthorisedValues ); use Koha::AuthorisedValues; use Koha::Biblios; --- a/catalogue/labeledMARCdetail.pl +++ a/catalogue/labeledMARCdetail.pl @@ -20,14 +20,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); use HTML::Entities; -use MARC::Record; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Search; # enabled_staff_search_views -use C4::Serials; +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( + GetBiblioData + GetFrameworkCode + GetMarcBiblio + GetMarcStructure +); +use C4::Search qw( z3950_search_args enabled_staff_search_views ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); use Koha::Biblios; use Koha::BiblioFrameworks; --- a/catalogue/moredetail.pl +++ a/catalogue/moredetail.pl @@ -20,21 +20,20 @@ use Modern::Perl; -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); use CGI qw ( -utf8 ); use HTML::Entities; -use C4::Biblio; -use C4::Items; -use C4::Acquisition; -use C4::Output; -use C4::Auth; -use C4::Serials; -use C4::Search; # enabled_staff_search_views +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetMarcBiblio ); +use C4::Items qw( GetHostItemsInfo GetItemsInfo ); +use C4::Acquisition qw( GetOrderFromItemnumber GetBasket GetInvoice ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); +use C4::Search qw( enabled_staff_search_views z3950_search_args ); use Koha::Acquisition::Booksellers; use Koha::AuthorisedValues; use Koha::Biblios; -use Koha::DateUtils; use Koha::Items; use Koha::Patrons; --- a/catalogue/search-history.pl +++ a/catalogue/search-history.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Search::History; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; --- a/catalogue/search.pl +++ a/catalogue/search.pl @@ -140,14 +140,14 @@ use Modern::Perl; ## load Koha modules use C4::Context; -use C4::Output; -use C4::Auth qw(:DEFAULT get_session); -use C4::Search; -use C4::Languages qw(getLanguages); -use C4::Koha; +use C4::Output qw( output_html_with_http_headers pagination_bar ); +use C4::Auth qw( get_template_and_user ); +use C4::Search qw( searchResults enabled_staff_search_views z3950_search_args new_record_from_zebra ); +use C4::Languages qw( getlanguage getLanguages ); +use C4::Koha qw( getitemtypeimagelocation GetAuthorisedValues ); use URI::Escape; use POSIX qw(ceil floor); -use C4::Search::History; +use C4::Search qw( searchResults enabled_staff_search_views z3950_search_args new_record_from_zebra ); use Koha::ItemTypes; use Koha::Library::Groups; --- a/catalogue/showmarc.pl +++ a/catalogue/showmarc.pl @@ -24,16 +24,15 @@ use Modern::Perl; # standard or CPAN modules used use CGI qw(:standard -utf8); -use DBI; use Encode; # Koha modules used use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Biblio; -use C4::ImportBatch; -use C4::XSLT (); +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio GetXmlBiblio ); +use C4::ImportBatch qw( GetRecordFromImportBiblio ); +use C4::XSLT; my $input= CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/catalogue/stockrotation.pl +++ a/catalogue/stockrotation.pl @@ -27,16 +27,16 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; -use C4::Search; -use C4::Serials; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Search qw( enabled_staff_search_views ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); use Koha::Biblio; use Koha::Item; use Koha::StockRotationRotas; use Koha::StockRotationStages; -use Koha::Util::StockRotation qw(:ALL); +use Koha::Util::StockRotation qw( get_stages get_branches toggle_indemand remove_from_stage move_to_next_stage ); my $input = CGI->new; --- a/catalogue/updateitem.pl +++ a/catalogue/updateitem.pl @@ -19,12 +19,10 @@ # along with Koha; if not, see . use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Context; -use C4::Biblio; -use C4::Items; use C4::Output; -use C4::Circulation; +use C4::Circulation qw( LostItem ); use C4::Reserves; my $cgi= CGI->new; --- a/cataloguing/addbiblio.pl +++ a/cataloguing/addbiblio.pl @@ -21,31 +21,40 @@ use Modern::Perl; -use CGI q(-utf8); -use C4::Output; -use C4::Auth; -use C4::Biblio; -use C4::Search; -use C4::AuthoritiesMarc; +use CGI; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user haspermission ); +use C4::Biblio qw( + AddBiblio + DelBiblio + GetFrameworkCode + GetMarcBiblio + GetMarcFromKohaField + GetMarcStructure + GetUsedMarcStructure + ModBiblio + prepare_host_field + PrepHostMarcField + TransformHtmlToMarc +); +use C4::Search qw( FindDuplicate enabled_staff_search_views ); +use C4::Auth qw( get_template_and_user haspermission ); use C4::Context; use MARC::Record; -use C4::Log; -use C4::Koha; -use C4::ClassSource; -use C4::ImportBatch; -use C4::Charset; +use C4::ClassSource qw( GetClassSources ); +use C4::ImportBatch qw( GetImportRecordMarc ); +use C4::Charset qw( SetMarcUnicodeFlag ); use Koha::BiblioFrameworks; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::ItemTypes; use Koha::Libraries; use Koha::BiblioFrameworks; -use Date::Calc qw(Today); use MARC::File::USMARC; use MARC::File::XML; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { MARC::File::XML->default_record_format('UNIMARC'); --- a/cataloguing/addbooks.pl +++ a/cataloguing/addbooks.pl @@ -27,14 +27,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use URI::Escape; -use C4::Auth; -use C4::Biblio; -use C4::Breeding; -use C4::Output; -use C4::Koha; -use C4::Languages qw(getlanguage); -use C4::Search; +use C4::Auth qw( get_template_and_user ); +use C4::Breeding qw( BreedingSearch ); +use C4::Output qw( output_html_with_http_headers pagination_bar ); +use C4::Koha qw( getnbpages ); +use C4::Languages; +use C4::Search qw( searchResults z3950_search_args ); use Koha::BiblioFrameworks; use Koha::SearchEngine::Search; --- a/cataloguing/additem.pl +++ a/cataloguing/additem.pl @@ -22,29 +22,39 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user haspermission ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Biblio qw( + GetAuthorisedValueDesc + GetFrameworkCode + GetMarcBiblio + GetMarcFromKohaField + GetMarcStructure + IsMarcStructureInternal + ModBiblio + TransformHtmlToXml + TransformMarcToKoha +); +use C4::Items qw( AddItemFromMarc ModItemFromMarc ); use C4::Context; -use C4::Circulation; -use C4::Koha; -use C4::ClassSource; -use Koha::DateUtils; +use C4::Circulation qw( LostItem ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::ClassSource qw( GetClassSources GetClassSource ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::ItemTypes; use Koha::Libraries; use Koha::Patrons; use Koha::SearchEngine::Indexer; -use List::MoreUtils qw/any/; -use C4::Search; -use Storable qw(thaw freeze); -use URI::Escape; +use List::MoreUtils qw( any ); +use C4::Search qw( enabled_staff_search_views ); +use Storable qw( freeze thaw ); +use URI::Escape qw( uri_escape_utf8 ); use C4::Members; use MARC::File::XML; -use URI::Escape; -use MIME::Base64 qw(decode_base64url encode_base64url); +use URI::Escape qw( uri_escape_utf8 ); +use MIME::Base64 qw( decode_base64url encode_base64url ); our $dbh = C4::Context->dbh; --- a/cataloguing/editor.pl +++ a/cataloguing/editor.pl @@ -21,12 +21,10 @@ use Modern::Perl; use CGI; -use MARC::Record; -use C4::Auth; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use DBIx::Class::ResultClass::HashRefInflator; use Koha::Database; use Koha::MarcSubfieldStructures; --- a/cataloguing/linkitem.pl +++ a/cataloguing/linkitem.pl @@ -22,12 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( GetMarcBiblio ModBiblio PrepHostMarcField ); use C4::Context; -use C4::Koha; my $query = CGI->new; --- a/cataloguing/merge.pl +++ a/cataloguing/merge.pl @@ -21,14 +21,22 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::Items; -use C4::Biblio; -use C4::Serials; -use C4::Koha; -use C4::Reserves qw/MergeHolds/; -use C4::Acquisition qw/ModOrder GetOrdersByBiblionumber/; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Items qw( MoveItemFromBiblio ); +use C4::Biblio qw( + DelBiblio + GetBiblioData + GetFrameworkCode + GetMarcBiblio + GetMarcFromKohaField + GetMarcStructure + ModBiblio + TransformHtmlToMarc +); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); +use C4::Reserves qw( MergeHolds ); +use C4::Acquisition qw( ModOrder GetOrdersByBiblionumber ); use Koha::BiblioFrameworks; use Koha::Items; --- a/cataloguing/merge_ajax.pl +++ a/cataloguing/merge_ajax.pl @@ -4,11 +4,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before CGI parses the POST request -use JSON; +use JSON qw( encode_json ); use C4::Context; -use C4::Biblio; -use C4::Auth qw/check_cookie_auth/; +use C4::Biblio qw( GetMarcStructure ); +use C4::Auth qw( check_cookie_auth ); my %cookies = CGI::Cookie->fetch; my ( $auth_status, $sessionID ) = check_cookie_auth( --- a/cataloguing/moveitem.pl +++ a/cataloguing/moveitem.pl @@ -22,18 +22,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Items qw( MoveItemFromBiblio ); use C4::Context; -use C4::Koha; use C4::ClassSource; use C4::Acquisition qw/GetOrderFromItemnumber ModOrder GetOrder/; use Koha::Biblios; -use Date::Calc qw(Today); use MARC::File::XML; --- a/cataloguing/value_builder/EXAMPLE.pl +++ a/cataloguing/value_builder/EXAMPLE.pl @@ -19,8 +19,8 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); # Example of framework plugin new style. # It should define and return at least one and normally two anynomous --- a/cataloguing/value_builder/barcode.pl +++ a/cataloguing/value_builder/barcode.pl @@ -24,10 +24,10 @@ use Modern::Perl; use C4::Context; use C4::Barcodes::ValueBuilder; -use C4::Biblio qw/GetMarcFromKohaField/; -use Koha::DateUtils; +use C4::Biblio qw( GetMarcFromKohaField ); +use Koha::DateUtils qw( dt_from_string output_pref ); -use Algorithm::CheckDigits; +use Algorithm::CheckDigits qw( CheckDigits ); my $builder = sub { my ( $params ) = @_; --- a/cataloguing/value_builder/barcode_manual.pl +++ a/cataloguing/value_builder/barcode_manual.pl @@ -24,8 +24,8 @@ use Modern::Perl; use C4::Context; use C4::Barcodes::ValueBuilder; -use C4::Biblio qw/GetMarcFromKohaField/; -use Koha::DateUtils; +use C4::Biblio qw( GetMarcFromKohaField ); +use Koha::DateUtils qw( dt_from_string output_pref ); my $builder = sub { my ( $params ) = @_; --- a/cataloguing/value_builder/callnumber-KU.pl +++ a/cataloguing/value_builder/callnumber-KU.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); =head1 DESCRIPTION --- a/cataloguing/value_builder/callnumber.pl +++ a/cataloguing/value_builder/callnumber.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); =head1 DESCRIPTION --- a/cataloguing/value_builder/cn_browser.pl +++ a/cataloguing/value_builder/cn_browser.pl @@ -20,11 +20,10 @@ # along with Koha; if not, see . use Modern::Perl; -use CGI; -use C4::Auth; -use C4::ClassSource; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::ClassSource qw( GetClassSort ); +use C4::Output qw( output_html_with_http_headers ); use Koha::ClassSources; --- a/cataloguing/value_builder/dateaccessioned.pl +++ a/cataloguing/value_builder/dateaccessioned.pl @@ -21,7 +21,7 @@ # along with Koha; if not, see . use Modern::Perl; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $builder = sub { my ( $params ) = @_; --- a/cataloguing/value_builder/macles.pl +++ a/cataloguing/value_builder/macles.pl @@ -23,8 +23,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); my $builder = sub { my ( $params ) = @_; --- a/cataloguing/value_builder/marc21_field_006.pl +++ a/cataloguing/value_builder/marc21_field_006.pl @@ -20,12 +20,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use XML::LibXML; --- a/cataloguing/value_builder/marc21_field_007.pl +++ a/cataloguing/value_builder/marc21_field_007.pl @@ -21,12 +21,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $builder = sub { my ( $params ) = @_; --- a/cataloguing/value_builder/marc21_field_008.pl +++ a/cataloguing/value_builder/marc21_field_008.pl @@ -20,12 +20,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use XML::LibXML; use Koha::Util::FrameworkPlugin qw|date_entered|; --- a/cataloguing/value_builder/marc21_field_008_authorities.pl +++ a/cataloguing/value_builder/marc21_field_008_authorities.pl @@ -20,12 +20,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Util::FrameworkPlugin qw|date_entered|; use constant FIXLEN_DATA_ELTS => '|| aca||aabn | a|a d'; --- a/cataloguing/value_builder/marc21_field_008_classifications.pl +++ a/cataloguing/value_builder/marc21_field_008_classifications.pl @@ -16,12 +16,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Util::FrameworkPlugin qw|date_entered|; use constant FIXLEN_DATA_ELTS => 'baaaaaaa'; --- a/cataloguing/value_builder/marc21_leader.pl +++ a/cataloguing/value_builder/marc21_leader.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $builder = sub { my ( $params ) = @_; --- a/cataloguing/value_builder/marc21_leader_authorities.pl +++ a/cataloguing/value_builder/marc21_leader_authorities.pl @@ -21,12 +21,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $builder = sub { my ( $params ) = @_; --- a/cataloguing/value_builder/marc21_linking_section.pl +++ a/cataloguing/value_builder/marc21_linking_section.pl @@ -22,15 +22,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Search; -use C4::Auth; -use C4::Output; +use C4::Search qw( new_record_from_zebra ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Biblio; -use C4::Koha; -use MARC::Record; +use C4::Biblio qw( GetMarcBiblio TransformMarcToKoha ); use Koha::ItemTypes; --- a/cataloguing/value_builder/normarc_field_007.pl +++ a/cataloguing/value_builder/normarc_field_007.pl @@ -18,12 +18,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/normarc_field_008.pl +++ a/cataloguing/value_builder/normarc_field_008.pl @@ -18,12 +18,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); # find today's date my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); --- a/cataloguing/value_builder/normarc_leader.pl +++ a/cataloguing/value_builder/normarc_leader.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/stocknumberAV.pl +++ a/cataloguing/value_builder/stocknumberAV.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AuthorisedValues; =head1 DESCRIPTION --- a/cataloguing/value_builder/stocknumberam123.pl +++ a/cataloguing/value_builder/stocknumberam123.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); =head1 DESCRIPTION --- a/cataloguing/value_builder/unimarc_field_010.pl +++ a/cataloguing/value_builder/unimarc_field_010.pl @@ -19,10 +19,10 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { --- a/cataloguing/value_builder/unimarc_field_100.pl +++ a/cataloguing/value_builder/unimarc_field_100.pl @@ -20,13 +20,13 @@ use Modern::Perl; -use Date::Calc qw( Today ); +use Date::Calc; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { --- a/cataloguing/value_builder/unimarc_field_100_authorities.pl +++ a/cataloguing/value_builder/unimarc_field_100_authorities.pl @@ -20,10 +20,10 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { --- a/cataloguing/value_builder/unimarc_field_105.pl +++ a/cataloguing/value_builder/unimarc_field_105.pl @@ -22,12 +22,12 @@ use strict; #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_106.pl +++ a/cataloguing/value_builder/unimarc_field_106.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_110.pl +++ a/cataloguing/value_builder/unimarc_field_110.pl @@ -22,12 +22,12 @@ use strict; #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_115a.pl +++ a/cataloguing/value_builder/unimarc_field_115a.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; --- a/cataloguing/value_builder/unimarc_field_115b.pl +++ a/cataloguing/value_builder/unimarc_field_115b.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; --- a/cataloguing/value_builder/unimarc_field_116.pl +++ a/cataloguing/value_builder/unimarc_field_116.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; --- a/cataloguing/value_builder/unimarc_field_117.pl +++ a/cataloguing/value_builder/unimarc_field_117.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_120.pl +++ a/cataloguing/value_builder/unimarc_field_120.pl @@ -22,12 +22,12 @@ use strict; #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_121a.pl +++ a/cataloguing/value_builder/unimarc_field_121a.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_121b.pl +++ a/cataloguing/value_builder/unimarc_field_121b.pl @@ -19,12 +19,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_122.pl +++ a/cataloguing/value_builder/unimarc_field_122.pl @@ -19,12 +19,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_123a.pl +++ a/cataloguing/value_builder/unimarc_field_123a.pl @@ -19,12 +19,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_123d.pl +++ a/cataloguing/value_builder/unimarc_field_123d.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_123e.pl +++ a/cataloguing/value_builder/unimarc_field_123e.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_123f.pl +++ a/cataloguing/value_builder/unimarc_field_123f.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_123g.pl +++ a/cataloguing/value_builder/unimarc_field_123g.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_123i.pl +++ a/cataloguing/value_builder/unimarc_field_123i.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_123j.pl +++ a/cataloguing/value_builder/unimarc_field_123j.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_124.pl +++ a/cataloguing/value_builder/unimarc_field_124.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_124a.pl +++ a/cataloguing/value_builder/unimarc_field_124a.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_124b.pl +++ a/cataloguing/value_builder/unimarc_field_124b.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_124c.pl +++ a/cataloguing/value_builder/unimarc_field_124c.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_124d.pl +++ a/cataloguing/value_builder/unimarc_field_124d.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_124e.pl +++ a/cataloguing/value_builder/unimarc_field_124e.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_124f.pl +++ a/cataloguing/value_builder/unimarc_field_124f.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_124g.pl +++ a/cataloguing/value_builder/unimarc_field_124g.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_125.pl +++ a/cataloguing/value_builder/unimarc_field_125.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); =head1 DESCRIPTION --- a/cataloguing/value_builder/unimarc_field_125a.pl +++ a/cataloguing/value_builder/unimarc_field_125a.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_125b.pl +++ a/cataloguing/value_builder/unimarc_field_125b.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_126.pl +++ a/cataloguing/value_builder/unimarc_field_126.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_126a.pl +++ a/cataloguing/value_builder/unimarc_field_126a.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_126b.pl +++ a/cataloguing/value_builder/unimarc_field_126b.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_127.pl +++ a/cataloguing/value_builder/unimarc_field_127.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_128a.pl +++ a/cataloguing/value_builder/unimarc_field_128a.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_128b.pl +++ a/cataloguing/value_builder/unimarc_field_128b.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_128c.pl +++ a/cataloguing/value_builder/unimarc_field_128c.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_130.pl +++ a/cataloguing/value_builder/unimarc_field_130.pl @@ -22,12 +22,12 @@ use strict; #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_135a.pl +++ a/cataloguing/value_builder/unimarc_field_135a.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_140.pl +++ a/cataloguing/value_builder/unimarc_field_140.pl @@ -22,12 +22,12 @@ use strict; #use warnings; FIXME - Bug 2505 use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_141.pl +++ a/cataloguing/value_builder/unimarc_field_141.pl @@ -20,12 +20,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_210c.pl +++ a/cataloguing/value_builder/unimarc_field_210c.pl @@ -19,14 +19,13 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( pagination_bar output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Search; -use MARC::Record; -use C4::Koha; +use C4::Koha qw( getnbpages ); ###TODO To rewrite in order to use SearchAuthorities --- a/cataloguing/value_builder/unimarc_field_210c_bis.pl +++ a/cataloguing/value_builder/unimarc_field_210c_bis.pl @@ -40,12 +40,12 @@ It need : use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::AuthoritiesMarc; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; --- a/cataloguing/value_builder/unimarc_field_225a.pl +++ a/cataloguing/value_builder/unimarc_field_225a.pl @@ -41,12 +41,13 @@ It need : use strict; #use warnings; FIXME - Bug 2505 -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::AuthoritiesMarc; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::AuthoritiesMarc qw( SearchAuthorities GetAuthority ); =head1 DESCRIPTION --- a/cataloguing/value_builder/unimarc_field_225a_bis.pl +++ a/cataloguing/value_builder/unimarc_field_225a_bis.pl @@ -24,11 +24,11 @@ biblioitems.collectiontitle use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw( -utf8 ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ a/cataloguing/value_builder/unimarc_field_4XX.pl @@ -22,15 +22,13 @@ use strict; #use warnings; FIXME - Bug 2505 use CGI qw ( -utf8 ); -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Search; -use C4::Auth; -use C4::Output; +use C4::Search qw( new_record_from_zebra ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Biblio; -use C4::Koha; -use MARC::Record; +use C4::Biblio qw( GetMarcBiblio TransformMarcToKoha ); use Koha::ItemTypes; --- a/cataloguing/value_builder/unimarc_field_686a.pl +++ a/cataloguing/value_builder/unimarc_field_686a.pl @@ -19,12 +19,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_field_700-4.pl +++ a/cataloguing/value_builder/unimarc_field_700-4.pl @@ -21,12 +21,12 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; --- a/cataloguing/value_builder/unimarc_leader.pl +++ a/cataloguing/value_builder/unimarc_leader.pl @@ -21,12 +21,12 @@ use Modern::Perl; use Koha::Util::FrameworkPlugin qw(wrapper); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; --- a/cataloguing/ysearch.pl +++ a/cataloguing/ysearch.pl @@ -27,9 +27,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Charset; -use C4::Auth qw/check_cookie_auth/; -use JSON qw/ to_json /; +use C4::Charset qw( nsb_clean ); +use C4::Auth qw( check_cookie_auth ); +use JSON qw( to_json ); my $input = CGI->new; my $query = $input->param('term'); --- a/cataloguing/z3950_auth_search.pl +++ a/cataloguing/z3950_auth_search.pl @@ -20,11 +20,10 @@ use Modern::Perl; use CGI qw / -utf8 /; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Breeding; -use C4::Koha; +use C4::Breeding qw( Z3950Search Z3950SearchAuth ); my $input = CGI->new; my $dbh = C4::Context->dbh; --- a/cataloguing/z3950_search.pl +++ a/cataloguing/z3950_search.pl @@ -21,11 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Breeding; -use C4::Koha; +use C4::Breeding qw( Z3950Search ); my $input = CGI->new; my $error = $input->param('error'); --- a/circ/add_message.pl +++ a/circ/add_message.pl @@ -21,7 +21,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use Koha::Patron::Message; --- a/circ/article-request-slip.pl +++ a/circ/article-request-slip.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Letters; use Koha::ArticleRequests; use Koha::Patrons; --- a/circ/article-requests.pl +++ a/circ/article-requests.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::ArticleRequests; my $query = CGI->new; --- a/circ/bookcount.pl +++ a/circ/bookcount.pl @@ -23,12 +23,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Circulation; -use C4::Output; -use C4::Koha; -use C4::Auth; +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Biblios; -use Koha::DateUtils; use Koha::Libraries; my $input = CGI->new; --- a/circ/branchoverdues.pl +++ a/circ/branchoverdues.pl @@ -19,14 +19,13 @@ use Modern::Perl; use C4::Context; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::Overdues; -use C4::Biblio; -use C4::Koha; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Overdues qw( GetOverduesForBranch ); +use C4::Biblio qw( GetMarcFromKohaField GetMarcStructure ); +use C4::Koha qw( GetAuthorisedValues ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::BiblioFrameworks; -use Data::Dumper; =head1 branchoverdues.pl --- a/circ/branchtransfers.pl +++ a/circ/branchtransfers.pl @@ -22,13 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Circulation; -use C4::Output; -use C4::Reserves; -use C4::Biblio; -use C4::Items; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Koha; +use C4::Circulation qw( transferbook ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reserves qw( ModReserve ModReserveAffect ); +use C4::Auth qw( get_session get_template_and_user ); use C4::Members; use Koha::BiblioFrameworks; use Koha::AuthorisedValues; --- a/circ/checkout-notes.pl +++ a/circ/checkout-notes.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Checkouts; my $query = CGI->new; --- a/circ/circulation-home.pl +++ a/circ/circulation-home.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::BiblioFrameworks; use Koha::Checkouts; --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -29,15 +29,14 @@ use CGI qw ( -utf8 ); use DateTime; use DateTime::Duration; use Scalar::Util qw( looks_like_number ); -use C4::Output; -use C4::Auth qw/:DEFAULT get_session haspermission/; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_session get_template_and_user ); use C4::Koha; -use C4::Circulation; +use C4::Circulation qw( barcodedecode CanBookBeIssued AddIssue ); use C4::Utils::DataTables::Members; use C4::Members; -use C4::Biblio; -use C4::Search; -use MARC::Record; +use C4::Biblio qw( TransformMarcToKoha ); +use C4::Search qw( new_record_from_zebra ); use C4::Reserves; use Koha::Holds; use C4::Context; @@ -45,8 +44,8 @@ use CGI::Session; use Koha::AuthorisedValues; use Koha::CsvProfiles; use Koha::Patrons; -use Koha::Patron::Debarments qw(GetDebarments); -use Koha::DateUtils; +use Koha::Patron::Debarments qw( GetDebarments ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::BiblioFrameworks; use Koha::Items; @@ -55,12 +54,7 @@ use Koha::SearchEngine; use Koha::SearchEngine::Search; use Koha::Patron::Modifications; -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); # # PARAMETERS READING --- a/circ/del_message.pl +++ a/circ/del_message.pl @@ -21,7 +21,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use Koha::Patron::Messages; --- a/circ/hold-transfer-slip.pl +++ a/circ/hold-transfer-slip.pl @@ -20,10 +20,10 @@ use Modern::Perl; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Auth qw/:DEFAULT get_session/; -use C4::Reserves; +use C4::Auth qw( get_session get_template_and_user ); +use C4::Reserves qw( ReserveSlip ); my $input = CGI->new; my $sessionID = $input->cookie("CGISESSID"); --- a/circ/offline-mf.pl +++ a/circ/offline-mf.pl @@ -18,7 +18,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); my $query = CGI->new; my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( --- a/circ/offline.pl +++ a/circ/offline.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; my $query = CGI->new; --- a/circ/on-site_checkouts.pl +++ a/circ/on-site_checkouts.pl @@ -18,10 +18,9 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Circulation qw( GetPendingOnSiteCheckouts ); -use C4::Output; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); use Koha::BiblioFrameworks; my $cgi = CGI->new; --- a/circ/overdue.pl +++ a/circ/overdue.pl @@ -21,11 +21,11 @@ use Modern::Perl; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw(-oldstyle_urls -utf8); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use Text::CSV_XS; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use DateTime; use DateTime::Format::MySQL; --- a/circ/pendingreserves.pl +++ a/circ/pendingreserves.pl @@ -25,13 +25,13 @@ use YAML::XS; use Encode; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Items qw( ModItemTransfer ); +use C4::Auth qw( get_template_and_user ); +use C4::Items; use C4::Reserves qw( ModReserveCancelAll ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Holds; use DateTime::Duration; --- a/circ/renew.pl +++ a/circ/renew.pl @@ -21,11 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; -use C4::Circulation; -use C4::Koha; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Circulation qw( barcodedecode CanBookBeRenewed GetSoonestRenewDate GetLatestAutoRenewDate AddRenewal ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Database; use Koha::BiblioFrameworks; --- a/circ/request-article.pl +++ a/circ/request-article.pl @@ -19,11 +19,11 @@ use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Utils::DataTables::Members; -use C4::Search; -use C4::Serials; +use C4::Search qw( enabled_staff_search_views ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); use Koha::Biblios; use Koha::Patrons; use Koha::ArticleRequests; --- a/circ/reserveratios.pl +++ a/circ/reserveratios.pl @@ -21,14 +21,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Date::Calc qw/Today Add_Delta_YM/; use POSIX qw( ceil ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Acquisition qw/GetOrdersByBiblionumber/; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Acquisition::Baskets; my $input = CGI->new; --- a/circ/returns.pl +++ a/circ/returns.pl @@ -34,25 +34,23 @@ use Modern::Perl; use CGI qw ( -utf8 ); use DateTime; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; -use C4::Circulation; -use C4::Reserves; -use C4::Biblio; -use C4::Circulation; +use C4::Auth qw( get_template_and_user get_session haspermission ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Circulation qw( barcodedecode GetBranchItemRule AddReturn updateWrongTransfer LostItem ); +use C4::Reserves qw( ModReserve ModReserveAffect GetOtherReserves ); +use C4::Circulation qw( barcodedecode GetBranchItemRule AddReturn updateWrongTransfer LostItem ); use C4::Context; -use C4::Items; -use C4::Koha; # FIXME : is it still useful ? +use C4::Items qw( ModItemTransfer ); use C4::Members::Messaging; use C4::Members; -use C4::Output; -use C4::Reserves; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reserves qw( ModReserve ModReserveAffect GetOtherReserves ); use C4::RotatingCollections; use Koha::AuthorisedValues; use Koha::BiblioFrameworks; use Koha::Calendar; use Koha::Checkouts; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Holds; use Koha::Items; use Koha::Item::Transfers; --- a/circ/set-library.pl +++ a/circ/set-library.pl @@ -21,9 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user get_session ); use Koha::BiblioFrameworks; use Koha::Cash::Registers; use Koha::Libraries; --- a/circ/transfer-slip.pl +++ a/circ/transfer-slip.pl @@ -21,10 +21,10 @@ use Modern::Perl; use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Auth qw/:DEFAULT get_session/; -use C4::Circulation; +use C4::Auth qw( get_session get_template_and_user ); +use C4::Circulation qw( TransferSlip ); my $input = CGI->new; my $sessionID = $input->cookie("CGISESSID"); --- a/circ/transfers_to_send.pl +++ a/circ/transfers_to_send.pl @@ -20,10 +20,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); my $input = CGI->new; my $itemnumber = $input->param('itemnumber'); --- a/circ/transferstoreceive.pl +++ a/circ/transferstoreceive.pl @@ -21,23 +21,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Biblio; -use C4::Circulation; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Circulation qw( GetTransfers GetTransfersFromTo ); use C4::Members; -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); +use Date::Calc qw( Add_Delta_Days Date_to_Days Today ); -use C4::Koha; use C4::Reserves; use Koha::Items; use Koha::ItemTypes; use Koha::Libraries; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::BiblioFrameworks; use Koha::Patrons; --- a/circ/view_holdsqueue.pl +++ a/circ/view_holdsqueue.pl @@ -24,11 +24,9 @@ This script displays items in the tmp_holdsqueue table use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::HoldsQueue qw(GetHoldsQueueItems); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::HoldsQueue qw( GetHoldsQueueItems ); use Koha::BiblioFrameworks; use Koha::ItemTypes; --- a/circ/waitingreserves.pl +++ a/circ/waitingreserves.pl @@ -21,20 +21,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Circulation; -use C4::Members; -use C4::Biblio; -use C4::Items; -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); -use C4::Reserves; -use C4::Koha; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Items qw( ModItemTransfer ); +use Date::Calc qw( Date_to_Days Today ); +use C4::Reserves qw( ModReserve ModReserveCancelAll ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::BiblioFrameworks; use Koha::Items; use Koha::ItemTypes; --- a/circ/ysearch.pl +++ a/circ/ysearch.pl @@ -27,9 +27,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw/check_cookie_auth/; +use C4::Auth qw( check_cookie_auth ); use Koha::Patrons; -use Koha::DateUtils qw/format_sqldatetime/; +use Koha::DateUtils qw( format_sqldatetime ); use JSON qw( to_json ); --- a/clubs/club-enrollments.pl +++ a/clubs/club-enrollments.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Clubs; my $cgi = CGI->new; --- a/clubs/clubs-add-modify.pl +++ a/clubs/clubs-add-modify.pl @@ -21,10 +21,10 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Clubs; use Koha::Club::Fields; --- a/clubs/clubs.pl +++ a/clubs/clubs.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Clubs; use Koha::Club::Templates; --- a/clubs/patron-clubs-tab.pl +++ a/clubs/patron-clubs-tab.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; use Koha::Club::Enrollments; --- a/clubs/patron-enroll.pl +++ a/clubs/patron-enroll.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Clubs; my $cgi = CGI->new; --- a/clubs/templates-add-modify.pl +++ a/clubs/templates-add-modify.pl @@ -21,10 +21,10 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use Koha::DateUtils qw(dt_from_string); +use Koha::DateUtils qw( dt_from_string ); use Koha::Club::Templates; use Koha::Club::Template::Fields; use Koha::Club::Template::EnrollmentFields; --- a/course_reserves/add_items.pl +++ a/course_reserves/add_items.pl @@ -22,13 +22,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Koha; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); use Koha::Items; -use C4::CourseReserves qw(GetCourse GetCourseItem GetCourseReserve ModCourseItem ModCourseReserve); +use C4::CourseReserves qw( GetCourse GetCourseReserve ModCourse ModCourseItem ModCourseReserve ); use Koha::Items; use Koha::ItemTypes; --- a/course_reserves/batch_add_items.pl +++ a/course_reserves/batch_add_items.pl @@ -23,9 +23,9 @@ use Modern::Perl; use CGI qw( -utf8 ); use List::MoreUtils qw( uniq ); -use C4::Auth; -use C4::Output; -use C4::CourseReserves qw(ModCourseItem ModCourseReserve GetCourse); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::CourseReserves qw( GetCourse ModCourse ModCourseItem ModCourseReserve ); use Koha::Items; --- a/course_reserves/batch_rm_items.pl +++ a/course_reserves/batch_rm_items.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw( -utf8 ); use List::MoreUtils qw( uniq ); -use C4::Auth; -use C4::Output; -use C4::CourseReserves qw(GetItemCourseReservesInfo DelCourseReserve GetCourseItem); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::CourseReserves qw( GetCourse GetCourseItem GetItemCourseReservesInfo DelCourse DelCourseReserve ); use Koha::Items; --- a/course_reserves/course-details.pl +++ a/course_reserves/course-details.pl @@ -22,11 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::CourseReserves qw(DelCourseReserve GetCourse GetCourseReserves); +use C4::CourseReserves qw( DelCourse DelCourseReserve GetCourse GetCourseReserve GetCourseReserves ); my $cgi = CGI->new; --- a/course_reserves/course-reserves.pl +++ a/course_reserves/course-reserves.pl @@ -22,10 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::CourseReserves qw(GetCourses); +use C4::CourseReserves qw( GetCourse GetCourses ); my $cgi = CGI->new; --- a/course_reserves/course.pl +++ a/course_reserves/course.pl @@ -22,11 +22,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); -use C4::CourseReserves qw(GetCourse); +use C4::CourseReserves qw( GetCourse ); my $cgi = CGI->new; --- a/course_reserves/mod_course.pl +++ a/course_reserves/mod_course.pl @@ -23,9 +23,9 @@ use CGI qw ( -utf8 ); use C4::Output; use C4::Reserves; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); -use C4::CourseReserves qw(DelCourse ModCourse ModCourseInstructors); +use C4::CourseReserves qw( DelCourse ModCourse ModCourseInstructors ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/docs/CAS/CASProxy/examples/proxy_cas_callback.pl +++ a/docs/CAS/CASProxy/examples/proxy_cas_callback.pl @@ -28,7 +28,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use Authen::CAS::Client; -use Storable qw(nstore_fd); +use Storable qw( nstore_fd ); my $casServerUrl = 'https://localhost:8443/cas/'; my $cas = Authen::CAS::Client->new($casServerUrl); --- a/docs/CAS/CASProxy/examples/proxy_cas_data.pl +++ a/docs/CAS/CASProxy/examples/proxy_cas_data.pl @@ -33,9 +33,8 @@ This PGTIOU will allow us to retrive the matching PGTID use Modern::Perl; use CGI qw ( -utf8 ); use Authen::CAS::Client; -use Storable qw(fd_retrieve); -use LWP::Simple; -use URI::Escape; +use Storable qw( fd_retrieve ); +use LWP::Simple qw( get ); my $casServerUrl = 'https://localhost:8443/cas/'; my $cas = Authen::CAS::Client->new($casServerUrl); --- a/errors/400.pl +++ a/errors/400.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/errors/401.pl +++ a/errors/401.pl @@ -17,10 +17,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/errors/402.pl +++ a/errors/402.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/errors/403.pl +++ a/errors/403.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/errors/404.pl +++ a/errors/404.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/errors/500.pl +++ a/errors/500.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/help.pl +++ a/help.pl @@ -20,7 +20,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use Koha::Manual; --- a/ill/ill-requests.pl +++ a/ill/ill-requests.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Notice::Templates; use Koha::AuthorisedValues; use Koha::Illcomment; @@ -31,9 +31,9 @@ use Koha::Illrequest::Availability; use Koha::Libraries; use Koha::Token; -use Try::Tiny; -use URI::Escape; -use JSON; +use Try::Tiny qw( catch try ); +use URI::Escape qw( uri_escape_utf8 ); +use JSON qw( encode_json ); our $cgi = CGI->new; my $illRequests = Koha::Illrequests->new; --- a/installer/data/mysql/backfill_statistics.pl +++ a/installer/data/mysql/backfill_statistics.pl @@ -6,13 +6,9 @@ use Modern::Perl; # CPAN modules -use DBI; -use Getopt::Long; # Koha modules use C4::Context; -use C4::Items; -use Data::Dumper; my $dbh = C4::Context->dbh; --- a/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl +++ a/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl @@ -22,11 +22,11 @@ use Modern::Perl; use C4::Context; use C4::Overdues qw/CalcFine/; -use C4::Log qw/logaction/; +use C4::Log qw( logaction ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ($help, $verbose, $confirm, $log, $stdout_log); --- a/installer/data/mysql/update22to30.pl +++ a/installer/data/mysql/update22to30.pl @@ -14,12 +14,10 @@ use strict; # CPAN modules -use DBI; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); # Koha modules use C4::Context; -use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); # FIXME - The user might be installing a new database, so can't rely --- a/installer/html-template-to-template-toolkit.pl +++ a/installer/html-template-to-template-toolkit.pl @@ -1,12 +1,10 @@ #!/usr/bin/perl use Modern::Perl; -use Carp; -use Data::Dumper; +use Carp qw( croak ); -use Getopt::Long; -use File::Basename; -use File::Copy; +use Getopt::Long qw( GetOptions ); +use File::Copy qw( copy ); my $help_msg = <new; --- a/labels/label-create-pdf.pl +++ a/labels/label-create-pdf.pl @@ -21,7 +21,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Creators; use C4::Labels; --- a/labels/label-create-xml.pl +++ a/labels/label-create-xml.pl @@ -22,9 +22,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use XML::Simple; -use Data::Dumper; -use C4::Creators; use C4::Labels; my $cgi = CGI->new; --- a/labels/label-edit-batch.pl +++ a/labels/label-edit-batch.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_label_summary html_table ); use C4::Labels; use Koha::Items; --- a/labels/label-edit-layout.pl +++ a/labels/label-edit-layout.pl @@ -21,11 +21,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use POSIX; +use POSIX qw( exit sprintf ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( + get_barcode_types + get_font_types + get_label_types + get_text_justification_types +); use C4::Labels; my $cgi = CGI->new; --- a/labels/label-edit-profile.pl +++ a/labels/label-edit-profile.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_all_templates get_unit_values ); use C4::Labels; my $cgi = CGI->new; --- a/labels/label-edit-range.pl +++ a/labels/label-edit-range.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/labels/label-edit-template.pl +++ a/labels/label-edit-template.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_all_profiles get_unit_values ); use C4::Labels; my $cgi = CGI->new; --- a/labels/label-home.pl +++ a/labels/label-home.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/labels/label-item-search.pl +++ a/labels/label-item-search.pl @@ -20,18 +20,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::Util qw( max min ); -use POSIX qw(ceil); +use POSIX qw( ceil ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Search qw(SimpleSearch); -use C4::Biblio qw(TransformMarcToKoha); -use C4::Creators::Lib qw(html_table); +use C4::Search qw( new_record_from_zebra ); +use C4::Biblio qw( TransformMarcToKoha ); +use C4::Creators::Lib qw( html_table ); use Koha::Logger; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Items; use Koha::ItemTypes; use Koha::SearchEngine::Search; --- a/labels/label-manage.pl +++ a/labels/label-manage.pl @@ -21,11 +21,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Data::Dumper; -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( + get_all_layouts + get_all_profiles + get_all_templates + get_batch_summary + html_table +); use C4::Labels; my $cgi = CGI->new; --- a/labels/label-print.pl +++ a/labels/label-print.pl @@ -20,12 +20,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Data::Dumper; use C4::Context; -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators::Lib qw(get_all_templates get_all_layouts get_output_formats); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators::Lib qw( + get_all_layouts + get_all_templates + get_output_formats +); use C4::Labels::Batch; my $cgi = CGI->new; --- a/labels/spinelabel-home.pl +++ a/labels/spinelabel-home.pl @@ -17,8 +17,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; # use Smart::Comments; --- a/labels/spinelabel-print.pl +++ a/labels/spinelabel-print.pl @@ -17,8 +17,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $scheme = C4::Context->preference('SpineLabelFormat'); my $query = CGI->new; --- a/lib/CGI/Session/Serialize/yamlxs.pm +++ a/lib/CGI/Session/Serialize/yamlxs.pm @@ -4,7 +4,7 @@ use strict; use warnings; use CGI::Session::ErrorHandler; -use YAML::XS (); +use YAML::XS; $CGI::Session::Serialize::yamlxs::VERSION = '0.1'; @CGI::Session::Serialize::yamlxs::ISA = ( "CGI::Session::ErrorHandler" ); --- a/mainpage.pl +++ a/mainpage.pl @@ -21,10 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Koha; -use C4::Tags qw/get_count_by_tag_status/; +use C4::Tags qw( get_count_by_tag_status ); use Koha::News; use Koha::Patron::Modifications; use Koha::Patron::Discharge; --- a/members/accountline-details.pl +++ a/members/accountline-details.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Patrons; use Koha::Account::Lines; --- a/members/apikeys.pl +++ a/members/apikeys.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use Koha::ApiKeys; use Koha::Patrons; --- a/members/boraccount.pl +++ a/members/boraccount.pl @@ -23,10 +23,10 @@ # along with Koha; if not, see . use Modern::Perl; -use URI::Escape; +use URI::Escape qw( uri_unescape ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Accounts; --- a/members/cancel-charge.pl +++ a/members/cancel-charge.pl @@ -19,7 +19,7 @@ use Modern::Perl; use CGI; -use C4::Auth; +use C4::Auth qw( checkauth ); use Koha::Token; my $cgi = CGI->new; --- a/members/deletemem.pl +++ a/members/deletemem.pl @@ -25,13 +25,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Members; -use C4::Suggestions qw( SearchSuggestion ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Suggestions; use Koha::Patrons; use Koha::Token; use Koha::Patron::Categories; --- a/members/discharge.pl +++ a/members/discharge.pl @@ -28,18 +28,17 @@ Allows librarian to edit and/or manage borrowers' discharges =cut use Modern::Perl; -use Carp; +use Carp qw( carp ); use CGI qw( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Members; use C4::Reserves; use C4::Letters; use Koha::Patron::Discharge; use Koha::Patrons; -use Koha::DateUtils; my $input = CGI->new; --- a/members/discharges.pl +++ a/members/discharges.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Context; use Koha::Patron::Discharge; --- a/members/files.pl +++ a/members/files.pl @@ -21,11 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Members; -use Koha::DateUtils; use Koha::Patrons; use Koha::Patron::Files; use Koha::Patron::Categories; --- a/members/guarantor_search.pl +++ a/members/guarantor_search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; --- a/members/holdshistory.pl +++ a/members/holdshistory.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; --- a/members/housebound.pl +++ a/members/housebound.pl @@ -26,11 +26,11 @@ use Modern::Perl; use CGI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use DateTime; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Libraries; use Koha::Patrons; use Koha::Patron::Categories; --- a/members/ill-requests.pl +++ a/members/ill-requests.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use Koha::Patrons; my $input = CGI->new; --- a/members/mancredit.pl +++ a/members/mancredit.pl @@ -23,13 +23,12 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Accounts; -use C4::Items; use Koha::Items; use Koha::Patrons; --- a/members/maninvoice.pl +++ a/members/maninvoice.pl @@ -23,15 +23,14 @@ # along with Koha; if not, see . use Modern::Perl; -use Try::Tiny; -use URI::Escape; +use Try::Tiny qw( catch try ); +use URI::Escape qw( uri_escape_utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Accounts; -use C4::Items; use Koha::Token; use Koha::Patrons; --- a/members/member-flags.pl +++ a/members/member-flags.pl @@ -7,16 +7,14 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth qw(:DEFAULT :EditPermissions); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user get_all_subpermissions get_user_subpermissions ); use C4::Context; -use C4::Members; -#use C4::Acquisitions; use Koha::Patron::Categories; use Koha::Patrons; -use C4::Output; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use Koha::Token; my $input = CGI->new; --- a/members/member-password.pl +++ a/members/member-password.pl @@ -6,20 +6,16 @@ use Modern::Perl; -use C4::Auth; -use Koha::AuthUtils; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Context; -use C4::Members; -use C4::Circulation; use CGI qw ( -utf8 ); -use Koha::AuthUtils; use Koha::Token; use Koha::Patrons; use Koha::Patron::Categories; -use Try::Tiny; +use Try::Tiny qw( catch try ); my $input = CGI->new; --- a/members/member.pl +++ a/members/member.pl @@ -24,11 +24,10 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw( -utf8 ); -use Koha::DateUtils; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); use Koha::Patrons; my $input = CGI->new; --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -23,22 +23,20 @@ use Modern::Perl; # external modules use CGI qw ( -utf8 ); -use List::MoreUtils qw/uniq/; # internal modules -use C4::Auth; +use C4::Auth qw( get_template_and_user haspermission ); use C4::Context; -use C4::Output; -use C4::Members; -use C4::Koha; -use C4::Log; -use C4::Letters; +use C4::Output qw( output_and_exit output_and_exit_if_error output_html_with_http_headers ); +use C4::Members qw( checkcardnumber get_cardnumber_length ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Letters qw( SendAlerts ); use C4::Form::MessagingPreferences; use Koha::AuthUtils; use Koha::AuthorisedValues; -use Koha::Patron::Debarments; +use Koha::Patron::Debarments qw( AddDebarment DelDebarment GetDebarments ); use Koha::Cities; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; use Koha::Patrons; use Koha::Patron::Attribute::Types; --- a/members/members-home.pl +++ a/members/members-home.pl @@ -19,13 +19,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use C4::Members; use Koha::Patron::Modifications; use Koha::Libraries; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); use Koha::Patron::Categories; my $query = CGI->new; --- a/members/members-update-do.pl +++ a/members/members-update-do.pl @@ -19,7 +19,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use C4::Context; use Koha::Patrons; --- a/members/members-update.pl +++ a/members/members-update.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use C4::Members; use Koha::Patron::Attribute::Types; --- a/members/merge-patrons.pl +++ a/members/merge-patrons.pl @@ -19,10 +19,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Patrons; --- a/members/mod_debarment.pl +++ a/members/mod_debarment.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use Koha::DateUtils; -use Koha::Patron::Debarments; +use C4::Auth qw( checkauth ); +use Koha::DateUtils qw( dt_from_string ); +use Koha::Patron::Debarments qw( AddDebarment DelDebarment ); my $cgi = CGI->new; --- a/members/moremember.pl +++ a/members/moremember.pl @@ -30,15 +30,14 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Form::MessagingPreferences; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use Scalar::Util qw( looks_like_number ); use Koha::Patron::Attribute::Types; -use Koha::Patron::Debarments qw(GetDebarments); +use Koha::Patron::Debarments qw( GetDebarments ); use Koha::Patron::Messages; -use Koha::DateUtils; use Koha::CsvProfiles; use Koha::Holds; use Koha::Patrons; --- a/members/notices.pl +++ a/members/notices.pl @@ -20,8 +20,8 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Letters; --- a/members/pay.pl +++ a/members/pay.pl @@ -28,10 +28,10 @@ use Modern::Perl; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 uri_unescape ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Members; use C4::Accounts; @@ -42,7 +42,7 @@ use Koha::Patrons; use Koha::Items; use Koha::Patron::Categories; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 uri_unescape ); our $input = CGI->new; --- a/members/paycollect.pl +++ a/members/paycollect.pl @@ -18,13 +18,12 @@ # along with Koha; if not, see . use Modern::Perl; -use URI::Escape; +use URI::Escape qw( uri_escape uri_unescape ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Members; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Accounts; use C4::Koha; @@ -34,7 +33,7 @@ use Koha::Patron::Categories; use Koha::AuthorisedValues; use Koha::Account; use Koha::Token; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); my $input = CGI->new(); --- a/members/print_overdues.pl +++ a/members/print_overdues.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI; use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Overdues qw(parse_overdues_letter); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Overdues qw( parse_overdues_letter ); use Koha::Patrons; --- a/members/printfeercpt.pl +++ a/members/printfeercpt.pl @@ -20,8 +20,8 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Letters; use Koha::Account::Lines; --- a/members/printinvoice.pl +++ a/members/printinvoice.pl @@ -20,8 +20,8 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Letters; use Koha::Account::Lines; --- a/members/printslip.pl +++ a/members/printslip.pl @@ -35,11 +35,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; -use C4::Members; -use C4::Koha; -use Koha::DateUtils; +use C4::Auth qw( get_session get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Members qw( IssueSlip ); my $input = CGI->new; my $sessionID = $input->cookie("CGISESSID"); --- a/members/purchase-suggestions.pl +++ a/members/purchase-suggestions.pl @@ -20,11 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Members; -use C4::Suggestions; +use C4::Suggestions qw( SearchSuggestion ); use Koha::Patrons; my $input = CGI->new; --- a/members/readingrec.pl +++ a/members/readingrec.pl @@ -24,11 +24,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Members; -use List::MoreUtils qw/any uniq/; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Members qw( GetAllIssues ); +use List::MoreUtils qw( uniq ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use Koha::Patron::Categories; --- a/members/routing-lists.pl +++ a/members/routing-lists.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth qw/:DEFAULT/; +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Members; use C4::Context; use C4::Serials; --- a/members/setstatus.pl +++ a/members/setstatus.pl @@ -26,9 +26,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); +use C4::Auth qw( checkauth ); use C4::Context; use C4::Members; -use C4::Auth; use Koha::Patrons; --- a/members/statistics.pl +++ a/members/statistics.pl @@ -25,11 +25,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Members; -use C4::Members::Statistics; -use C4::Output; +use C4::Members::Statistics qw( + GetPrecedentStateByBorrower + GetTotalIssuesReturnedTodayByBorrower + GetTotalIssuesTodayByBorrower +); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use Koha::Patrons; use Koha::Patron::Categories; --- a/members/summary-print.pl +++ a/members/summary-print.pl @@ -19,13 +19,12 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Members; use C4::Circulation qw( GetIssuingCharges ); use C4::Reserves; -use C4::Items; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Holds; use Koha::ItemTypes; use Koha::Patrons; --- a/members/update-child.pl +++ a/members/update-child.pl @@ -29,8 +29,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers output_and_exit_if_error output_and_exit ); use Koha::Patrons; use Koha::Patron::Categories; use Koha::Patrons; --- a/misc/add_date_fields_to_marc_records.pl +++ a/misc/add_date_fields_to_marc_records.pl @@ -18,14 +18,14 @@ use Modern::Perl; BEGIN { - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use MARC::Field; use C4::Biblio; --- a/misc/admin/set_password.pl +++ a/misc/admin/set_password.pl @@ -20,8 +20,8 @@ use Modern::Perl; use Bytes::Random::Secure; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use String::Random; use Koha::Patrons; --- a/misc/background_jobs_worker.pl +++ a/misc/background_jobs_worker.pl @@ -16,8 +16,8 @@ # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); -use Try::Tiny; +use JSON qw( decode_json ); +use Try::Tiny qw( catch try ); use Koha::BackgroundJobs; --- a/misc/batchCompareMARCvsFrameworks.pl +++ a/misc/batchCompareMARCvsFrameworks.pl @@ -7,7 +7,7 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } @@ -15,10 +15,9 @@ BEGIN { use Koha::Script; use C4::Context; use MARC::File::USMARC; -use MARC::Record; use MARC::Batch; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use IO::File; my ( $input_marc_file,$number,$nowarning,$frameworkcode) = ('',0); --- a/misc/batchDeleteUnusedSubfields.pl +++ a/misc/batchDeleteUnusedSubfields.pl @@ -6,18 +6,17 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } # Koha modules used use Koha::Script; -use MARC::Record; use C4::Context; -use C4::Biblio; -use Time::HiRes qw(gettimeofday); +use C4::Biblio qw( GetMarcStructure ); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ( $input_marc_file, $number) = ('',0); my ($version, $confirm,$test_parameter); GetOptions( --- a/misc/batchImportMARCWithBiblionumbers.pl +++ a/misc/batchImportMARCWithBiblionumbers.pl @@ -6,7 +6,7 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } @@ -14,13 +14,12 @@ BEGIN { use Koha::Script; use C4::Context; -use C4::Biblio; -use MARC::Record; +use C4::Biblio qw( GetMarcFromKohaField ); use MARC::File::USMARC; use MARC::File::XML; use MARC::Batch; -use Time::HiRes qw(gettimeofday); -use Getopt::Long; +use Time::HiRes qw( gettimeofday ); +use Getopt::Long qw( GetOptions ); use IO::File; my $input_marc_file = ''; --- a/misc/batchRebuildBiblioTables.pl +++ a/misc/batchRebuildBiblioTables.pl @@ -8,7 +8,7 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } @@ -17,10 +17,13 @@ use Koha::Script; use MARC::Record; use C4::Charset; use C4::Context; -use C4::Biblio; -use Time::HiRes qw(gettimeofday); +use C4::Biblio qw( + GetXmlBiblio + TransformMarcToKoha +); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ($version, $confirm); GetOptions( --- a/misc/batchRebuildItemsTables.pl +++ a/misc/batchRebuildItemsTables.pl @@ -2,16 +2,16 @@ use Modern::Perl; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use MARC::Field; use MARC::Record; -use Pod::Usage; -use Time::HiRes qw(gettimeofday); +use Pod::Usage qw( pod2usage ); +use Time::HiRes qw( gettimeofday ); use Koha::Script; use C4::Context; -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ); +use C4::Items qw( ModItemFromMarc ); =head1 NAME --- a/misc/batchRepairMissingBiblionumbers.pl +++ a/misc/batchRepairMissingBiblionumbers.pl @@ -7,14 +7,14 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } # Koha modules used use Koha::Script; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ModBiblioMarc ); my $dbh = C4::Context->dbh; --- a/misc/batchdeletebiblios.pl +++ a/misc/batchdeletebiblios.pl @@ -1,12 +1,11 @@ #!/usr/bin/perl use Modern::Perl; -use Getopt::Long; -use Pod::Usage; -use IO::File; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; -use C4::Biblio; +use C4::Biblio qw( DelBiblio ); my $help; GetOptions( --- a/misc/bin/connexion_import_daemon.pl +++ a/misc/bin/connexion_import_daemon.pl @@ -20,7 +20,7 @@ use strict; use warnings; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ($help, $config, $daemon); @@ -86,17 +86,17 @@ exit; { package ImportProxyServer; -use Carp; -use IO::Socket::INET; +use Carp qw( croak ); +use IO::Socket::INET qw( SOCK_STREAM ); # use IO::Socket::IP; use IO::Select; -use POSIX; -use HTTP::Status qw(:constants); +use POSIX qw( close exit fork localtime open printf sprintf ); +use HTTP::Status qw( HTTP_FORBIDDEN HTTP_UNAUTHORIZED ); use strict; use warnings; use LWP::UserAgent; -use XML::Simple; +use XML::Simple qw( XMLin ); use MARC::Record; use MARC::File::XML; --- a/misc/check_sysprefs.pl +++ a/misc/check_sysprefs.pl @@ -8,7 +8,7 @@ use strict; use warnings; -use File::Find; +use File::Find qw( find ); use Koha::Script; use C4::Context; --- a/misc/commit_file.pl +++ a/misc/commit_file.pl @@ -5,14 +5,14 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::ImportBatch; -use Getopt::Long; +use C4::ImportBatch qw( GetImportBatch BatchCommitRecords BatchRevertRecords ); +use Getopt::Long qw( GetOptions ); $| = 1; --- a/misc/cronjobs/advance_notices.pl +++ a/misc/cronjobs/advance_notices.pl @@ -38,24 +38,20 @@ the OPAC. use strict; use warnings; -use Getopt::Long; -use Pod::Usage; -use Data::Dumper; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; -use C4::Biblio; use C4::Context; use C4::Letters; use C4::Members; use C4::Members::Messaging; -use C4::Overdues; -use Koha::DateUtils; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Items; use Koha::Libraries; use Koha::Patrons; --- a/misc/cronjobs/archive_purchase_suggestions.pl +++ a/misc/cronjobs/archive_purchase_suggestions.pl @@ -2,14 +2,14 @@ use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Suggestions; -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); my ( $help, $verbose, $confirm, $age, $age_date_field, @statuses ); GetOptions( --- a/misc/cronjobs/automatic_checkin.pl +++ a/misc/cronjobs/automatic_checkin.pl @@ -20,7 +20,7 @@ use Modern::Perl; use Koha::Checkouts; use Koha::Script -cron; -use C4::Log; +use C4::Log qw( cronlogaction ); cronlogaction(); --- a/misc/cronjobs/automatic_item_modification_by_age.pl +++ a/misc/cronjobs/automatic_item_modification_by_age.pl @@ -2,14 +2,14 @@ use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use JSON; use Koha::Script -cron; use C4::Context; use C4::Items; -use C4::Log; +use C4::Log qw( cronlogaction ); # Getting options my ( $verbose, $help, $confirm ); --- a/misc/cronjobs/automatic_renewals.pl +++ a/misc/cronjobs/automatic_renewals.pl @@ -75,13 +75,13 @@ chosen 'Digests only' on the advance messages. =cut use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::Circulation; +use C4::Circulation qw( CanBookBeRenewed AddRenewal ); use C4::Context; -use C4::Log; +use C4::Log qw( cronlogaction ); use C4::Letters; use Koha::Checkouts; use Koha::Libraries; --- a/misc/cronjobs/batch_anonymise.pl +++ a/misc/cronjobs/batch_anonymise.pl @@ -19,25 +19,21 @@ use strict; use warnings; -use Carp; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::Context; use Koha::Patrons; -use Date::Calc qw( - Today - Add_Delta_Days -); -use Getopt::Long; -use C4::Log; +use Date::Calc qw( Add_Delta_Days Today ); +use Getopt::Long qw( GetOptions ); +use C4::Log qw( cronlogaction ); sub usage { print STDERR <. use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ); use AnyEvent; -use AnyEvent::HTTP; -use Encode; +use AnyEvent::HTTP qw( http_request ); +use Encode qw( encode_utf8 ); my ( $verbose, $help, $html ) = ( 0, 0, 0 ); my ( $host, $host_intranet ) = ( '', '' ); --- a/misc/cronjobs/cleanup_database.pl +++ a/misc/cronjobs/cleanup_database.pl @@ -31,7 +31,7 @@ use constant DEFAULT_DEBARMENTS_PURGEDAYS => 30; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } @@ -39,9 +39,9 @@ use Koha::Script -cron; use C4::Context; use C4::Search; use C4::Search::History; -use Getopt::Long; -use C4::Log; -use C4::Accounts; +use Getopt::Long qw( GetOptions ); +use C4::Log qw( cronlogaction ); +use C4::Accounts qw( purge_zero_balance_fees ); use Koha::UploadedFiles; use Koha::Old::Biblios; use Koha::Old::Items; --- a/misc/cronjobs/cloud-kw.pl +++ a/misc/cronjobs/cloud-kw.pl @@ -21,14 +21,14 @@ use strict; use warnings; use diagnostics; -use Carp; +use Carp qw( carp croak ); use YAML::XS; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Context; -use C4::Log; +use C4::Log qw( cronlogaction ); my $verbose = 0; my $help = 0; @@ -97,7 +97,7 @@ package ZebraIndex; use strict; use warnings; use diagnostics; -use Carp; +use Carp qw( carp croak ); sub new { my $self = {}; --- a/misc/cronjobs/create_koc_db.pl +++ a/misc/cronjobs/create_koc_db.pl @@ -92,8 +92,8 @@ use warnings; $|++; use DBI; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; use C4::Context; --- a/misc/cronjobs/delete_items.pl +++ a/misc/cronjobs/delete_items.pl @@ -1,13 +1,11 @@ #! /usr/bin/perl -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Context; -use C4::Items; -use C4::Circulation; use Modern::Perl; -use Pod::Usage; +use Pod::Usage qw( pod2usage ); my $dbh = C4::Context->dbh(); --- a/misc/cronjobs/delete_patrons.pl +++ a/misc/cronjobs/delete_patrons.pl @@ -2,14 +2,14 @@ use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::Members; -use Koha::DateUtils; +use C4::Members qw( GetBorrowersToExpunge ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; -use C4::Log; +use C4::Log qw( cronlogaction ); my ( $help, $verbose, $not_borrowed_since, $expired_before, $last_seen, @category_code, $branchcode, $file, $confirm ); --- a/misc/cronjobs/delete_records_via_leader.pl +++ a/misc/cronjobs/delete_records_via_leader.pl @@ -27,15 +27,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( DelBiblio ); use Koha::Database; use Koha::Biblios; use Koha::Biblio::Metadatas; --- a/misc/cronjobs/edi_cron.pl +++ a/misc/cronjobs/edi_cron.pl @@ -33,10 +33,10 @@ use Koha::Script -cron; use C4::Context; use Log::Log4perl qw(:easy); use Koha::Database; -use Koha::EDI qw( process_quote process_invoice process_ordrsp); +use Koha::EDI qw( process_quote process_invoice process_ordrsp ); use Koha::Edifact::Transport; use Koha::Plugins::Handler; -use Fcntl qw( :DEFAULT :flock :seek ); +use Fcntl qw( LOCK_EX O_CREAT O_RDWR SEEK_SET ); my $logdir = C4::Context->config('logdir'); --- a/misc/cronjobs/fines.pl +++ a/misc/cronjobs/fines.pl @@ -32,16 +32,16 @@ use 5.010; use Koha::Script -cron; use C4::Context; -use C4::Overdues; -use Getopt::Long; -use Carp; +use C4::Overdues qw( Getoverdues CalcFine UpdateFine ); +use Getopt::Long qw( GetOptions ); +use Carp qw( carp croak ); use File::Spec; -use Try::Tiny; +use Try::Tiny qw( catch try ); use Koha::Calendar; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; -use C4::Log; +use C4::Log qw( cronlogaction ); my $help; my $verbose; --- a/misc/cronjobs/gather_print_notices.pl +++ a/misc/cronjobs/gather_print_notices.pl @@ -5,22 +5,22 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use CGI qw( utf8 ); # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy +use CGI; # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy use Koha::Script -cron; use C4::Context; -use C4::Letters; +use C4::Letters qw( GetPrintMessages ); use C4::Templates; use File::Spec; -use Pod::Usage; -use Getopt::Long; -use C4::Log; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); +use C4::Log qw( cronlogaction ); -use Koha::DateUtils; -use Koha::Util::OpenDocument; +use Koha::DateUtils qw( dt_from_string output_pref ); +use Koha::Util::OpenDocument qw( generate_ods ); use MIME::Lite; my ( --- a/misc/cronjobs/holds/auto_unsuspend_holds.pl +++ a/misc/cronjobs/holds/auto_unsuspend_holds.pl @@ -23,7 +23,7 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } @@ -31,7 +31,7 @@ BEGIN { use Koha::Script -cron; use C4::Reserves; -use C4::Log; +use C4::Log qw( cronlogaction ); cronlogaction(); --- a/misc/cronjobs/holds/build_holds_queue.pl +++ a/misc/cronjobs/holds/build_holds_queue.pl @@ -11,13 +11,13 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::HoldsQueue qw(CreateQueue); -use C4::Log; +use C4::Log qw( cronlogaction ); cronlogaction(); --- a/misc/cronjobs/holds/cancel_expired_holds.pl +++ a/misc/cronjobs/holds/cancel_expired_holds.pl @@ -39,19 +39,19 @@ This script calls C4::Reserves::CancelExpiredReserves which will find and cancel =cut use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::Reserves; -use C4::Log; +use C4::Log qw( cronlogaction ); =head1 OPTIONS --- a/misc/cronjobs/holds/cancel_unfilled_holds.pl +++ a/misc/cronjobs/holds/cancel_unfilled_holds.pl @@ -21,19 +21,18 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; use C4::Reserves; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Holds; use Koha::Calendar; -use Koha::DateUtils; use Koha::Libraries; cronlogaction(); --- a/misc/cronjobs/holds/holds_reminder.pl +++ a/misc/cronjobs/holds/holds_reminder.pl @@ -21,20 +21,19 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; -use Text::CSV_XS; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use DateTime; use DateTime::Duration; use C4::Context; use C4::Letters; -use C4::Log; -use Koha::DateUtils; +use C4::Log qw( cronlogaction ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Calendar; use Koha::Libraries; use Koha::Notice::Templates; --- a/misc/cronjobs/import_webservice_batch.pl +++ a/misc/cronjobs/import_webservice_batch.pl @@ -25,14 +25,13 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::ImportBatch; +use C4::ImportBatch qw( BatchCommitRecords ); my ($help, $framework); --- a/misc/cronjobs/longoverdue.pl +++ a/misc/cronjobs/longoverdue.pl @@ -30,17 +30,16 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); -use C4::Circulation qw/LostItem MarkIssueReturned/; +use C4::Circulation qw( LostItem MarkIssueReturned ); use C4::Context; -use C4::Items; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::ItemTypes; use Koha::Patron::Categories; use Koha::Patrons; --- a/misc/cronjobs/membership_expiry.pl +++ a/misc/cronjobs/membership_expiry.pl @@ -116,20 +116,19 @@ any field from the branches table =cut use Modern::Perl; -use Getopt::Long; -use Pod::Usage; -use Data::Dumper; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::Context; use C4::Letters; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Patrons; --- a/misc/cronjobs/merge_authorities.pl +++ a/misc/cronjobs/merge_authorities.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl use Modern::Perl; -use Getopt::Long; -use Pod::Usage; -use Time::HiRes qw(gettimeofday); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); +use Time::HiRes qw( gettimeofday ); use Koha::Script -cron; use C4::AuthoritiesMarc; --- a/misc/cronjobs/notice_unprocessed_suggestions.pl +++ a/misc/cronjobs/notice_unprocessed_suggestions.pl @@ -2,12 +2,12 @@ use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::Budgets qw( GetBudget ); -use C4::Suggestions qw( GetUnprocessedSuggestions ); +use C4::Budgets; +use C4::Suggestions; use Koha::Libraries; use Koha::Patrons; --- a/misc/cronjobs/overdue_notices.pl +++ a/misc/cronjobs/overdue_notices.pl @@ -24,12 +24,12 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Text::CSV_XS; use DateTime; use DateTime::Duration; @@ -37,10 +37,10 @@ use DateTime::Duration; use Koha::Script -cron; use C4::Context; use C4::Letters; -use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter); -use C4::Log; -use Koha::Patron::Debarments qw(AddUniqueDebarment); -use Koha::DateUtils; +use C4::Overdues qw( GetOverdueMessageTransportTypes parse_overdues_letter ); +use C4::Log qw( cronlogaction ); +use Koha::Patron::Debarments qw( AddUniqueDebarment ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Calendar; use Koha::Libraries; use Koha::Acquisition::Currencies; --- a/misc/cronjobs/patron_emailer.pl +++ a/misc/cronjobs/patron_emailer.pl @@ -21,16 +21,16 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); -use C4::Log; -use C4::Reports::Guided; +use C4::Log qw( cronlogaction ); +use C4::Reports::Guided qw( EmailReport ); cronlogaction(); --- a/misc/cronjobs/plugins_nightly.pl +++ a/misc/cronjobs/plugins_nightly.pl @@ -2,10 +2,10 @@ use Modern::Perl; -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Context; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Logger; use Koha::Plugins; use Koha::Script -cron; --- a/misc/cronjobs/process_message_queue.pl +++ a/misc/cronjobs/process_message_queue.pl @@ -22,15 +22,15 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; -use C4::Letters; -use C4::Log; -use Getopt::Long; -use Try::Tiny; +use C4::Letters qw( SendQueuedMessages ); +use C4::Log qw( cronlogaction ); +use Getopt::Long qw( GetOptions ); +use Try::Tiny qw( catch try ); my $username = undef; my $password = undef; --- a/misc/cronjobs/purge_suggestions.pl +++ a/misc/cronjobs/purge_suggestions.pl @@ -22,16 +22,15 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Suggestions; -use C4::Log; +use C4::Log qw( cronlogaction ); use C4::Context; my ( $help, $days, $confirm ); --- a/misc/cronjobs/reconcile_balances.pl +++ a/misc/cronjobs/reconcile_balances.pl @@ -51,19 +51,19 @@ Makes the process print information about the taken actions. use Modern::Perl; -use Getopt::Long; -use Pod::Usage; -use Try::Tiny; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); +use Try::Tiny qw( catch try ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Account::Lines; use Koha::Patrons; --- a/misc/cronjobs/rss/rss.pl +++ a/misc/cronjobs/rss/rss.pl @@ -31,8 +31,7 @@ use Template; use Koha::Script -cron; use C4::Context; -use Time::Local; -use POSIX; +use POSIX qw( close localtime open strftime ); my $dbh = C4::Context->dbh; my $file = $ARGV[0]; --- a/misc/cronjobs/runreport.pl +++ a/misc/cronjobs/runreport.pl @@ -21,27 +21,27 @@ use Modern::Perl; use Koha::Script -cron; -use C4::Reports::Guided; # 0.12 +use C4::Reports::Guided qw( store_results execute_query ); use Koha::Reports; use C4::Context; -use C4::Log; +use C4::Log qw( cronlogaction ); use Koha::Email; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::SMTP::Servers; -use Getopt::Long qw(:config auto_help auto_version); -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Text::CSV::Encoded; use CGI qw ( -utf8 ); -use Carp; -use Encode; +use Carp qw( carp ); +use Encode qw( decode ); use JSON qw( to_json ); -use Try::Tiny; +use Try::Tiny qw( catch try ); BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } --- a/misc/cronjobs/serialsUpdate.pl +++ a/misc/cronjobs/serialsUpdate.pl @@ -24,20 +24,20 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script -cron; use C4::Context; -use C4::Serials; -use C4::Log; -use Koha::DateUtils; +use C4::Serials qw( GetSubscription GetNextDate ModSerialStatus ); use C4::Serials::Frequency; +use C4::Log qw( cronlogaction ); +use Koha::DateUtils qw( dt_from_string output_pref ); -use Date::Calc qw/Date_to_Days check_date/; -use Getopt::Long; -use Pod::Usage; +use Date::Calc qw( check_date Date_to_Days ); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); =head1 NAME --- a/misc/cronjobs/share_usage_with_koha_community.pl +++ a/misc/cronjobs/share_usage_with_koha_community.pl @@ -2,14 +2,14 @@ use Modern::Perl; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::Context; use C4::UsageStats; -use C4::Log; -use POSIX qw(strftime); +use C4::Log qw( cronlogaction ); +use POSIX qw( strftime ); my ( $help, $verbose, $force, $quiet ); GetOptions( --- a/misc/cronjobs/sitemap.pl +++ a/misc/cronjobs/sitemap.pl @@ -21,11 +21,10 @@ package Main; use Modern::Perl; use utf8; -use Pod::Usage; -use Getopt::Long; +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use Koha::Script -cron; -use C4::Biblio; use Koha::Sitemapper; --- a/misc/cronjobs/staticfines.pl +++ a/misc/cronjobs/staticfines.pl @@ -31,22 +31,20 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } -use Date::Calc qw/Date_to_Days/; +use Date::Calc qw( Date_to_Days ); use Koha::Script -cron; use C4::Context; -use C4::Circulation; -use C4::Overdues; +use C4::Overdues qw( CalcFine checkoverdues GetFine Getoverdues ); use C4::Calendar qw(); # don't need any exports from Calendar -use C4::Biblio; -use C4::Log; -use Getopt::Long; -use List::MoreUtils qw/none/; -use Koha::DateUtils; +use C4::Log qw( cronlogaction ); +use Getopt::Long qw( GetOptions ); +use List::MoreUtils qw( none ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; my $help = 0; --- a/misc/cronjobs/stockrotation.pl +++ a/misc/cronjobs/stockrotation.pl @@ -108,7 +108,7 @@ database updates have been performed."). =cut use Modern::Perl; -use Getopt::Long qw/HelpMessage :config gnu_getopt/; +use Getopt::Long qw( GetOptions HelpMessage ); use Koha::Script -cron; use C4::Context; --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl +++ a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl @@ -24,12 +24,12 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; use C4::Context; --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -24,20 +24,19 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; use C4::Context; -use C4::Items; use C4::Letters; use C4::Overdues; use Koha::Calendar; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patrons; use Koha::Libraries; --- a/misc/cronjobs/update_patrons_category.pl +++ a/misc/cronjobs/update_patrons_category.pl @@ -20,17 +20,17 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use C4::Context; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Logger; use Koha::Patrons; use Koha::Patron::Categories; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Script -cron; =head1 NAME --- a/misc/cronjobs/update_totalissues.pl +++ a/misc/cronjobs/update_totalissues.pl @@ -24,22 +24,22 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script -cron; -use Koha::DateUtils qw/ dt_from_string /; +use Koha::DateUtils qw( dt_from_string ); use C4::Context; -use C4::Biblio; -use C4::Log; +use C4::Biblio qw( UpdateTotalIssues ); +use C4::Log qw( cronlogaction ); use DateTime; use DateTime::Format::MySQL; -use Time::HiRes qw/time/; -use POSIX qw/strftime ceil/; +use Time::HiRes qw( time ); +use POSIX qw( ceil strftime ); sub usage { pod2usage( -verbose => 2 ); --- a/misc/cronjobs/writeoff_debts.pl +++ a/misc/cronjobs/writeoff_debts.pl @@ -3,11 +3,11 @@ use Modern::Perl; use feature 'say'; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Account::Lines; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Script -cron; --- a/misc/devel/add_missing_filters.pl +++ a/misc/devel/add_missing_filters.pl @@ -2,9 +2,9 @@ use Modern::Perl; -use File::Slurp; -use Pod::Usage; -use Getopt::Long; +use File::Slurp qw( read_file write_file ); +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); use t::lib::QA::TemplateFilters; --- a/misc/devel/coverage.pl +++ a/misc/devel/coverage.pl @@ -48,9 +48,9 @@ prints this help text use Modern::Perl; use C4::Context; -use Cwd; -use Getopt::Long; -use Pod::Usage; +use Cwd qw( getcwd ); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); my $help; --- a/misc/devel/create_superlibrarian.pl +++ a/misc/devel/create_superlibrarian.pl @@ -18,8 +18,8 @@ # along with Koha; if not, see . use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use Koha::Patrons; --- a/misc/devel/get_prepared_letter.pl +++ a/misc/devel/get_prepared_letter.pl @@ -69,11 +69,11 @@ documentation of GetPreparedLetter for more informations. use Modern::Perl; -use Getopt::Long; -use JSON; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use JSON qw( decode_json ); +use Pod::Usage qw( pod2usage ); -use C4::Letters; +use C4::Letters qw( GetPreparedLetter ); my $help; my ( $module, $letter_code, $branchcode, $message_transport_type, $lang, --- a/misc/devel/install_plugins.pl +++ a/misc/devel/install_plugins.pl @@ -18,8 +18,8 @@ # along with Koha; if not, see . use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; --- a/misc/devel/update_dbix_class_files.pl +++ a/misc/devel/update_dbix_class_files.pl @@ -21,8 +21,8 @@ use Modern::Perl; use DBIx::Class::Schema::Loader qw/ make_schema_at /; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); my %db_defaults = ( driver => 'mysql', --- a/misc/export_borrowers.pl +++ a/misc/export_borrowers.pl @@ -21,7 +21,7 @@ use Modern::Perl; use Text::CSV; -use Getopt::Long qw(:config no_ignore_case); +use Getopt::Long qw( GetOptions ); use Koha::Script; use C4::Context; --- a/misc/export_records.pl +++ a/misc/export_records.pl @@ -18,9 +18,9 @@ use Modern::Perl; use MARC::File::XML; -use List::MoreUtils qw(uniq); -use Getopt::Long; -use Pod::Usage; +use List::MoreUtils qw( uniq ); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use C4::Auth; --- a/misc/exportauth.pl +++ a/misc/exportauth.pl @@ -8,13 +8,12 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::Biblio; use C4::Auth; my $outfile = $ARGV[0]; open(my $fh, '>', $outfile) or die $!; --- a/misc/import_patrons.pl +++ a/misc/import_patrons.pl @@ -19,8 +19,8 @@ use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use Koha::Patrons::Import; --- a/misc/link_bibs_to_authorities.pl +++ a/misc/link_bibs_to_authorities.pl @@ -7,19 +7,23 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::Biblio; -use Getopt::Long; -use Pod::Usage; -use Data::Dumper; -use Time::HiRes qw/time/; -use POSIX qw/strftime ceil/; -use Module::Load::Conditional qw(can_load); +use C4::Biblio qw( + GetFrameworkCode + GetMarcBiblio + LinkBibHeadingsToAuthorities + ModBiblio +); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); +use Time::HiRes qw( time ); +use POSIX qw( ceil strftime ); +use Module::Load::Conditional qw( can_load ); sub usage { pod2usage( -verbose => 2 ); --- a/misc/load_testing/benchmark_circulation.pl +++ a/misc/load_testing/benchmark_circulation.pl @@ -7,13 +7,12 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use HTTPD::Bench::ApacheBench; use LWP::UserAgent; -use Data::Dumper; use HTTP::Cookies; use C4::Context; --- a/misc/load_testing/benchmark_staff.pl +++ a/misc/load_testing/benchmark_staff.pl @@ -7,17 +7,16 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use HTTPD::Bench::ApacheBench; use LWP::UserAgent; -use Data::Dumper; use HTTP::Cookies; use C4::Context; -use URI::Escape; +use URI::Escape qw( uri_escape_utf8 ); use Koha::Patrons; my ($help, $steps, $baseurl, $max_tries, $user, $password,$short_print); --- a/misc/load_testing/benchmark_webservices.pl +++ a/misc/load_testing/benchmark_webservices.pl @@ -16,8 +16,7 @@ use warnings; # # Requires LWP::UserAgent, File::Slurp. use LWP::UserAgent; -use File::Slurp qw(slurp); -use Carp; +use File::Slurp qw( slurp ); my $ua = LWP::UserAgent->new(); $ua->cookie_jar({ file =>"cookies.txt" }); my $baseurl = shift; --- a/misc/load_yaml.pl +++ a/misc/load_yaml.pl @@ -20,7 +20,7 @@ use Modern::Perl; use Koha::Script; -use Getopt::Long qw(:config no_ignore_case); +use Getopt::Long qw( GetOptions ); use C4::Context; use C4::Installer; --- a/misc/maintenance/UNIMARC_fix_collectiontitle.pl +++ a/misc/maintenance/UNIMARC_fix_collectiontitle.pl @@ -8,12 +8,11 @@ use strict; use warnings; BEGIN { - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; -use C4::Biblio; sub process { --- a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl +++ a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl @@ -8,13 +8,13 @@ use strict; use warnings; BEGIN { - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; -use C4::Biblio; -use Getopt::Long; +use C4::Biblio qw( GetMarcBiblio ModBiblio ); +use Getopt::Long qw( GetOptions ); sub _read_marc_code { my $input = shift; --- a/misc/maintenance/auth_show_hidden_data.pl +++ a/misc/maintenance/auth_show_hidden_data.pl @@ -22,8 +22,8 @@ # which hidden fields in the framework still contain data. use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use Koha::Authorities; --- a/misc/maintenance/borrowers-force-messaging-defaults.pl +++ a/misc/maintenance/borrowers-force-messaging-defaults.pl @@ -22,15 +22,15 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; use C4::Context; use C4::Members::Messaging; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); sub usage { --- a/misc/maintenance/check_syspref_cache.pl +++ a/misc/maintenance/check_syspref_cache.pl @@ -16,8 +16,8 @@ # along with Koha; if not, see . use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Encode qw( encode_utf8 ); use Koha::Script; --- a/misc/maintenance/cmp_sysprefs.pl +++ a/misc/maintenance/cmp_sysprefs.pl @@ -27,8 +27,8 @@ use Modern::Perl; use open OUT => ':encoding(UTF-8)', ':std'; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use C4::Context; --- a/misc/maintenance/fix_accountlines_date.pl +++ a/misc/maintenance/fix_accountlines_date.pl @@ -22,15 +22,14 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; use C4::Context; -use Getopt::Long; -use Pod::Usage; -use Koha::DateUtils; +use Getopt::Long qw( GetOptions ); +use Koha::DateUtils qw( dt_from_string output_pref ); =head1 NAME --- a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl +++ a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl @@ -23,15 +23,14 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::Installer; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Data::Dumper; sub print_usage { --- a/misc/maintenance/fix_mysql_constraints.pl +++ a/misc/maintenance/fix_mysql_constraints.pl @@ -21,14 +21,14 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); my $lib = "$FindBin::Bin/../kohalib.pl"; eval { require $lib }; } -use Getopt::Long; -use Pod::Usage; -use Try::Tiny; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); +use Try::Tiny qw( catch try ); use Koha::Script; use C4::Context; --- a/misc/maintenance/fix_tags_weight.pl +++ a/misc/maintenance/fix_tags_weight.pl @@ -28,8 +28,8 @@ use Koha::Tags; use Koha::Tags::Approvals; use Koha::Tags::Indexes; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); =head1 NAME --- a/misc/maintenance/generate_MARC21Languages.pl +++ a/misc/maintenance/generate_MARC21Languages.pl @@ -19,10 +19,10 @@ # use Modern::Perl; -use XML::Simple; -use Pod::Usage; -use Getopt::Long; -use Carp; +use XML::Simple qw( XMLin ); +use Pod::Usage qw( pod2usage ); +use Getopt::Long qw( GetOptions ); +use Carp qw( croak ); use open ':std', ':encoding(UTF-8)'; --- a/misc/maintenance/process_record_through_filter.pl +++ a/misc/maintenance/process_record_through_filter.pl @@ -9,8 +9,7 @@ use warnings; use Koha::Script; use Koha::RecordProcessor; -use Data::Dumper; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ); my $record = GetMarcBiblio({ biblionumber => $ARGV[0] }); --- a/misc/maintenance/remove_items_from_biblioitems.pl +++ a/misc/maintenance/remove_items_from_biblioitems.pl @@ -24,8 +24,8 @@ $|=1; use Koha::Script; use C4::Context; -use C4::Biblio; -use Getopt::Long; +use C4::Biblio qw( GetFrameworkCode GetMarcBiblio ModBiblio ); +use Getopt::Long qw( GetOptions ); my ($wherestring, $run, $silent, $want_help); my $result = GetOptions( --- a/misc/maintenance/sanitize_records.pl +++ a/misc/maintenance/sanitize_records.pl @@ -20,12 +20,11 @@ use Modern::Perl; use Koha::Script; -use C4::Charset qw( SanitizeRecord ); +use C4::Charset; use C4::Context; -use DBI; use C4::Biblio; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); my ( $help, $verbose, $confirm, $biblionumbers, $reindex, $filename, $auto_search, $fix_ampersand ); --- a/misc/maintenance/search_for_data_inconsistencies.pl +++ a/misc/maintenance/search_for_data_inconsistencies.pl @@ -25,7 +25,7 @@ use Koha::BiblioFrameworks; use Koha::Biblioitems; use Koha::Items; use Koha::ItemTypes; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField ); { my $items = Koha::Items->search({ -or => { homebranch => undef, holdingbranch => undef }}); --- a/misc/maintenance/touch_all_biblios.pl +++ a/misc/maintenance/touch_all_biblios.pl @@ -22,17 +22,17 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } # possible modules to use -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Script; use C4::Context; -use C4::Biblio; -use Pod::Usage; +use C4::Biblio qw( GetMarcBiblio ModBiblio ); +use Pod::Usage qw( pod2usage ); sub usage { --- a/misc/maintenance/touch_all_items.pl +++ a/misc/maintenance/touch_all_items.pl @@ -22,18 +22,17 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } # possible modules to use -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Script; use C4::Context; -use C4::Items; use Koha::Items; -use Pod::Usage; +use Pod::Usage qw( pod2usage ); sub usage { --- a/misc/maintenance/update_authorities.pl +++ a/misc/maintenance/update_authorities.pl @@ -19,9 +19,9 @@ use Modern::Perl; -use Getopt::Long; -use List::MoreUtils qw/uniq/; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use List::MoreUtils qw( uniq ); +use Pod::Usage qw( pod2usage ); use Koha::Script; use C4::AuthoritiesMarc qw/AddAuthority DelAuthority GetAuthority merge/; --- a/misc/migration_tools/22_to_30/convert_to_utf8.pl +++ a/misc/migration_tools/22_to_30/convert_to_utf8.pl @@ -9,7 +9,7 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } --- a/misc/migration_tools/22_to_30/export_Authorities.pl +++ a/misc/migration_tools/22_to_30/export_Authorities.pl @@ -3,15 +3,14 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } use C4::Context; #use MARC::File::XML(BinaryEncoding=>"utf8"); #use MARC::File::USMARC; -use MARC::Record; use C4::AuthoritiesMarc; -use POSIX; +use POSIX qw( close localtime sprintf time ); #MARC::File::XML::default_record_format("UNIMARCAUTH"); my $dbh = C4::Context->dbh; my $rq= $dbh->prepare(qq| --- a/misc/migration_tools/22_to_30/export_Authorities_xml.pl +++ a/misc/migration_tools/22_to_30/export_Authorities_xml.pl @@ -3,14 +3,13 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } use C4::Context; use MARC::File::XML(BinaryEncoding=>"utf8"); -use MARC::Record; use C4::AuthoritiesMarc; -use POSIX; +use POSIX qw( close localtime open sprintf time ); MARC::File::XML::default_record_format("UNIMARCAUTH"); my $dbh = C4::Context->dbh; my $rq= $dbh->prepare(qq| --- a/misc/migration_tools/22_to_30/missing090field.pl +++ a/misc/migration_tools/22_to_30/missing090field.pl @@ -7,15 +7,14 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } # Koha modules used use C4::Context; -use C4::Biblio; -use MARC::Record; +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ModBiblioMarc ); use MARC::File::USMARC; $|=1; --- a/misc/migration_tools/22_to_30/move_marc_to_authheader.pl +++ a/misc/migration_tools/22_to_30/move_marc_to_authheader.pl @@ -7,7 +7,7 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } use C4::Context; --- a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl +++ a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl @@ -5,11 +5,10 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } use C4::Context; -use C4::Biblio; use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); --- a/misc/migration_tools/22_to_30/rebuild_leader.pl +++ a/misc/migration_tools/22_to_30/rebuild_leader.pl @@ -7,15 +7,14 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } # Koha modules used use C4::Context; -use C4::Biblio; -use MARC::Record; +use C4::Biblio qw( ModBiblioMarc ); use MARC::File::USMARC; --- a/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl +++ a/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl @@ -7,15 +7,14 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../../kohalib.pl" }; } # Koha modules used use C4::Context; -use C4::Biblio; -use MARC::Record; +use C4::Biblio qw( GetMarcBiblio ModBiblioMarc ); use MARC::File::USMARC; --- a/misc/migration_tools/buildCOUNTRY.pl +++ a/misc/migration_tools/buildCOUNTRY.pl @@ -8,11 +8,10 @@ use strict; # Koha modules used use Koha::Script; use C4::Context; -use C4::Biblio; use C4::AuthoritiesMarc; -use Time::HiRes qw(gettimeofday); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ( $fields, $number,$language) = ('',0); my ($version, $verbose, $test_parameter, $delete); GetOptions( --- a/misc/migration_tools/buildEDITORS.pl +++ a/misc/migration_tools/buildEDITORS.pl @@ -10,11 +10,11 @@ use MARC::Record; use MARC::Batch; use Koha::Script; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ); use C4::AuthoritiesMarc; -use Time::HiRes qw(gettimeofday); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ( $input_marc_file, $number) = ('',0); my ($version, $verbose, $test_parameter, $confirm,$delete); GetOptions( --- a/misc/migration_tools/buildLANG.pl +++ a/misc/migration_tools/buildLANG.pl @@ -8,11 +8,10 @@ use strict; # Koha modules used use Koha::Script; use C4::Context; -use C4::Biblio; use C4::AuthoritiesMarc; -use Time::HiRes qw(gettimeofday); +use Time::HiRes qw( gettimeofday ); -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my ( $fields, $number,$language) = ('',0); my ($version, $verbose, $test_parameter, $delete); GetOptions( --- a/misc/migration_tools/build_oai_sets.pl +++ a/misc/migration_tools/build_oai_sets.pl @@ -39,14 +39,22 @@ oai_sets_mappings, and then fill table oai_sets_biblios with builded infos. use Modern::Perl; use MARC::Record; use MARC::File::XML; -use List::MoreUtils qw/uniq/; -use Getopt::Std; +use List::MoreUtils qw( uniq ); +use Getopt::Std qw( getopts ); use Koha::Script; use C4::Context; -use C4::Charset qw/StripNonXmlChars/; +use C4::Charset qw( StripNonXmlChars ); use C4::Biblio; -use C4::OAI::Sets; +use C4::OAI::Sets qw( + AddOAISetsBiblios + CalcOAISetsBiblio + GetOAISet + GetOAISetBySpec + GetOAISets + GetOAISetsMappings + ModOAISetsBiblios +); my %opts; $Getopt::Std::STANDARD_HELP_VERSION = 1; --- a/misc/migration_tools/bulkmarcimport.pl +++ a/misc/migration_tools/bulkmarcimport.pl @@ -6,32 +6,37 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } # Koha modules used use MARC::File::USMARC; use MARC::File::XML; -use MARC::Record; use MARC::Batch; -use MARC::Charset; use Encode; use Koha::Script; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( + AddBiblio + GetMarcFromKohaField + ModBiblio + ModBiblioMarc +); use C4::Koha; -use C4::Charset; -use C4::Items; -use C4::MarcModificationTemplates; +use C4::Charset qw( MarcToUTF8Record SetUTF8Flag ); +use C4::Items qw( AddItemBatchFromMarc ); +use C4::MarcModificationTemplates qw( + GetModificationTemplates + ModifyRecordWithTemplate +); use YAML::XS; -use Unicode::Normalize; -use Time::HiRes qw(gettimeofday); -use Getopt::Long; +use Time::HiRes qw( gettimeofday ); +use Getopt::Long qw( GetOptions ); use IO::File; -use Pod::Usage; +use Pod::Usage qw( pod2usage ); use Koha::Logger; use Koha::Biblios; --- a/misc/migration_tools/checkNonIndexedBiblios.pl +++ a/misc/migration_tools/checkNonIndexedBiblios.pl @@ -27,15 +27,14 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } # Koha modules used -use MARC::Record; use Koha::Script; use C4::Context; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::SearchEngine::Search; --- a/misc/migration_tools/create_analytical_rel.pl +++ a/misc/migration_tools/create_analytical_rel.pl @@ -5,16 +5,15 @@ use strict; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( GetMarcBiblio ModBiblio ); use Koha::Items; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); $| = 1; --- a/misc/migration_tools/ifla/update.pl +++ a/misc/migration_tools/ifla/update.pl @@ -19,10 +19,10 @@ use Modern::Perl; -use Date::Format; -use File::Basename; -use FindBin qw($Bin); -use Getopt::Long; +use Date::Format qw( time2str ); +use File::Basename qw( basename ); +use FindBin qw( $Bin ); +use Getopt::Long qw( GetOptions ); use Locale::PO; use YAML::XS; use utf8; --- a/misc/migration_tools/import_lexile.pl +++ a/misc/migration_tools/import_lexile.pl @@ -28,12 +28,12 @@ use utf8; use Modern::Perl; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Text::CSV; use Koha::Script; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio ModBiblio ); use C4::Koha qw( GetVariationsOfISBN ); use Koha::Biblios; @@ -45,7 +45,7 @@ BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } --- a/misc/migration_tools/koha-svc.pl +++ a/misc/migration_tools/koha-svc.pl @@ -21,7 +21,7 @@ use warnings; use strict; use LWP::UserAgent; -use File::Slurp; +use File::Slurp qw( read_file write_file ); if ( $#ARGV >= 3 && ! caller ) { # process command-line params only if not called as module! my ( $url, $user, $password, $biblionumber, $file ) = @ARGV; --- a/misc/migration_tools/rebuild_zebra.pl +++ a/misc/migration_tools/rebuild_zebra.pl @@ -19,13 +19,13 @@ use Modern::Perl; use Koha::Script; use C4::Context; -use Getopt::Long; -use Fcntl qw(:flock); -use File::Temp qw/ tempdir /; -use File::Path; -use C4::Biblio; +use Getopt::Long qw( GetOptions ); +use Fcntl qw( LOCK_EX LOCK_NB LOCK_UN ); +use File::Temp qw( tempdir ); +use File::Path qw( mkpath rmtree ); +use C4::Biblio qw( GetXmlBiblio ); use C4::AuthoritiesMarc; -use C4::Items; +use C4::Items qw( GetItemsInfo Item2Marc ); use Koha::RecordProcessor; use Koha::Caches; use XML::LibXML; --- a/misc/migration_tools/remove_unused_authorities.pl +++ a/misc/migration_tools/remove_unused_authorities.pl @@ -25,7 +25,7 @@ use Modern::Perl; use Koha::Script; use C4::Context; use C4::AuthoritiesMarc; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::SearchEngine::Search; --- a/misc/migration_tools/switch_marc21_series_info.pl +++ a/misc/migration_tools/switch_marc21_series_info.pl @@ -25,14 +25,14 @@ use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/../kohalib.pl" }; } use Koha::Script; -use C4::Biblio; +use C4::Biblio qw( GetFrameworkCode GetMarcBiblio ModBiblioMarc ); use C4::Context; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); my $commit; my $add_links; --- a/misc/migration_tools/upgradeitems.pl +++ a/misc/migration_tools/upgradeitems.pl @@ -5,8 +5,8 @@ use strict; use Koha::Script; use C4::Context; -use C4::Items; -use C4::Biblio; +use C4::Items qw( ModItemFromMarc ); +use C4::Biblio qw( GetMarcBiblio ); my $dbh=C4::Context->dbh; --- a/misc/mod_zebraqueue.pl +++ a/misc/mod_zebraqueue.pl @@ -20,11 +20,11 @@ use Modern::Perl; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Script; -use C4::Biblio; +use C4::Biblio qw( ModZebra ); my @biblios; my @authorities; --- a/misc/recreateIssueStatistics.pl +++ a/misc/recreateIssueStatistics.pl @@ -25,9 +25,7 @@ use warnings; use Koha::Script; use C4::Context; -use C4::Items; -use Data::Dumper; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Items; my $dbh = C4::Context->dbh; --- a/misc/sax_parser_test.pl +++ a/misc/sax_parser_test.pl @@ -4,7 +4,7 @@ use strict; use warnings; use XML::SAX; -use Encode; +use Encode qw( encode_utf8 ); my $parser = XML::SAX::ParserFactory->parser( Handler => MySAXHandler->new --- a/misc/search_tools/export_elasticsearch_mappings.pl +++ a/misc/search_tools/export_elasticsearch_mappings.pl @@ -61,8 +61,8 @@ use Koha::SearchMarcMaps; use Koha::SearchEngine::Elasticsearch; use YAML::XS; -use Getopt::Long; -use Pod::Usage; +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); my $type = ''; my $man; --- a/misc/search_tools/rebuild_elasticsearch.pl +++ a/misc/search_tools/rebuild_elasticsearch.pl @@ -112,7 +112,7 @@ Full documentation. =cut use autodie; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use Koha::Script; use C4::Context; use Koha::MetadataRecord::Authority; @@ -120,10 +120,9 @@ use Koha::BiblioUtils; use Koha::SearchEngine::Elasticsearch; use Koha::SearchEngine::Elasticsearch::Indexer; use MARC::Field; -use MARC::Record; use Modern::Perl; -use Pod::Usage; -use Try::Tiny; +use Pod::Usage qw( pod2usage ); +use Try::Tiny qw( catch try ); my $verbose = 0; my $commit = 5000; --- a/misc/stage_file.pl +++ a/misc/stage_file.pl @@ -23,16 +23,16 @@ use Modern::Perl; BEGIN { # find Koha's Perl modules # test carefully before changing this - use FindBin; + use FindBin (); eval { require "$FindBin::Bin/kohalib.pl" }; } use Koha::Script; use C4::Context; -use C4::ImportBatch; +use C4::ImportBatch qw( RecordsFromISO2709File RecordsFromMARCXMLFile BatchStageMarcRecords SetImportBatchMatcher SetImportBatchOverlayAction SetImportBatchNoMatchAction SetImportBatchItemAction BatchFindDuplicates ); use C4::Matcher; -use C4::MarcModificationTemplates; -use Getopt::Long; +use C4::MarcModificationTemplates qw( GetModificationTemplates ); +use Getopt::Long qw( GetOptions ); $| = 1; --- a/misc/translator/LangInstaller.pm +++ a/misc/translator/LangInstaller.pm @@ -19,14 +19,13 @@ package LangInstaller; use Modern::Perl; -use C4::Context; +use C4::Context qw( config preference new interface ); # WARNING: Any other tested YAML library fails to work properly in this # script content # FIXME Really? use YAML::XS; use Locale::PO; use FindBin qw( $Bin ); -use File::Basename; use File::Path qw( make_path ); use File::Copy; --- a/misc/translator/TmplTokenizer.pm +++ a/misc/translator/TmplTokenizer.pm @@ -7,8 +7,6 @@ use C4::TTParser; use VerboseWarnings qw( pedantic_p error_normal warn_normal warn_pedantic ); require Exporter; -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - ############################################################################### =head1 NAME @@ -24,9 +22,6 @@ A wrapper for the functionality found in TTParser to allow an easier transition ############################################################################### -@ISA = qw(Exporter); -@EXPORT_OK = qw(); - use vars qw( $pedantic_attribute_error_in_nonpedantic_mode_p ); use vars qw( $pedantic_tmpl_var_use_in_nonpedantic_mode_p ); use vars qw( $pedantic_error_markup_in_pcdata_p ); --- a/misc/translator/VerboseWarnings.pm +++ a/misc/translator/VerboseWarnings.pm @@ -1,9 +1,6 @@ package VerboseWarnings; use Modern::Perl; -require Exporter; - -use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); ############################################################################### @@ -20,20 +17,19 @@ verbose warnings. ############################################################################### - -@ISA = qw(Exporter); -@EXPORT_OK = qw( - &pedantic_p - &warn_additional - &warn_normal - &warn_pedantic - &error_additional - &error_normal -); -%EXPORT_TAGS = ( - 'warn' => [ 'warn_additional', 'warn_normal', 'warn_pedantic' ], - 'die' => [ 'error_additional', 'error_normal' ], -); +our (@ISA, @EXPORT_OK); +BEGIN { + require Exporter; + @ISA = qw(Exporter); + @EXPORT_OK = qw( + &pedantic_p + &warn_additional + &warn_normal + &warn_pedantic + &error_additional + &error_normal + ); +} ############################################################################### --- a/misc/translator/tmpl_process3.pl +++ a/misc/translator/tmpl_process3.pl @@ -16,10 +16,9 @@ using gettext-compatible translation files use strict; #use warnings; FIXME - Bug 2505 -use File::Basename; -use Getopt::Long; +use File::Basename qw( fileparse ); +use Getopt::Long qw( GetOptions ); use Locale::PO; -use File::Temp qw( :POSIX ); use TmplTokenizer; use VerboseWarnings qw( :warn :die ); --- a/misc/translator/xgettext.pl +++ a/misc/translator/xgettext.pl @@ -26,8 +26,8 @@ use lib $FindBin::Bin; use strict; use warnings; -use Getopt::Long; -use POSIX; +use Getopt::Long qw( GetOptions ); +use POSIX qw( close exit localtime open printf time ); use Locale::PO; use TmplTokenizer; use VerboseWarnings; --- a/misc/z3950_responder.pl +++ a/misc/z3950_responder.pl @@ -19,10 +19,9 @@ use Modern::Perl; -use Carp; -use File::Basename; -use Getopt::Long qw(:config no_ignore_case); -use Pod::Usage; +use File::Basename qw( fileparse ); +use Getopt::Long qw( GetOptions ); +use Pod::Usage qw( pod2usage ); use Koha::Config; use Koha::Z3950Responder; --- a/offline_circ/download.pl +++ a/offline_circ/download.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON; -use C4::Auth; +use JSON qw( to_json ); +use C4::Auth qw( checkauth ); use C4::Output; use C4::Context; use C4::Koha; --- a/offline_circ/enqueue_koc.pl +++ a/offline_circ/enqueue_koc.pl @@ -21,21 +21,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Biblio; use C4::Accounts; -use C4::Circulation; -use C4::Items; +use C4::Circulation qw( AddOfflineOperation ); use C4::Members; use C4::Stats; use Koha::Checkouts; use Koha::UploadedFiles; use Koha::Items; -use Date::Calc qw( Add_Delta_Days Date_to_Days ); # this is the file version number that we're coded against. my $FILE_VERSION = '1.0'; --- a/offline_circ/list.pl +++ a/offline_circ/list.pl @@ -21,13 +21,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Circulation; +use C4::Circulation qw( GetOfflineOperations GetOfflineOperation ); use C4::Members; -use C4::Biblio; use Koha::Patrons; use Koha::Items; --- a/offline_circ/process.pl +++ a/offline_circ/process.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Circulation; +use C4::Auth qw( get_template_and_user ); +use C4::Circulation qw( GetOfflineOperation ProcessOfflineOperation DeleteOfflineOperation ); my $query = CGI->new; --- a/offline_circ/process_koc.pl +++ a/offline_circ/process_koc.pl @@ -21,16 +21,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Carp; -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Biblio; use C4::Accounts; -use C4::Circulation; -use C4::Items; +use C4::Circulation qw( barcodedecode GetOpenIssue AddRenewal AddIssue MarkIssueReturned ); +use C4::Items qw( ModDateLastSeen ); use C4::Members; use C4::Stats; use C4::BackgroundJob; @@ -39,7 +36,7 @@ use Koha::Account; use Koha::Checkouts; use Koha::Patrons; -use Date::Calc qw( Add_Delta_Days Date_to_Days ); +use Date::Calc qw( Date_to_Days ); use constant DEBUG => 0; --- a/offline_circ/service.pl +++ a/offline_circ/service.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Circulation; -use Koha::DateUtils; +use C4::Auth qw( check_api_auth check_cookie_auth ); +use C4::Circulation qw( AddOfflineOperation ProcessOfflineOperation ); +use Koha::DateUtils qw( dt_from_string ); use DateTime::TimeZone; my $cgi = CGI->new; --- a/opac/clubs/clubs-tab.pl +++ a/opac/clubs/clubs-tab.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; my $cgi = CGI->new; --- a/opac/clubs/enroll.pl +++ a/opac/clubs/enroll.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Clubs; my $cgi = CGI->new; --- a/opac/errors/400.pl +++ a/opac/errors/400.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/opac/errors/401.pl +++ a/opac/errors/401.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/opac/errors/402.pl +++ a/opac/errors/402.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/opac/errors/403.pl +++ a/opac/errors/403.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/opac/errors/404.pl +++ a/opac/errors/404.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/opac/errors/500.pl +++ a/opac/errors/500.pl @@ -18,10 +18,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $query = CGI->new; my $admin = C4::Context->preference('KohaAdminEmailAddress'); --- a/opac/external/overdrive/auth.pl +++ a/opac/external/overdrive/auth.pl @@ -21,8 +21,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use URI; -use URI::Escape; -use C4::Auth qw(checkauth); +use URI::Escape qw( uri_escape ); use Koha::Logger; use Koha::ExternalContent::OverDrive; --- a/opac/ilsdi.pl +++ a/opac/ilsdi.pl @@ -20,12 +20,12 @@ use Modern::Perl; use C4::ILSDI::Services; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use List::MoreUtils qw(any); -use XML::Simple; +use List::MoreUtils qw( any ); +use XML::Simple qw( XMLout ); use CGI qw ( -utf8 ); use Net::Netmask; --- a/opac/maintenance.pl +++ a/opac/maintenance.pl @@ -19,7 +19,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Templates qw/gettemplate/; use Koha; --- a/opac/opac-ISBDdetail.pl +++ a/opac/opac-ISBDdetail.pl @@ -41,16 +41,25 @@ the items attached to the biblio use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( parametrized_url output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( + CountItemsIssued + GetISBDView + GetMarcControlnumber + GetMarcISSN + TransformMarcToKoha +); use C4::Reserves; -use C4::Acquisition; -use C4::Serials; # uses getsubscriptionfrom biblionumber -use C4::Koha; +use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); +use C4::Koha qw( + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); use Koha::CirculationRules; use Koha::ItemTypes; use Koha::Patrons; --- a/opac/opac-MARCdetail.pl +++ a/opac/opac-MARCdetail.pl @@ -45,25 +45,31 @@ the items attached to the biblio use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( parametrized_url output_html_with_http_headers ); use CGI qw ( -utf8 ); -use MARC::Record; -use C4::Biblio; -use C4::Items; +use C4::Biblio qw( + CountItemsIssued + GetAuthorisedValueDesc + GetMarcBiblio + GetMarcControlnumber + GetMarcFromKohaField + GetMarcISSN + GetMarcStructure + TransformMarcToKoha +); use C4::Reserves; use C4::Members; -use C4::Acquisition; -use C4::Koha; -use List::MoreUtils qw( any uniq ); +use C4::Koha qw( GetNormalizedISBN ); +use List::MoreUtils qw( uniq ); use Koha::Biblios; use Koha::CirculationRules; use Koha::Items; use Koha::ItemTypes; use Koha::Patrons; use Koha::RecordProcessor; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); my $query = CGI->new(); --- a/opac/opac-account-pay-return.pl +++ a/opac/opac-account-pay-return.pl @@ -21,7 +21,7 @@ use Modern::Perl; use CGI; -use C4::Auth; +use C4::Auth qw( checkauth ); use Koha::Plugins::Handler; my $cgi = CGI->new; --- a/opac/opac-account-pay.pl +++ a/opac/opac-account-pay.pl @@ -22,11 +22,8 @@ use utf8; use Modern::Perl; use CGI; -use HTTP::Request::Common; -use LWP::UserAgent; -use URI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use C4::Context; use Koha::Acquisition::Currencies; --- a/opac/opac-account.pl +++ a/opac/opac-account.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Members; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Account::Lines; use Koha::Patrons; use Koha::Plugins; --- a/opac/opac-addbybiblionumber.pl +++ a/opac/opac-addbybiblionumber.pl @@ -21,9 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Biblio; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Biblios; use Koha::Virtualshelves; --- a/opac/opac-alert-subscribe.pl +++ a/opac/opac-alert-subscribe.pl @@ -20,12 +20,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Koha; -use C4::Letters; -use C4::Serials; +use C4::Serials qw( GetSubscription ); my $query = CGI->new; --- a/opac/opac-article-request-cancel.pl +++ a/opac/opac-article-request-cancel.pl @@ -22,7 +22,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Output; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use Koha::ArticleRequests; my $query = CGI->new; --- a/opac/opac-authorities-home.pl +++ a/opac/opac-authorities-home.pl @@ -21,13 +21,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use URI::Escape; -use C4::Auth; +use URI::Escape qw( uri_escape_utf8 ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::AuthoritiesMarc; +use C4::Output qw( pagination_bar output_html_with_http_headers ); use C4::Koha; use C4::Search::History; --- a/opac/opac-authoritiesdetail.pl +++ a/opac/opac-authoritiesdetail.pl @@ -38,13 +38,12 @@ parameters tables. use Modern::Perl; -use C4::AuthoritiesMarc; -use C4::Auth; -use C4::Biblio qw(GetMarcUrls); +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcUrls ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); +use C4::AuthoritiesMarc qw( GetAuthority BuildSummary ); use CGI qw ( -utf8 ); -use MARC::Record; use C4::Koha; use Koha::Authorities; --- a/opac/opac-basket.pl +++ a/opac/opac-basket.pl @@ -20,11 +20,19 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Koha; -use C4::Biblio; -use C4::Items; -use C4::Circulation; -use C4::Auth; -use C4::Output; +use C4::Biblio qw( + GetBiblioData + GetFrameworkCode + GetMarcAuthors + GetMarcBiblio + GetMarcSeries + GetMarcSubjects + GetMarcUrls +); +use C4::Items qw( GetHiddenItemnumbers GetItemsInfo ); +use C4::Circulation qw( GetTransfers ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::RecordProcessor; use Koha::CsvProfiles; use Koha::AuthorisedValues; --- a/opac/opac-blocked.pl +++ a/opac/opac-blocked.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_with_http_headers ); use C4::Context; my $query = CGI->new; --- a/opac/opac-browse.pl +++ a/opac/opac-browse.pl @@ -22,16 +22,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::SearchEngine::Elasticsearch; use Koha::SearchEngine::Elasticsearch::Browse; use Koha::SearchEngine::Elasticsearch::QueryBuilder; use Koha::SearchEngine::Elasticsearch::Search; -use JSON; +use JSON qw( to_json ); use Unicode::Collate; my $query = CGI->new; --- a/opac/opac-browser.pl +++ a/opac/opac-browser.pl @@ -26,11 +26,10 @@ TODO :: Description here use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Biblio; my $query = CGI->new; --- a/opac/opac-course-details.pl +++ a/opac/opac-course-details.pl @@ -22,11 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::CourseReserves qw(GetCourse GetCourseReserves); +use C4::CourseReserves qw( GetCourse GetCourseReserve GetCourseReserves ); my $cgi = CGI->new; --- a/opac/opac-course-reserves.pl +++ a/opac/opac-course-reserves.pl @@ -22,10 +22,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::CourseReserves qw(SearchCourses); +use C4::CourseReserves qw( SearchCourses ); my $cgi = CGI->new; --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -24,30 +24,51 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Acquisition qw( SearchOrders ); -use C4::Auth qw(:DEFAULT get_session); -use C4::Koha; -use C4::Serials; #uses getsubscriptionfrom biblionumber -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Circulation; -use C4::Tags qw(get_tags); -use C4::XISBN qw(get_xisbns); -use C4::External::Amazon; +use C4::Auth qw( get_template_and_user get_session ); +use C4::Koha qw( + getitemtypeimagelocation + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); +use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); +use C4::Output qw( parametrized_url output_html_with_http_headers ); +use C4::Biblio qw( + CountItemsIssued + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcControlnumber + GetMarcISBN + GetMarcISSN + GetMarcSeries + GetMarcSubjects + GetMarcUrls +); +use C4::Items qw( GetHiddenItemnumbers GetItemsInfo ); +use C4::Circulation qw( GetTransfers ); +use C4::Tags qw( get_tags ); +use C4::XISBN qw( get_xisbns ); +use C4::External::Amazon qw( get_amazon_tld ); use C4::External::BakerTaylor qw( image_url link_url ); -use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes ); +use C4::External::Syndetics qw( + get_syndetics_anotes + get_syndetics_excerpt + get_syndetics_index + get_syndetics_reviews + get_syndetics_summary + get_syndetics_toc +); use C4::Members; -use C4::XSLT; -use C4::ShelfBrowser; -use C4::Reserves; -use C4::Charset; -use C4::Letters; -use MARC::Record; +use C4::XSLT qw( XSLTParse4Display ); +use C4::ShelfBrowser qw( GetNearbyItems ); +use C4::Reserves qw( GetReserveStatus ); +use C4::Charset qw( SetUTF8Flag ); use MARC::Field; -use List::MoreUtils qw/any none/; -use Koha::DateUtils; +use List::MoreUtils qw( any ); use C4::HTML5Media; -use C4::CourseReserves qw(GetItemCourseReservesInfo); +use C4::CourseReserves qw( GetItemCourseReservesInfo ); use Koha::Biblios; use Koha::RecordProcessor; @@ -63,7 +84,6 @@ use Koha::Ratings; use Koha::Reviews; use Koha::SearchEngine::Search; -use Try::Tiny; my $query = CGI->new(); @@ -228,7 +248,7 @@ my $session = get_session($query->cookie("CGISESSID")); my %paging = (previous => {}, next => {}); if ($session->param('busc')) { use C4::Search; - use URI::Escape; + use URI::Escape qw( uri_escape_utf8 uri_unescape ); # Rebuild the string to store on session # param value is URI encoded and params separator is HTML encode (&) --- a/opac/opac-discharge.pl +++ a/opac/opac-discharge.pl @@ -18,16 +18,14 @@ # along with Koha; if not, see . use Modern::Perl; -use Carp; +use Carp qw( carp ); -use C4::Auth qw(:DEFAULT get_session); +use C4::Auth qw( get_template_and_user ); use CGI qw( -utf8 ); use C4::Context; -use C4::Output; -use C4::Log; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; use Koha::Patron::Discharge; -use Koha::DateUtils; my $input = CGI->new; --- a/opac/opac-downloadcart.pl +++ a/opac/opac-downloadcart.pl @@ -20,14 +20,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); +use Encode qw( encode ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetFrameworkCode GetISBDView GetMarcBiblio ); +use C4::Output qw( output_html_with_http_headers ); use C4::Record; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::CsvProfiles; use Koha::RecordProcessor; --- a/opac/opac-downloadshelf.pl +++ a/opac/opac-downloadshelf.pl @@ -20,14 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetFrameworkCode GetISBDView GetMarcBiblio ); +use C4::Output qw( output_html_with_http_headers ); use C4::Record; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::CsvProfiles; use Koha::RecordProcessor; use Koha::Virtualshelves; --- a/opac/opac-export.pl +++ a/opac/opac-export.pl @@ -22,10 +22,15 @@ use Modern::Perl; use C4::Record; use C4::Auth; use C4::Output; -use C4::Biblio; +use C4::Biblio qw( + GetFrameworkCode + GetISBDView + GetMarcBiblio + GetMarcControlnumber +); use CGI qw ( -utf8 ); use C4::Auth; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::RecordProcessor; my $query = CGI->new; --- a/opac/opac-holdshistory.pl +++ a/opac/opac-holdshistory.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; use Koha::Holds; --- a/opac/opac-ics.pl +++ a/opac/opac-ics.pl @@ -29,11 +29,8 @@ use DateTime::Format::ICal; use DateTime::Event::ICal; use URI; -use C4::Auth; -use C4::Koha; -use C4::Circulation; -use C4::Members; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use Koha::DateUtils qw( dt_from_string ); my $query = CGI->new; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( --- a/opac/opac-idref.pl +++ a/opac/opac-idref.pl @@ -21,14 +21,13 @@ use Modern::Perl; use CGI; use LWP::UserAgent; -use HTTP::Request::Common; -use JSON; +use JSON qw( from_json ); use Encode; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Search; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( --- a/opac/opac-illrequests.pl +++ a/opac/opac-illrequests.pl @@ -22,9 +22,9 @@ use Modern::Perl; use JSON qw( encode_json ); use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Koha; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Illrequest::Config; use Koha::Illrequests; --- a/opac/opac-imageviewer.pl +++ a/opac/opac-imageviewer.pl @@ -20,9 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Biblio; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Biblios; use Koha::CoverImages; --- a/opac/opac-issue-note.pl +++ a/opac/opac-issue-note.pl @@ -23,12 +23,11 @@ use CGI qw ( -utf8 ); use C4::Koha; use C4::Context; use C4::Scrubber; -use C4::Output; -use C4::Auth; -use C4::Biblio; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Letters; use Koha::Checkouts; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; my $query = CGI->new; --- a/opac/opac-library.pl +++ a/opac/opac-library.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; my $query = CGI->new(); --- a/opac/opac-main.pl +++ a/opac/opac-main.pl @@ -20,12 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # get_template_and_user -use C4::Output; -use C4::Languages qw(getTranslatedLanguages accept_language); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Quotes; use C4::Members; -use C4::Overdues; +use C4::Overdues qw( checkoverdues ); use Koha::Checkouts; use Koha::Holds; use Koha::News; --- a/opac/opac-memberentry.pl +++ a/opac/opac-memberentry.pl @@ -19,14 +19,14 @@ use Modern::Perl; use CGI qw ( -utf8 ); use Digest::MD5 qw( md5_base64 md5_hex ); -use JSON; +use JSON qw( to_json ); use List::MoreUtils qw( any each_array uniq ); use String::Random qw( random_string ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Members; +use C4::Members qw( checkcardnumber ); use C4::Form::MessagingPreferences; use Koha::AuthUtils; use Koha::Patrons; @@ -35,7 +35,7 @@ use Koha::Patron::Modification; use Koha::Patron::Modifications; use C4::Scrubber; use Email::Valid; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; use Koha::Patron::Attribute::Types; use Koha::Patron::Attributes; --- a/opac/opac-messaging.pl +++ a/opac/opac-messaging.pl @@ -21,12 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # checkauth, getborrowernumber. +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Circulation; -use C4::Output; -use C4::Members; +use C4::Output qw( output_html_with_http_headers ); use C4::Members::Messaging; use C4::Form::MessagingPreferences; use Koha::Patrons; --- a/opac/opac-modrequest-suspend.pl +++ a/opac/opac-modrequest-suspend.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Output; -use C4::Reserves; -use C4::Auth; +use C4::Reserves qw( CanReserveBeCanceledFromOpac ToggleSuspend SuspendAll ); +use C4::Auth qw( get_template_and_user ); my $query = CGI->new; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { --- a/opac/opac-modrequest.pl +++ a/opac/opac-modrequest.pl @@ -26,8 +26,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Output; -use C4::Reserves; -use C4::Auth; +use C4::Reserves qw( CanReserveBeCanceledFromOpac ); +use C4::Auth qw( get_template_and_user ); use Koha::Holds; my $query = CGI->new; --- a/opac/opac-mymessages.pl +++ a/opac/opac-mymessages.pl @@ -21,11 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; use C4::Letters; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $query = CGI->new(); --- a/opac/opac-news-rss.pl +++ a/opac/opac-news-rss.pl @@ -20,9 +20,8 @@ use Modern::Perl; use CGI; -use C4::Auth; # get_template_and_user -use C4::Output; -use C4::Languages qw(getTranslatedLanguages accept_language); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::News; my $input = CGI->new; --- a/opac/opac-overdrive-search.pl +++ a/opac/opac-overdrive-search.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(:DEFAULT get_session); -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; --- a/opac/opac-passwd.pl +++ a/opac/opac-passwd.pl @@ -22,14 +22,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # checkauth, getborrowernumber. +use C4::Auth qw( get_template_and_user checkpw checkpw_hash ); use C4::Context; -use C4::Circulation; -use C4::Members; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; -use Try::Tiny; +use Try::Tiny qw( catch try ); my $query = CGI->new; --- a/opac/opac-password-recovery.pl +++ a/opac/opac-password-recovery.pl @@ -3,17 +3,21 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Koha; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use Koha::Patron::Password::Recovery - qw(SendPasswordRecoveryEmail ValidateBorrowernumber GetValidLinkInfo CompletePasswordRecovery DeleteExpiredPasswordRecovery); +use Koha::Patron::Password::Recovery qw( + CompletePasswordRecovery + DeleteExpiredPasswordRecovery + GetValidLinkInfo + SendPasswordRecoveryEmail + ValidateBorrowernumber +); use Koha::Patrons; my $query = CGI->new; use HTML::Entities; -use Try::Tiny; -use List::Util qw/any/; +use Try::Tiny qw( catch try ); +use List::Util qw( any ); my ( $template, $dummy, $cookie ) = get_template_and_user( { --- a/opac/opac-patron-consent.pl +++ a/opac/opac-patron-consent.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw/-utf8/; -use C4::Auth qw/get_template_and_user/; -use C4::Output qw/output_html_with_http_headers/; -use Koha::DateUtils qw/dt_from_string/; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patron::Consents; use Koha::Patrons; --- a/opac/opac-patron-image.pl +++ a/opac/opac-patron-image.pl @@ -22,7 +22,7 @@ use Modern::Perl; use C4::Members; use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request -use C4::Auth qw(:DEFAULT check_cookie_auth); +use C4::Auth qw( check_cookie_auth ); use Koha::Patron::Images; my $query = CGI->new; --- a/opac/opac-privacy.pl +++ a/opac/opac-privacy.pl @@ -19,9 +19,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # checkauth, getborrowernumber. +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; my $query = CGI->new; --- a/opac/opac-ratings-ajax.pl +++ a/opac/opac-ratings-ajax.pl @@ -28,9 +28,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request -use C4::Auth qw(:DEFAULT check_cookie_auth); +use C4::Auth qw( get_template_and_user check_cookie_auth ); use C4::Context; -use C4::Output qw(:html :ajax pagination_bar); +use C4::Output qw( is_ajax output_ajax_with_http_headers ); use Koha::Ratings; --- a/opac/opac-ratings.pl +++ a/opac/opac-ratings.pl @@ -28,7 +28,7 @@ note: there is currently no 'delete rating' functionality in this script use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Context; use Koha::Ratings; --- a/opac/opac-readingrecord.pl +++ a/opac/opac-readingrecord.pl @@ -20,17 +20,19 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( + getitemtypeimagelocation + GetNormalizedISBN + GetNormalizedUPC +); use C4::Biblio; -use C4::Circulation; -use C4::Members; +use C4::Members qw( GetAllIssues ); use C4::External::BakerTaylor qw( image_url link_url ); -use Koha::DateUtils; use MARC::Record; -use C4::Output; -use C4::Charset qw(StripNonXmlChars); +use C4::Output qw( output_html_with_http_headers ); +use C4::Charset qw( StripNonXmlChars ); use Koha::Patrons; use Koha::ItemTypes; --- a/opac/opac-recordedbooks-search.pl +++ a/opac/opac-recordedbooks-search.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; --- a/opac/opac-registration-verify.pl +++ a/opac/opac-registration-verify.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use C4::Form::MessagingPreferences; use Koha::AuthUtils; --- a/opac/opac-renew.pl +++ a/opac/opac-renew.pl @@ -24,14 +24,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Circulation; -use C4::Auth; +use C4::Circulation qw( CanBookBeRenewed AddRenewal ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Items; use C4::Members; use Koha::Items; use Koha::Patrons; -use Date::Calc qw( Today Date_to_Days ); my $query = CGI->new; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( --- a/opac/opac-reportproblem.pl +++ a/opac/opac-reportproblem.pl @@ -19,16 +19,16 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; # get_template_and_user -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Letters; use Koha::ProblemReport; use Koha::Libraries; use Koha::Patrons; use Koha::Util::Navigation; -use URI::Escape; +use URI::Escape qw( uri_unescape ); use Encode; my $input = CGI->new; --- a/opac/opac-request-article.pl +++ a/opac/opac-request-article.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Biblios; use Koha::Patrons; --- a/opac/opac-reserve.pl +++ a/opac/opac-reserve.pl @@ -21,28 +21,27 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; # checkauth, getborrowernumber. -use C4::Koha; -use C4::Circulation; -use C4::Reserves; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( getitemtypeimagelocation getitemtypeimagesrc ); +use C4::Circulation qw( GetBranchItemRule GetTransfers ); +use C4::Reserves qw( CanItemBeReserved CanBookBeReserved AddReserve GetReservesControlBranch IsAvailableForItemLevelRequest ); +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetMarcBiblio ); +use C4::Items qw( GetHostItemsInfo GetItemsInfo ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use C4::Members; use C4::Overdues; use Koha::AuthorisedValues; use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::CirculationRules; use Koha::Items; use Koha::ItemTypes; use Koha::Checkouts; use Koha::Libraries; use Koha::Patrons; -use Date::Calc qw/Today Date_to_Days/; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); my $maxreserves = C4::Context->preference("maxreserves"); --- a/opac/opac-restrictedpage.pl +++ a/opac/opac-restrictedpage.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $localNetwork = C4::Context->preference('RestrictedPageLocalIPs'); my $userIP = $ENV{'REMOTE_ADDR'}; --- a/opac/opac-retrieve-file.pl +++ a/opac/opac-retrieve-file.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI; use Encode; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::UploadedFiles; my $input = CGI::->new; --- a/opac/opac-review.pl +++ a/opac/opac-review.pl @@ -19,14 +19,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Output; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Scrubber; use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Review; use Koha::Reviews; --- a/opac/opac-routing-lists.pl +++ a/opac/opac-routing-lists.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Members; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; my $query = CGI->new; --- a/opac/opac-search-history.pl +++ a/opac/opac-search-history.pl @@ -19,16 +19,12 @@ use Modern::Perl; -use C4::Auth qw(:DEFAULT get_session); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Log; -use C4::Items; +use C4::Output qw( output_html_with_http_headers ); use C4::Search::History; -use URI::Escape; -use POSIX qw(strftime); my $cgi = CGI->new; --- a/opac/opac-search.pl +++ a/opac/opac-search.pl @@ -43,14 +43,14 @@ my ($builder, $searcher); $builder = Koha::SearchEngine::QueryBuilder->new({index => 'biblios'}); $searcher = Koha::SearchEngine::Search->new({index => 'biblios'}); -use C4::Output; -use C4::Auth qw(:DEFAULT get_session); -use C4::Languages qw(getLanguages); -use C4::Search; +use C4::Output qw( output_html_with_http_headers pagination_bar output_with_http_headers ); +use C4::Auth qw( get_template_and_user get_session ); +use C4::Languages qw( getlanguage getLanguages ); +use C4::Search qw( searchResults ); use C4::Search::History; -use C4::Biblio; # Unused here? -use C4::Koha; -use C4::Tags qw(get_tags); +use C4::Biblio qw( GetXmlBiblio CountItemsIssued ); +use C4::Koha qw( GetItemTypesCategorized getitemtypeimagelocation GetAuthorisedValues ); +use C4::Tags qw( get_tags get_tag ); use C4::SocialData; use C4::External::OverDrive; use C4::External::BakerTaylor qw( image_url link_url ); --- a/opac/opac-sendbasket.pl +++ a/opac/opac-sendbasket.pl @@ -20,16 +20,20 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); -use Carp; -use Try::Tiny; - -use C4::Biblio; -use C4::Items; -use C4::Auth; -use C4::Output; -use C4::Members; -use C4::Templates (); +use Encode; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); + +use C4::Biblio qw( + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcSubjects +); +use C4::Items qw( GetItemsInfo ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Templates; use Koha::Email; use Koha::Patrons; use Koha::Token; --- a/opac/opac-sendshelf.pl +++ a/opac/opac-sendshelf.pl @@ -20,15 +20,21 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw( encode ); -use Carp; -use Try::Tiny; - -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; -use C4::Members; +use Encode; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); + +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( + GetBiblioData + GetFrameworkCode + GetMarcAuthors + GetMarcBiblio + GetMarcISBN + GetMarcSubjects +); +use C4::Items qw( GetItemsInfo ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Email; use Koha::Patrons; use Koha::Virtualshelves; --- a/opac/opac-serial-issues.pl +++ a/opac/opac-serial-issues.pl @@ -21,11 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Serials; -use C4::Letters; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( GetFullSubscription GetFullSubscriptionsFromBiblionumber PrepareSerialsData GetSubscription GetSubscriptionsFromBiblionumber ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; my $query = CGI->new; --- a/opac/opac-shareshelf.pl +++ a/opac/opac-shareshelf.pl @@ -27,11 +27,10 @@ use constant SHELVES_URL => use CGI qw ( -utf8 ); use Email::Valid; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Letters; -use C4::Members (); -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Patrons; use Koha::Virtualshelves; --- a/opac/opac-shelves.pl +++ a/opac/opac-shelves.pl @@ -20,13 +20,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetBiblioData GetFrameworkCode GetMarcBiblio ); use C4::External::BakerTaylor qw( image_url link_url ); -use C4::Koha; -use C4::Items; +use C4::Koha qw( + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); use C4::Members; -use C4::Output; +use C4::Output qw( pagination_bar output_with_http_headers ); use C4::Tags qw( get_tags ); use C4::XSLT; --- a/opac/opac-showmarc.pl +++ a/opac/opac-showmarc.pl @@ -25,11 +25,10 @@ use Encode; # Koha modules used use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Biblio; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::ImportBatch; -use C4::XSLT (); +use C4::XSLT; use C4::Templates; use Koha::RecordProcessor; --- a/opac/opac-showreviews.pl +++ a/opac/opac-showreviews.pl @@ -21,15 +21,19 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Output; -use C4::Circulation; -use C4::Biblio; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( GetMarcBiblio ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Patrons; use Koha::Reviews; -use POSIX qw(ceil floor strftime); +use POSIX qw( ceil floor ); my $template_name; my $query = CGI->new; --- a/opac/opac-suggestions.pl +++ a/opac/opac-suggestions.pl @@ -19,13 +19,18 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw( encode ); -use C4::Auth; # get_template_and_user +use Encode; +use C4::Auth qw( get_template_and_user ); use C4::Members; -use C4::Koha; -use C4::Output; -use C4::Suggestions; -use C4::Koha; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Suggestions qw( + DelSuggestion + MarcRecordFromNewSuggestion + NewSuggestion + SearchSuggestion +); +use C4::Koha qw( GetAuthorisedValues ); use C4::Scrubber; use C4::Search qw( FindDuplicate ); @@ -33,7 +38,7 @@ use Koha::AuthorisedValues; use Koha::Libraries; use Koha::Patrons; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my $op = $input->param('op') || 'else'; --- a/opac/opac-tags.pl +++ a/opac/opac-tags.pl @@ -35,16 +35,21 @@ use Modern::Perl; use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request -use C4::Auth qw(:DEFAULT check_cookie_auth); +use C4::Auth qw( check_cookie_auth get_template_and_user ); use C4::Context; -use C4::Output qw(:html :ajax ); +use C4::Output qw( output_with_http_headers is_ajax output_html_with_http_headers ); use C4::Scrubber; -use C4::Biblio; -use C4::Items qw(GetItemsInfo GetHiddenItemnumbers); -use C4::Tags qw(add_tag get_approval_rows get_tag_rows remove_tag stratify_tags); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Items qw( GetHiddenItemnumbers GetItemsInfo ); +use C4::Tags qw( + add_tag + get_approval_rows + get_tag_rows + remove_tag + stratify_tags +); use C4::XSLT; -use Data::Dumper; use Koha::Logger; use Koha::Biblios; --- a/opac/opac-tags_subject.pl +++ a/opac/opac-tags_subject.pl @@ -26,11 +26,10 @@ TODO :: Description here use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Biblio; my $query = CGI->new; --- a/opac/opac-topissues.pl +++ a/opac/opac-topissues.pl @@ -22,14 +22,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Languages; use C4::Search; -use C4::Output; -use C4::Koha; -use C4::Circulation; -use Date::Manip; +use C4::Output qw( output_html_with_http_headers ); +use C4::Circulation qw( GetTopIssues ); =head1 NAME --- a/opac/opac-user.pl +++ a/opac/opac-user.pl @@ -21,20 +21,22 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Circulation; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( + getitemtypeimagelocation + GetNormalizedISBN + GetNormalizedUPC +); +use C4::Circulation qw( CanBookBeRenewed GetRenewCount GetIssuingCharges GetSoonestRenewDate ); use C4::External::BakerTaylor qw( image_url link_url ); -use C4::Reserves; +use C4::Reserves qw( GetReserveStatus ); use C4::Members; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Letters; +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( GetMarcBiblio ); use Koha::Account::Lines; use Koha::Biblios; use Koha::Libraries; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::Holds; use Koha::Database; use Koha::ItemTypes; @@ -48,12 +50,8 @@ use Koha::Token; use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE'; -use Scalar::Util qw(looks_like_number); -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); +use Scalar::Util qw( looks_like_number ); +use Date::Calc qw( Date_to_Days Today ); my $query = CGI->new; --- a/opac/sci/sci-main.pl +++ a/opac/sci/sci-main.pl @@ -19,13 +19,13 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user checkpw); -use C4::Circulation; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Circulation qw( AddReturn ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Items; use List::MoreUtils qw( uniq ); -use Try::Tiny; +use Try::Tiny qw( catch try ); my $cgi = CGI->new; --- a/opac/sco/help.pl +++ a/opac/sco/help.pl @@ -24,8 +24,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user in_iprange); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( in_iprange get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $query = CGI->new; unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) { --- a/opac/sco/printslip.pl +++ a/opac/sco/printslip.pl @@ -29,10 +29,9 @@ It is called from sco-main.pl use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw/:DEFAULT get_session in_iprange/; -use C4::Output; -use C4::Members; -use C4::Koha; +use C4::Auth qw( in_iprange get_session get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Members qw( IssueSlip ); my $input = CGI->new; unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) { --- a/opac/sco/sco-main.pl +++ a/opac/sco/sco-main.pl @@ -35,14 +35,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user checkpw in_iprange); -use C4::Koha; -use C4::Circulation; +use C4::Auth qw( in_iprange get_template_and_user checkpw ); +use C4::Circulation qw( AddReturn CanBookBeIssued AddIssue CanBookBeRenewed AddRenewal ); use C4::Reserves; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Members; -use C4::Biblio; -use C4::Items; use Koha::DateUtils qw( dt_from_string ); use Koha::Acquisition::Currencies; use Koha::Items; --- a/opac/sco/sco-patron-image.pl +++ a/opac/sco/sco-patron-image.pl @@ -18,7 +18,7 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth qw(in_iprange); +use C4::Auth qw( in_iprange ); use C4::Service; use C4::Members; use Koha::Patron::Images; --- a/opac/svc/checkout_notes +++ a/opac/svc/checkout_notes @@ -21,10 +21,10 @@ use Modern::Perl; use JSON qw( encode_json ); use C4::Service; -use C4::Auth qw /check_cookie_auth/; +use C4::Auth qw( check_cookie_auth get_template_and_user ); use C4::Letters; use CGI; -use C4::Output qw(:DEFAULT :ajax); +use C4::Output qw( is_ajax output_with_http_headers ); use C4::Scrubber; use C4::Circulation; use C4::Biblio; --- a/opac/svc/shelfbrowser.pl +++ a/opac/svc/shelfbrowser.pl @@ -3,10 +3,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::ShelfBrowser; +use C4::Output qw( output_html_with_http_headers ); +use C4::ShelfBrowser qw( GetNearbyItems ); my $cgi = CGI->new; --- a/opac/tracklinks.pl +++ a/opac/tracklinks.pl @@ -20,13 +20,13 @@ use Modern::Perl; use C4::Context; -use C4::Auth qw(checkauth); +use C4::Auth qw( checkauth ); use C4::Biblio; -use C4::Output; +use C4::Output qw( output_error ); use Koha::Items; use Koha::Linktracker; use CGI qw ( -utf8 ); -use List::MoreUtils qw(any); +use List::MoreUtils qw( any ); my $cgi = CGI->new; my $uri = $cgi->param('uri') || ''; --- a/patron_lists/add-modify.pl +++ a/patron_lists/add-modify.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::List::Patron; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::List::Patron qw( AddPatronList GetPatronLists ModPatronList ); my $cgi = CGI->new; --- a/patron_lists/delete.pl +++ a/patron_lists/delete.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; -use Koha::List::Patron; +use Koha::List::Patron qw( DelPatronList ); my $cgi = CGI->new; --- a/patron_lists/list.pl +++ a/patron_lists/list.pl @@ -21,10 +21,14 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::List::Patron; -use List::MoreUtils qw/uniq/; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::List::Patron qw( + AddPatronsToList + DelPatronsFromList + GetPatronLists +); +use List::MoreUtils qw( uniq ); my $cgi = CGI->new; --- a/patron_lists/lists.pl +++ a/patron_lists/lists.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::List::Patron; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::List::Patron qw( GetPatronLists ); my $cgi = CGI->new; --- a/patron_lists/patrons.pl +++ a/patron_lists/patrons.pl @@ -21,9 +21,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use Koha::List::Patron; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use Koha::List::Patron qw( AddPatronList GetPatronLists ModPatronList ); my $cgi = CGI->new; --- a/patroncards/add_user_search.pl +++ a/patroncards/add_user_search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; --- a/patroncards/create-pdf.pl +++ a/patroncards/create-pdf.pl @@ -19,17 +19,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use Graphics::Magick; -use XML::Simple; -use POSIX qw(ceil); -use Storable qw(dclone); +use XML::Simple qw( XMLin ); +use POSIX qw( ceil ); +use Storable qw( dclone ); use autouse 'Data::Dumper' => qw(Dumper); use C4::Context; use C4::Creators; use C4::Patroncards; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); use Koha::Patrons; use Koha::Patron::Images; --- a/patroncards/edit-batch.pl +++ a/patroncards/edit-batch.pl @@ -24,9 +24,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_card_summary html_table ); use C4::Patroncards; use Koha::Patrons; --- a/patroncards/edit-layout.pl +++ a/patroncards/edit-layout.pl @@ -21,13 +21,18 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Text::CSV_XS; -use XML::Simple; +use XML::Simple qw( XMLin XMLout ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( + get_all_image_names + get_barcode_types + get_font_types + get_text_justification_types + get_unit_values +); use C4::Patroncards; my $cgi = CGI->new; --- a/patroncards/edit-profile.pl +++ a/patroncards/edit-profile.pl @@ -22,9 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators::Lib qw(get_all_templates get_unit_values); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators::Lib qw( get_all_templates get_unit_values ); use C4::Patroncards::Profile; my $cgi = CGI->new; --- a/patroncards/edit-template.pl +++ a/patroncards/edit-template.pl @@ -23,9 +23,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_all_profiles get_unit_values ); use C4::Patroncards; my $cgi = CGI->new; --- a/patroncards/home.pl +++ a/patroncards/home.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/patroncards/image-manage.pl +++ a/patroncards/image-manage.pl @@ -4,13 +4,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); use Graphics::Magick; -use POSIX qw(ceil); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Creators; -use C4::Patroncards; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( html_table ); +use C4::Patroncards qw( get_image put_image rm_image ); my $cgi = CGI->new; --- a/patroncards/manage.pl +++ a/patroncards/manage.pl @@ -23,12 +23,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; -use C4::Patroncards; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( + get_all_layouts + get_all_profiles + get_all_templates + get_batch_summary + html_table +); use C4::Labels; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/patroncards/print.pl +++ a/patroncards/print.pl @@ -22,10 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth qw(get_template_and_user); -use C4::Output qw(output_html_with_http_headers); -use C4::Creators; -use C4::Patroncards; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Creators qw( get_all_layouts get_all_templates get_output_formats ); my $cgi = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/plugins/plugins-enable.pl +++ a/plugins/plugins-enable.pl @@ -20,7 +20,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth qw(check_cookie_auth); +use C4::Auth qw( check_cookie_auth ); use Koha::Plugins::Handler; die("Koha plugins are disabled!") unless C4::Context->config("enable_plugins"); --- a/plugins/plugins-home.pl +++ a/plugins/plugins-home.pl @@ -21,12 +21,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON qw(from_json); -use LWP::Simple qw(get); +use JSON qw( from_json ); +use LWP::Simple qw( get ); use Koha::Plugins; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; my $plugins_enabled = C4::Context->config("enable_plugins"); --- a/plugins/plugins-uninstall.pl +++ a/plugins/plugins-uninstall.pl @@ -18,12 +18,10 @@ use Modern::Perl; use Archive::Extract; -use File::Temp; -use File::Copy; use CGI qw ( -utf8 ); use C4::Context; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Output; use C4::Members; use Koha::Plugins::Handler; --- a/plugins/plugins-upload.pl +++ a/plugins/plugins-upload.pl @@ -21,12 +21,11 @@ use Modern::Perl; use Archive::Extract; use CGI qw ( -utf8 ); use Mojo::UserAgent; -use File::Copy; use File::Temp; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Logger; use Koha::Plugins; --- a/plugins/run.pl +++ a/plugins/run.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use Koha::Plugins::Handler; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; my $plugins_enabled = C4::Context->config("enable_plugins"); --- a/pos/pay.pl +++ a/pos/pay.pl @@ -22,8 +22,8 @@ use Modern::Perl; use CGI; use JSON qw( from_json ); -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; +use C4::Auth qw( get_session get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Account::DebitTypes; --- a/pos/printreceipt.pl +++ a/pos/printreceipt.pl @@ -19,12 +19,10 @@ use Modern::Perl; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Letters; use Koha::Account::Lines; -use Koha::DateUtils; use Koha::Notice::Templates; my $input = CGI->new; --- a/pos/register.pl +++ a/pos/register.pl @@ -19,14 +19,14 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Account::Lines; use Koha::Cash::Registers; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new(); --- a/pos/registers.pl +++ a/pos/registers.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; use Koha::Cash::Registers; --- a/reports/acquisitions_stats.pl +++ a/reports/acquisitions_stats.pl @@ -19,16 +19,15 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Reports; -use C4::Output; -use C4::Koha; -use C4::Circulation; -use C4::Biblio; +use C4::Reports qw( GetDelimiterChoices ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Biblio qw( GetMarcSubfieldStructureFromKohaField ); use Koha::ItemTypes; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; =head1 NAME --- a/reports/bor_issues_top.pl +++ a/reports/bor_issues_top.pl @@ -20,15 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Koha; -use C4::Circulation; -use C4::Members; -use C4::Reports; +use C4::Reports qw( GetDelimiterChoices ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; use Koha::Patron::Categories; @@ -286,8 +283,7 @@ sub calculate { $patrons{$id}->{oldcols}->{$col} = $rank; } - use Data::Dumper; - + $strcalc =~ s/old_issues/issues/g; $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; --- a/reports/borrowers_out.pl +++ a/reports/borrowers_out.pl @@ -20,15 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Output; -use C4::Circulation; -use C4::Reports; -use C4::Members; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patron::Categories; =head1 NAME --- a/reports/borrowers_stats.pl +++ a/reports/borrowers_stats.pl @@ -19,26 +19,20 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use List::MoreUtils qw/uniq/; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Acquisition; -use C4::Output; -use C4::Reports; -use C4::Circulation; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Libraries; use Koha::Patron::Attribute::Types; use Koha::Patron::Categories; -use Date::Calc qw( - Today - Add_Delta_YM - ); +use Date::Calc qw( Add_Delta_YM Today ); =head1 NAME --- a/reports/cash_register_stats.pl +++ a/reports/cash_register_stats.pl @@ -16,17 +16,15 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI; use C4::Context; -use C4::Reports; -use C4::Output; -use C4::Koha; -use C4::Circulation; +use C4::Reports qw( GetDelimiterChoices ); +use C4::Output qw( output_html_with_http_headers ); use DateTime; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Text::CSV::Encoded; -use List::Util qw/any/; +use List::Util qw( any ); use Koha::Account::CreditTypes; use Koha::Account::DebitTypes; --- a/reports/cat_issues_top.pl +++ a/reports/cat_issues_top.pl @@ -19,15 +19,13 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Circulation; -use C4::Reports; -use C4::Members; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Reports qw( GetDelimiterChoices ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; =head1 NAME --- a/reports/catalogue_out.pl +++ a/reports/catalogue_out.pl @@ -20,11 +20,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); # use Date::Manip; # TODO: add not borrowed since date X criteria -use Data::Dumper; =head1 catalogue_out --- a/reports/catalogue_stats.pl +++ a/reports/catalogue_stats.pl @@ -19,17 +19,16 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Reports; -use C4::Circulation; -use C4::Biblio qw/GetMarcSubfieldStructureFromKohaField/; +use C4::Output qw( output_html_with_http_headers ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Reports qw( GetDelimiterChoices ); +use C4::Biblio qw( GetMarcSubfieldStructureFromKohaField ); use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::ItemTypes; =head1 NAME --- a/reports/dictionary.pl +++ a/reports/dictionary.pl @@ -16,13 +16,12 @@ # # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); -use C4::Output; -use C4::Reports::Guided; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports::Guided qw( get_from_dictionary get_columns get_column_type get_distinct_values save_dictionary delete_definition get_report_areas ); +use Koha::DateUtils qw( dt_from_string output_pref ); =head1 NAME --- a/reports/guided_reports.pl +++ a/reports/guided_reports.pl @@ -23,21 +23,21 @@ use Text::CSV::Encoded; use Encode qw( decode ); use URI::Escape; use File::Temp; -use C4::Reports::Guided; +use C4::Reports::Guided qw( delete_report get_report_areas convert_sql update_sql get_saved_reports get_results ValidateSQLParameters format_results get_report_types get_columns get_from_dictionary get_criteria build_query save_report execute_query nb_rows get_report_groups ); use Koha::Reports; -use C4::Auth qw/:DEFAULT get_session/; -use C4::Output; +use C4::Auth qw( get_template_and_user get_session ); +use C4::Output qw( pagination_bar output_html_with_http_headers ); use C4::Context; use Koha::Caches; -use C4::Log; -use Koha::DateUtils qw/dt_from_string output_pref/; +use C4::Log qw( logaction ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::AuthorisedValue; use Koha::AuthorisedValues; use Koha::BiblioFrameworks; use Koha::Libraries; use Koha::Patron::Categories; use Koha::SharedContent; -use Koha::Util::OpenDocument; +use Koha::Util::OpenDocument qw( generate_ods ); =head1 NAME --- a/reports/issues_avg_stats.pl +++ a/reports/issues_avg_stats.pl @@ -19,17 +19,15 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Circulation; -use C4::Reports; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; use Koha::Patron::Categories; -use Date::Calc qw(Delta_Days); +use Date::Calc qw( Delta_Days ); =head1 NAME --- a/reports/issues_stats.pl +++ a/reports/issues_stats.pl @@ -20,18 +20,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Date::Manip; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Output; -use C4::Circulation; -use C4::Reports; -use C4::Members; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; use Koha::Patron::Attribute::Types; --- a/reports/itemslost.pl +++ a/reports/itemslost.pl @@ -29,14 +29,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); use Text::CSV_XS; -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::AuthorisedValues; use Koha::CsvProfiles; -use Koha::DateUtils; my $query = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/reports/manager.pl +++ a/reports/manager.pl @@ -19,10 +19,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Circulation; +use C4::Output qw( output_html_with_http_headers ); my $input = CGI->new; --- a/reports/orders_by_fund.pl +++ a/reports/orders_by_fund.pl @@ -28,14 +28,12 @@ This script displays all orders associated to a selected budget. use Modern::Perl; use CGI qw( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Budgets; -use C4::Biblio; -use C4::Reports; -use C4::Acquisition; #GetBasket() +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Budgets qw( GetBudgetsReport GetBudgetHierarchy ); +use C4::Acquisition qw( GetBasket get_rounded_price ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $query = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/reports/reports-home.pl +++ a/reports/reports-home.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; --- a/reports/reserves_stats.pl +++ a/reports/reserves_stats.pl @@ -21,18 +21,18 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha; -use C4::Output; -use C4::Reports; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); use C4::Members; use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::ItemTypes; use Koha::Libraries; use Koha::Patron::Categories; -use List::MoreUtils qw/any/; +use List::MoreUtils qw( any ); =head1 NAME --- a/reports/serials_stats.pl +++ a/reports/serials_stats.pl @@ -18,13 +18,12 @@ # along with Koha; if not, see . use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Koha; -use C4::Reports; -use C4::Serials; +use C4::Output qw( output_html_with_http_headers ); +use C4::Reports qw( GetDelimiterChoices ); +use C4::Serials qw( GetExpirationDate HasSubscriptionExpired ); =head1 serials_out --- a/reserve/modrequest.pl +++ a/reserve/modrequest.pl @@ -26,8 +26,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use List::MoreUtils qw( uniq ); use C4::Output; -use C4::Reserves; -use C4::Auth; +use C4::Reserves qw( ModReserve ModReserveCancelAll ); +use C4::Auth qw( get_template_and_user ); use Koha::DateUtils qw( dt_from_string ); my $query = CGI->new; --- a/reserve/modrequest_suspendall.pl +++ a/reserve/modrequest_suspendall.pl @@ -25,8 +25,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Output; -use C4::Reserves; -use C4::Auth; +use C4::Reserves qw( SuspendAll ); +use C4::Auth qw( get_template_and_user ); my $query = CGI->new; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( --- a/reserve/placerequest.pl +++ a/reserve/placerequest.pl @@ -24,13 +24,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Biblio; -use C4::Items; -use C4::Output; -use C4::Reserves; -use C4::Circulation; -use C4::Members; -use C4::Auth qw/checkauth/; +use C4::Reserves qw( CanItemBeReserved AddReserve CanBookBeReserved ); +use C4::Auth qw( checkauth ); use Koha::Items; use Koha::Patrons; --- a/reserve/request.pl +++ a/reserve/request.pl @@ -29,23 +29,21 @@ script to place reserves/requests use Modern::Perl; use CGI qw ( -utf8 ); -use List::MoreUtils qw/uniq/; -use Date::Calc qw/Date_to_Days/; -use C4::Output; -use C4::Auth; -use C4::Reserves; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Serials; -use C4::Circulation; -use Koha::DateUtils; +use List::MoreUtils qw( uniq ); +use Date::Calc qw( Date_to_Days ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Reserves qw( RevertWaitingStatus AlterPriority ToggleLowestPriority ToggleSuspend CanBookBeReserved GetMaxPatronHoldsForRecord ItemsAnyAvailableAndNotRestricted CanItemBeReserved IsAvailableForItemLevelRequest ); +use C4::Items qw( get_hostitemnumbers_of ); +use C4::Koha qw( getitemtypeimagelocation ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); +use C4::Circulation qw( GetTransfers _GetCircControlBranch GetBranchItemRule ); +use Koha::DateUtils qw( dt_from_string output_pref ); use C4::Utils::DataTables::Members; -use C4::Members; -use C4::Search; # enabled_staff_search_views +use C4::Search qw( enabled_staff_search_views ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Checkouts; use Koha::Holds; use Koha::CirculationRules; --- a/reviews/reviewswaiting.pl +++ a/reviews/reviewswaiting.pl @@ -18,10 +18,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( pagination_bar output_html_with_http_headers ); use C4::Context; -use C4::Biblio; use Koha::Biblios; use Koha::Patrons; use Koha::Reviews; --- a/rotating_collections/addItems.pl +++ a/rotating_collections/addItems.pl @@ -18,11 +18,10 @@ use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::RotatingCollections; -use C4::Items; use Koha::Items; --- a/rotating_collections/editCollections.pl +++ a/rotating_collections/editCollections.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::RotatingCollections; --- a/rotating_collections/rotatingCollections.pl +++ a/rotating_collections/rotatingCollections.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::RotatingCollections; --- a/rotating_collections/transferCollection.pl +++ a/rotating_collections/transferCollection.pl @@ -18,8 +18,8 @@ use Modern::Perl; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::RotatingCollections; --- a/serials/acqui-search-result.pl +++ a/serials/acqui-search-result.pl @@ -41,12 +41,11 @@ acqui-search-result.pl use Modern::Perl; -use C4::Auth; -use C4::Biblio; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); use C4::Acquisition qw( SearchOrders ); -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::Acquisition::Booksellers; --- a/serials/acqui-search.pl +++ a/serials/acqui-search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); my $query = CGI->new; --- a/serials/add_user_search.pl +++ a/serials/add_user_search.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; --- a/serials/checkexpiration.pl +++ a/serials/checkexpiration.pl @@ -44,11 +44,11 @@ The date to filter on. use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Serials; # GetExpirationDate -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( SearchSubscriptions GetExpirationDate ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use DateTime; --- a/serials/claims.pl +++ a/serials/claims.pl @@ -19,13 +19,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Serials; -use C4::Acquisition; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( GetSuppliersWithLateIssues GetLateOrMissingIssues updateClaim can_claim_subscription ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Letters; -use C4::Koha qw( GetAuthorisedValues ); +use C4::Letters qw( GetLetters SendAlerts ); use Koha::AdditionalFields; use Koha::CsvProfiles; --- a/serials/create-numberpattern.pl +++ a/serials/create-numberpattern.pl @@ -20,9 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Serials::Numberpattern; -use C4::Auth qw/check_cookie_auth/; -use URI::Escape; +use C4::Serials::Numberpattern qw( + AddSubscriptionNumberpattern + ModSubscriptionNumberpattern +); +use C4::Auth qw( check_cookie_auth ); my $input = CGI->new; --- a/serials/lateissues-export.pl +++ a/serials/lateissues-export.pl @@ -18,8 +18,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth; -use C4::Serials; -use C4::Acquisition; +use C4::Serials qw( GetLateOrMissingIssues updateClaim ); use C4::Output; use C4::Context; --- a/serials/routing-preview.pl +++ a/serials/routing-preview.pl @@ -21,16 +21,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Koha; -use C4::Auth; -use C4::Output; -use C4::Acquisition; -use C4::Reserves; -use C4::Circulation; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Reserves qw( AddReserve ModReserve ); use C4::Context; -use C4::Members; -use C4::Biblio; -use C4::Items; -use C4::Serials; +use C4::Items qw( GetItemsInfo ); +use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing ); use URI::Escape; use Koha::Biblios; --- a/serials/routing.pl +++ a/serials/routing.pl @@ -28,14 +28,11 @@ printed out use Modern::Perl; use CGI qw ( -utf8 ); use C4::Koha; -use C4::Auth; -use C4::Output; -use C4::Acquisition; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Context; -use C4::Members; -use C4::Serials; +use C4::Serials qw( GetSubscription delroutingmember addroutingmember getroutinglist GetSerials GetLatestSerials check_routing ); use Koha::Patrons; use URI::Escape; --- a/serials/serials-collection.pl +++ a/serials/serials-collection.pl @@ -21,17 +21,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Serials; -use C4::Letters; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Serials qw( ModSerialStatus GetSubscription GetNextExpected GetNextSeq GetNextDate NewIssue HasSubscriptionExpired abouttoexpire check_routing GetFullSubscription PrepareSerialsData CountSubscriptionFromBiblionumber GetSubscriptionsFromBiblionumber GetFullSubscriptionsFromBiblionumber ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Context; use Koha::Serial::Items; use Koha::DateUtils qw( dt_from_string ); -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); my $query = CGI->new; --- a/serials/serials-edit.pl +++ a/serials/serials-edit.pl @@ -63,21 +63,20 @@ op can be : use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw( decode is_utf8 ); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Output; +use Encode; +use C4::Auth qw( get_template_and_user haspermission ); +use C4::Biblio qw( GetMarcFromKohaField TransformHtmlToXml ); +use C4::Items qw( AddItemFromMarc ModItemFromMarc PrepareItemrecordDisplay ); +use C4::Output qw( output_html_with_http_headers ); use C4::Context; -use C4::Serials; -use C4::Search qw/enabled_staff_search_views/; +use C4::Serials qw( GetSerials GetSerials2 GetSerialInformation HasSubscriptionExpired GetSubscription abouttoexpire NewIssue ModSerialStatus GetPreviousSerialid AddItem2Serial ); +use C4::Search qw( enabled_staff_search_views ); -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Items; use Koha::Serial::Items; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); my $query = CGI->new(); my $dbh = C4::Context->dbh; --- a/serials/serials-home.pl +++ a/serials/serials-home.pl @@ -30,9 +30,9 @@ this script is the main page for serials/ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Serials; my $query = CGI->new; --- a/serials/serials-search.pl +++ a/serials/serials-search.pl @@ -30,14 +30,13 @@ this script is the search page for serials use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Koha qw( GetAuthorisedValues ); -use C4::Output; -use C4::Serials; +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( CloseSubscription ReopenSubscription SearchSubscriptions check_routing ); use Koha::AdditionalFields; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::SharedContent; my $query = CGI->new; --- a/serials/showpredictionpattern.pl +++ a/serials/showpredictionpattern.pl @@ -31,12 +31,12 @@ publication date, based on frequency and first publication date. use Modern::Perl; use CGI qw ( -utf8 ); -use Date::Calc qw(Today Day_of_Year Week_of_Year Day_of_Week Days_in_Year Delta_Days Add_Delta_Days Add_Delta_YM); -use C4::Auth; -use C4::Output; -use C4::Serials; +use Date::Calc qw( Add_Delta_Days Add_Delta_YM Day_of_Week Delta_Days ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( GetSubscription GetFictiveIssueNumber GetSeq GetSubscriptionIrregularities GetNextDate GetNextSeq ); use C4::Serials::Frequency; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { --- a/serials/subscription-add.pl +++ a/serials/subscription-add.pl @@ -18,22 +18,21 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Date::Calc qw(Today Day_of_Year Week_of_Year Add_Delta_Days Add_Delta_YM); -use C4::Koha; -use C4::Biblio; -use C4::Auth; -use C4::Acquisition; -use C4::Output; +use Date::Calc qw( Add_Delta_Days Add_Delta_YM ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Context; -use C4::Serials; +use C4::Serials qw( GetSubscription GetNextExpected GetSerials GetSubscriptionLength NewSubscription ModNextExpected ModSubscription ); use C4::Serials::Frequency; use C4::Serials::Numberpattern; -use C4::Letters; +use C4::Letters qw( GetLetters ); use Koha::AdditionalFields; use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::ItemTypes; -use Carp; +use Carp qw( carp ); use Koha::Subscription::Numberpattern; use Koha::Subscription::Frequency; --- a/serials/subscription-batchedit.pl +++ a/serials/subscription-batchedit.pl @@ -21,13 +21,13 @@ use Modern::Perl; use CGI qw( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Serials; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( can_edit_subscription ); use Koha::Subscriptions; use Koha::Acquisition::Booksellers; use Koha::AdditionalFields; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); my $cgi = CGI->new; --- a/serials/subscription-bib-search.pl +++ a/serials/subscription-bib-search.pl @@ -49,12 +49,12 @@ to multipage gestion. use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Koha; -use C4::Auth; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Search; -use C4::Biblio; +use C4::Output qw( output_html_with_http_headers ); +use C4::Search qw( new_record_from_zebra ); +use C4::Biblio qw( TransformMarcToKoha ); use Koha::ItemTypes; use Koha::SearchEngine; --- a/serials/subscription-detail.pl +++ a/serials/subscription-detail.pl @@ -17,23 +17,19 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Acquisition; -use C4::Auth; -use C4::Budgets; -use C4::Koha; -use C4::Serials; -use C4::Output; +use C4::Auth qw( get_template_and_user checkauth ); +use C4::Serials qw( CloseSubscription ReopenSubscription GetSubscription GetExpirationDate GetSerials HasSubscriptionStrictlyExpired CountIssues HasItems DelSubscription check_routing abouttoexpire can_edit_subscription ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Context; -use C4::Search qw/enabled_staff_search_views/; +use C4::Search qw( enabled_staff_search_views ); use Koha::AdditionalFields; use Koha::AuthorisedValues; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); use Koha::Acquisition::Bookseller; use Koha::Subscriptions; -use Date::Calc qw/Today Day_of_Year Week_of_Year Add_Delta_Days/; -use Carp; +use Carp qw( carp ); use Koha::SharedContent; --- a/serials/subscription-frequencies.pl +++ a/serials/subscription-frequencies.pl @@ -31,9 +31,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Serials; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( GetSubscription ModSubscription DelSubscription ); use C4::Serials::Frequency; my $input = CGI->new; --- a/serials/subscription-frequency.pl +++ a/serials/subscription-frequency.pl @@ -20,8 +20,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Serials::Frequency; -use C4::Auth qw/check_cookie_auth/; +use C4::Serials::Frequency qw( GetSubscriptionFrequency ); +use C4::Auth qw( check_cookie_auth ); use JSON qw( to_json ); my $input=CGI->new; --- a/serials/subscription-history.pl +++ a/serials/subscription-history.pl @@ -30,13 +30,12 @@ Modify subscription history use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); -use C4::Biblio; -use C4::Serials; +use C4::Serials qw( ModSubscriptionHistory ModSubscription GetSubscriptionHistoryFromSubscriptionId GetSubscription ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( output_pref ); my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { --- a/serials/subscription-numberpattern.pl +++ a/serials/subscription-numberpattern.pl @@ -19,8 +19,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Serials::Numberpattern; -use C4::Auth qw/check_cookie_auth/; +use C4::Serials::Numberpattern qw( GetSubscriptionNumberpattern ); +use C4::Auth qw( check_cookie_auth ); use JSON qw( to_json ); my $input=CGI->new; --- a/serials/subscription-numberpatterns.pl +++ a/serials/subscription-numberpatterns.pl @@ -30,10 +30,18 @@ Manage numbering patterns use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Serials::Numberpattern; -use C4::Serials::Frequency; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials::Numberpattern qw( + AddSubscriptionNumberpattern + DelSubscriptionNumberpattern + GetSubscriptionNumberpattern + GetSubscriptionNumberpatternByName + GetSubscriptionNumberpatterns + GetSubscriptionsWithNumberpattern + ModSubscriptionNumberpattern +); +use C4::Serials::Frequency qw( GetSubscriptionFrequencies ); my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { --- a/serials/subscription-renew.pl +++ a/serials/subscription-renew.pl @@ -46,14 +46,14 @@ Id of the subscription this script has to renew use Modern::Perl; use CGI qw ( -utf8 ); -use Carp; +use Carp qw( carp ); use C4::Koha; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Serials; -use Koha::DateUtils; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); +use C4::Serials qw( GetSubscription GetSubscriptionLength NewSubscription ReNewSubscription ); +use Koha::DateUtils qw( dt_from_string output_pref ); my $query = CGI->new; my $dbh = C4::Context->dbh; --- a/serials/viewalerts.pl +++ a/serials/viewalerts.pl @@ -20,9 +20,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Subscriptions; --- a/services/itemrecorddisplay.pl +++ a/services/itemrecorddisplay.pl @@ -30,9 +30,9 @@ It uses PrepareItemrecordDisplay use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Items qw( PrepareItemrecordDisplay ); my $input = CGI->new; my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { --- a/suggestion/add_user_search.pl +++ a/suggestion/add_user_search.pl @@ -18,8 +18,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Members; use Koha::Patron::Categories; --- a/suggestion/suggestion.pl +++ a/suggestion/suggestion.pl @@ -20,12 +20,12 @@ use Modern::Perl; require Exporter; use CGI qw ( -utf8 ); -use C4::Auth; # get_template_and_user -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Suggestions; -use C4::Koha; -use C4::Budgets; -use C4::Search; +use C4::Koha qw( GetAuthorisedValues ); +use C4::Budgets qw( GetBudget GetBudgets GetBudgetHierarchy CanUserUseBudget ); +use C4::Search qw( FindDuplicate GetDistinctValues ); use C4::Members; use Koha::DateUtils qw( dt_from_string ); use Koha::AuthorisedValues; @@ -33,7 +33,7 @@ use Koha::Acquisition::Currencies; use Koha::Libraries; use Koha::Patrons; -use URI::Escape; +use URI::Escape qw( uri_escape ); sub Init{ my $suggestion= shift @_; --- a/svc/authorised_values +++ a/svc/authorised_values @@ -23,7 +23,6 @@ use JSON qw( to_json ); use CGI; use C4::Service; use C4::Auth qw( check_cookie_auth ); -use C4::Output qw(:DEFAULT :ajax); use Koha::AuthorisedValues; =head1 NAME --- a/svc/cataloguing/automatic_linker.pl +++ a/svc/cataloguing/automatic_linker.pl @@ -19,9 +19,9 @@ use Modern::Perl; use CGI; -use JSON; -use C4::Auth qw(check_cookie_auth); -use C4::Biblio; +use JSON qw( to_json ); +use C4::Auth qw( check_cookie_auth ); +use C4::Biblio qw( BiblioAutoLink TransformHtmlToMarc ); use C4::Context; my $input = CGI->new; --- a/svc/checkout_notes +++ a/svc/checkout_notes @@ -22,8 +22,8 @@ use Modern::Perl; use JSON qw( to_json ); use CGI; use C4::Service; -use C4::Auth qw /check_cookie_auth/; -use C4::Output qw(:DEFAULT :ajax); +use C4::Auth qw ( check_cookie_auth ); +use C4::Output qw( is_ajax output_with_http_headers ); use Koha::Checkouts; =head1 NAME --- a/svc/creator_batches +++ a/svc/creator_batches @@ -23,8 +23,8 @@ use JSON qw( encode_json ); use CGI; use C4::Service; use C4::Context; -use C4::Auth qw /check_cookie_auth/; -use C4::Output qw(:DEFAULT :ajax); +use C4::Auth qw( check_cookie_auth ); +use C4::Output qw( is_ajax output_with_http_headers ); use C4::Patroncards::Batch; use C4::Labels::Batch; --- a/svc/problem_reports +++ a/svc/problem_reports @@ -22,8 +22,8 @@ use Modern::Perl; use JSON qw( to_json ); use CGI; use C4::Service; -use C4::Auth qw /check_cookie_auth/; -use C4::Output qw(:DEFAULT :ajax); +use C4::Auth qw( check_cookie_auth ); +use C4::Output qw( is_ajax output_with_http_headers ); use Koha::ProblemReports; =head1 NAME --- a/t/Acquisition/CanUserManageBasket.t +++ a/t/Acquisition/CanUserManageBasket.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 43; -use C4::Acquisition; +use C4::Acquisition qw( GetBasket GetBasketUsers CanUserManageBasket ); # Avoid "redefined subroutine" warnings local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /redefined/ }; --- a/t/Auth.t +++ a/t/Auth.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 12; use Test::Warn; -use C4::Auth qw / in_iprange /; +use C4::Auth qw( in_iprange ); $ENV{REMOTE_ADDR} = '192.168.1.30'; --- a/t/Auth_with_shibboleth.t +++ a/t/Auth_with_shibboleth.t @@ -94,7 +94,7 @@ $database->mock( 'schema', \&mockedSchema ); my $logger = t::lib::Mocks::Logger->new(); # Can module load -use C4::Auth_with_shibboleth; +use C4::Auth_with_shibboleth qw( shib_ok login_shib_url get_login_shib checkpw_shib ); require_ok('C4::Auth_with_shibboleth'); # Subroutine tests --- a/t/AuthoritiesMarc_MARC21.t +++ a/t/AuthoritiesMarc_MARC21.t @@ -10,7 +10,7 @@ use Test::More tests => 4; use MARC::Record; BEGIN { - use_ok('C4::AuthoritiesMarc::MARC21'); + use_ok('C4::AuthoritiesMarc::MARC21', qw( default_auth_type_location fix_marc21_auth_type_location )); } my @result = C4::AuthoritiesMarc::MARC21::default_auth_type_location(); --- a/t/AuthoritiesMarc_UNIMARC.t +++ a/t/AuthoritiesMarc_UNIMARC.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 2; BEGIN { - use_ok('C4::AuthoritiesMarc::UNIMARC'); + use_ok('C4::AuthoritiesMarc::UNIMARC', qw( default_auth_type_location )); } my @test = C4::AuthoritiesMarc::UNIMARC::default_auth_type_location(); --- a/t/Biblio.t +++ a/t/Biblio.t @@ -23,7 +23,8 @@ use Test::Warn; plan tests => 39; -use_ok('C4::Biblio'); + +use_ok('C4::Biblio', qw( AddBiblio ModBiblio BiblioAutoLink LinkBibHeadingsToAuthorities GetMarcPrice GetMarcQuantity GetMarcControlnumber GetMarcISBN GetMarcISSN GetMarcSubjects GetMarcAuthors GetMarcUrls GetMarcSeries TransformMarcToKoha ModBiblioMarc RemoveAllNsb GetMarcBiblio UpdateTotalIssues )); my $db = Test::MockModule->new('Koha::Database'); $db->mock( _new_schema => sub { return Schema(); } ); --- a/t/Biblio/TransformHtmlToXml.t +++ a/t/Biblio/TransformHtmlToXml.t @@ -22,7 +22,7 @@ use t::lib::Mocks; use XML::Simple; -use C4::Biblio qw/TransformHtmlToXml/; +use C4::Biblio qw( TransformHtmlToXml ); sub run_tests { --- a/t/Biblio2.t +++ a/t/Biblio2.t @@ -6,7 +6,7 @@ use Test::MockModule; use MARC::Record; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField ); subtest "_koha_marc_update_bib_ids basic Field", \&_koha_marc_update_bib_ids_simple; sub _koha_marc_update_bib_ids_simple { --- a/t/Budgets/CanUserModifyBudget.t +++ a/t/Budgets/CanUserModifyBudget.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 134; -use C4::Budgets; +use C4::Budgets qw( GetBudget GetBudgetUsers CanUserModifyBudget ); use t::lib::Mocks; # Avoid "redefined subroutine" warnings --- a/t/Budgets/CanUserUseBudget.t +++ a/t/Budgets/CanUserUseBudget.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 70; -use C4::Budgets; +use C4::Budgets qw( GetBudget GetBudgetUsers CanUserUseBudget ); use t::lib::Mocks; # Avoid "redefined subroutine" warnings --- a/t/Charset.t +++ a/t/Charset.t @@ -26,7 +26,7 @@ use utf8; use open ':std', ':encoding(utf8)'; BEGIN { - use_ok('C4::Charset'); + use_ok('C4::Charset', qw( NormalizeString SetUTF8Flag IsStringUTF8ish nsb_clean )); } my $string; --- a/t/Circulation/AgeRestrictionMarkers.t +++ a/t/Circulation/AgeRestrictionMarkers.t @@ -27,7 +27,7 @@ use Test::Warn; use t::lib::Mocks; -use C4::Circulation; +use C4::Circulation qw( GetAgeRestriction ); t::lib::Mocks::mock_preference( 'AgeRestrictionMarker', 'FSK|PEGI|Age|K' ); --- a/t/Circulation_barcodedecode.t +++ a/t/Circulation_barcodedecode.t @@ -22,7 +22,7 @@ use Test::More tests => 26; use C4::Context; use t::lib::Mocks; -use_ok( 'C4::Circulation' ); +use_ok('C4::Circulation', qw( barcodedecode )); t::lib::Mocks::mock_userenv({ branchcode => 'IMS' }); --- a/t/ClassSortRoutine_Dewey.t +++ a/t/ClassSortRoutine_Dewey.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 10; BEGIN { - use_ok('C4::ClassSortRoutine::Dewey'); + use_ok('C4::ClassSortRoutine::Dewey', qw( get_class_sort_key )); } my $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key(undef, undef ); --- a/t/ClassSortRoutine_Generic.t +++ a/t/ClassSortRoutine_Generic.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 3; BEGIN { - use_ok('C4::ClassSortRoutine::Generic'); + use_ok('C4::ClassSortRoutine::Generic', qw( get_class_sort_key )); } my $cn_class = "My class "; --- a/t/ClassSortRoutine_LCC.t +++ a/t/ClassSortRoutine_LCC.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 10; BEGIN { - use_ok('C4::ClassSortRoutine::LCC'); + use_ok('C4::ClassSortRoutine::LCC', qw( get_class_sort_key )); } #Obvious cases --- a/t/Creators.t +++ a/t/Creators.t @@ -18,7 +18,7 @@ use Test::More tests => 41; BEGIN { use_ok('C4::Creators'); - use_ok('C4::Creators::PDF'); + use_ok('C4::Creators::PDF', qw( Init Add Bookmark Compress Font FontSize Page StrWidth Text End )); } my $pdf_creator = C4::Creators::PDF->new(InitVars => 0); --- a/t/External/BakerTaylor.t +++ a/t/External/BakerTaylor.t @@ -8,7 +8,7 @@ use Test::More tests => 9; use t::lib::Mocks; BEGIN { - use_ok('C4::External::BakerTaylor'); + use_ok('C4::External::BakerTaylor', qw( link_url image_url content_cafe_url http_jacket_link availability )); } # test with mocked prefs --- a/t/ImportBatch.t +++ a/t/ImportBatch.t @@ -25,7 +25,7 @@ use Test::More tests => 3; use t::lib::Mocks; BEGIN { - use_ok('C4::ImportBatch'); + use_ok('C4::ImportBatch', qw( RecordsFromISO2709File RecordsFromMARCXMLFile )); } t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); --- a/t/Koha.t +++ a/t/Koha.t @@ -31,7 +31,7 @@ BEGIN { } } -use_ok('C4::Koha'); +use_ok('C4::Koha', qw( xml_escape GetVariationsOfISBN GetVariationsOfISBNs GetVariationsOfISSN GetVariationsOfISSNs)); use Test::DBIx::Class; --- a/t/Koha/Util/MARC.t +++ a/t/Koha/Util/MARC.t @@ -18,6 +18,7 @@ use Modern::Perl; use Test::More tests => 2; +use MARC::Record; BEGIN { use_ok('Koha::Util::MARC'); } --- a/t/Koha/sleep.pl +++ a/t/Koha/sleep.pl @@ -3,8 +3,6 @@ use Modern::Perl; use Koha::Script; -use Fcntl qw(:flock); -use Try::Tiny; # # Lock execution my $script = Koha::Script->new({ script => 'sleep.pl' }); --- a/t/Koha/wait.pl +++ a/t/Koha/wait.pl @@ -3,8 +3,6 @@ use Modern::Perl; use Koha::Script; -use Fcntl qw(:flock); -use Try::Tiny; # # Lock execution my $script = Koha::Script->new({ script => 'sleep.pl' }); --- a/t/Koha_Util_MARC.t +++ a/t/Koha_Util_MARC.t @@ -24,6 +24,7 @@ use strict; use warnings; use Test::More tests => 4; +use MARC::Record; BEGIN { use_ok('Koha::Util::MARC'); --- a/t/Labels.t +++ a/t/Labels.t @@ -20,11 +20,11 @@ use strict; use warnings; -use C4::ClassSplitRoutine::LCC; +use C4::ClassSplitRoutine::LCC qw( split_callnumber ); use Test::More tests => 11; BEGIN { - use_ok('C4::Labels::Label'); + use_ok('C4::Labels::Label', qw( _get_text_fields _check_params _guide_box )); } my $format_string = "title, callnumber"; --- a/t/Labels_split_Regex.t +++ a/t/Labels_split_Regex.t @@ -18,7 +18,7 @@ use Modern::Perl; use Test::More tests => 5; -use C4::ClassSplitRoutine::RegEx; +use C4::ClassSplitRoutine::RegEx qw( split_callnumber ); my $callnumbers = { '830 Han' => [qw{830 Han}], --- a/t/Labels_split_ddcn.t +++ a/t/Labels_split_ddcn.t @@ -42,7 +42,7 @@ BEGIN { $test_num += 4; } plan tests => $test_num; - use_ok('C4::ClassSplitRoutine::Dewey'); + use_ok('C4::ClassSplitRoutine::Dewey', qw( split_callnumber )); use vars qw($ddcns); } --- a/t/Labels_split_lccn.t +++ a/t/Labels_split_lccn.t @@ -20,7 +20,7 @@ use strict; use warnings; -use C4::ClassSplitRoutine::LCC; +use C4::ClassSplitRoutine::LCC qw( split_callnumber ); use Test::More; BEGIN { --- a/t/Languages.t +++ a/t/Languages.t @@ -24,7 +24,7 @@ use CGI qw ( -utf8 ); use Koha::Cache::Memory::Lite; BEGIN { - use_ok('C4::Languages'); + use_ok('C4::Languages', qw( getlanguage )); } my @languages = (); # stores the list of active languages --- a/t/Letters.t +++ a/t/Letters.t @@ -44,7 +44,7 @@ fixtures_ok [ my $db = Test::MockModule->new('Koha::Database'); $db->mock( _new_schema => sub { return Schema(); } ); -use_ok('C4::Letters'); +use_ok('C4::Letters', qw( GetLetters )); t::lib::Mocks::mock_preference('dateformat', 'metric'); --- a/t/Matcher.t +++ a/t/Matcher.t @@ -38,7 +38,7 @@ use Test::DBIx::Class; my $db = Test::MockModule->new('Koha::Database'); $db->mock( _new_schema => sub { return Schema(); } ); -use_ok('C4::Matcher'); +use_ok('C4::Matcher', qw( GetMatcherList GetMatcherId )); fixtures_ok [ MarcMatcher => [ --- a/t/Members/cardnumber.t +++ a/t/Members/cardnumber.t @@ -7,7 +7,7 @@ use Test::MockModule; use t::lib::Mocks; -use_ok('C4::Members'); +use_ok('C4::Members', qw( get_cardnumber_length checkcardnumber )); BEGIN { if ( check_install( module => 'Test::DBIx::Class' ) ) { --- a/t/Output.t +++ a/t/Output.t @@ -24,7 +24,7 @@ use CGI qw ( -utf8 ); use t::lib::Mocks; BEGIN { - use_ok('C4::Output'); + use_ok('C4::Output', qw( output_html_with_http_headers parametrized_url )); } my $query = CGI->new(); --- a/t/Prices.t +++ a/t/Prices.t @@ -14,7 +14,7 @@ BEGIN { } } -use_ok('C4::Acquisition'); +use_ok('C4::Acquisition', qw( populate_order_with_prices )); use_ok('C4::Context'); use_ok('Koha::Number::Price'); --- a/t/SIP/Sip.t +++ a/t/SIP/Sip.t @@ -21,7 +21,7 @@ use Test::More tests => 9; use Test::Warn; BEGIN { - use_ok('C4::SIP::Sip'); + use_ok('C4::SIP::Sip', qw( timestamp )); } my $date_time = C4::SIP::Sip::timestamp(); --- a/t/SMS.t +++ a/t/SMS.t @@ -22,7 +22,7 @@ use t::lib::Mocks; use Test::More tests => 7; BEGIN { - use_ok('C4::SMS'); + use_ok('C4::SMS', qw( driver send_sms )); } --- a/t/Scheduler.t +++ a/t/Scheduler.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 6; BEGIN { - use_ok('C4::Scheduler'); + use_ok('C4::Scheduler', qw( get_jobs get_at_jobs get_at_job add_at_job remove_at_job )); } ok(C4::Scheduler::get_jobs(), "testing get_jobs with no arguments"); --- a/t/Scrubber.t +++ a/t/Scrubber.t @@ -8,9 +8,9 @@ use Test::More tests => 29; use Test::Warn; BEGIN { - use FindBin; - use lib $FindBin::Bin; - use_ok('C4::Scrubber'); + use FindBin; + use lib $FindBin::Bin; + use_ok('C4::Scrubber'); } sub pretty_line { --- a/t/Search/History.t +++ a/t/Search/History.t @@ -7,7 +7,7 @@ use URI::Escape; use JSON qw( decode_json ); use_ok('Koha::DateUtils'); -use_ok('C4::Search::History'); +use_ok('C4::Search::History', qw( get get_from_session set_to_session delete )); use_ok('C4::Auth', qw/get_session/ ); # Test session --- a/t/Search/buildQuery.t +++ a/t/Search/buildQuery.t @@ -33,7 +33,7 @@ BEGIN { # Mock the DB connection and C4::Context use Test::DBIx::Class; -use_ok('C4::Search'); +use_ok('C4::Search', qw( buildQuery )); can_ok('C4::Search', qw/buildQuery/); use_ok("Net::Z3950::ZOOM"); --- a/t/Serials/GetNextSeq.t +++ a/t/Serials/GetNextSeq.t @@ -2,7 +2,7 @@ use Modern::Perl; use Test::More tests => 43; -use C4::Serials; +use C4::Serials qw( GetNextSeq ); # TEST CASE 1 - 1 variable, from 1 to 4 my $subscription = { --- a/t/Serials/ModSerialStatus.t +++ a/t/Serials/ModSerialStatus.t @@ -24,7 +24,7 @@ use Data::Dumper qw/Dumper/; use Test::More tests => 8; -use C4::Serials qw//; +use C4::Serials; # Testing C4::Serials::_handle_seqno my $list = '2017 (No. 8); 2017 (No. 9); 2017 (No. 10)'; --- a/t/SimpleMARC.t +++ a/t/SimpleMARC.t @@ -4,7 +4,7 @@ use Test::More tests => 11; use_ok("MARC::Field"); use_ok("MARC::Record"); -use_ok("Koha::SimpleMARC"); +use_ok("Koha::SimpleMARC", qw( field_exists read_field update_field copy_field copy_and_replace_field move_field delete_field field_equals )); sub new_record { my $record = MARC::Record->new; --- a/t/SocialData.t +++ a/t/SocialData.t @@ -31,7 +31,7 @@ BEGIN { } BEGIN { - use_ok('C4::SocialData'); + use_ok('C4::SocialData', qw( get_data get_report )); } use Test::DBIx::Class; --- a/t/TmplToken.t +++ a/t/TmplToken.t @@ -5,7 +5,6 @@ use strict; use warnings; -use C4::TmplTokenType; use Test::More tests => 19; BEGIN { --- a/t/db_dependent/Accounts.t +++ a/t/db_dependent/Accounts.t @@ -37,7 +37,7 @@ use Koha::DateUtils qw( dt_from_string ); use C4::Circulation qw( MarkIssueReturned ); BEGIN { - use_ok('C4::Accounts'); + use_ok('C4::Accounts', qw( chargelostitem purge_zero_balance_fees )); use_ok('Koha::Object'); use_ok('Koha::Patron'); use_ok('Data::Dumper'); --- a/t/db_dependent/Acquisition.t +++ a/t/db_dependent/Acquisition.t @@ -28,9 +28,9 @@ use Koha::Acquisition::Basket; use MARC::File::XML ( BinaryEncoding => 'utf8', RecordFormat => 'MARC21' ); BEGIN { - use_ok('C4::Acquisition'); - use_ok('C4::Biblio'); - use_ok('C4::Budgets'); + use_ok('C4::Acquisition', qw( NewBasket GetBasket AddInvoice GetInvoice ModReceiveOrder SearchOrders GetOrder GetHistory ModOrder get_rounding_sql get_rounded_price ReopenBasket ModBasket ModBasketHeader ModBasketUsers )); + use_ok('C4::Biblio', qw( AddBiblio GetMarcSubfieldStructure )); + use_ok('C4::Budgets', qw( AddBudgetPeriod AddBudget GetBudget GetBudgetByOrderNumber GetBudgetsReport GetBudgets GetBudgetReport )); use_ok('Koha::Acquisition::Orders'); use_ok('Koha::Acquisition::Booksellers'); use_ok('t::lib::TestBuilder'); --- a/t/db_dependent/Acquisition/CancelReceipt.t +++ a/t/db_dependent/Acquisition/CancelReceipt.t @@ -21,10 +21,10 @@ use Test::More tests => 12; use t::lib::TestBuilder; use C4::Context; -use C4::Acquisition; -use C4::Biblio; +use C4::Acquisition qw( NewBasket ModReceiveOrder CancelReceipt ); +use C4::Biblio qw( AddBiblio ); use C4::Items; -use C4::Budgets; +use C4::Budgets qw( AddBudget GetBudget ); use t::lib::Mocks; use Koha::Database; --- a/t/db_dependent/Acquisition/GetBasketAsCSV.t +++ a/t/db_dependent/Acquisition/GetBasketAsCSV.t @@ -6,8 +6,8 @@ use CGI; use Test::More tests => 4; -use C4::Acquisition; -use C4::Biblio; +use C4::Acquisition qw( NewBasket GetBasket GetBasketAsCSV ); +use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::CsvProfiles; use Koha::Acquisition::Orders; --- a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t +++ a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t @@ -4,9 +4,9 @@ use Modern::Perl; use Test::More tests => 43; use Data::Dumper; -use C4::Acquisition qw( NewBasket GetBasketsInfosByBookseller ); +use C4::Acquisition qw( NewBasket GetBasket GetBasketsInfosByBookseller ReopenBasket AddInvoice GetInvoice ModReceiveOrder ); use C4::Biblio qw( AddBiblio ); -use C4::Budgets qw( AddBudget ); +use C4::Budgets qw( AddBudget GetBudget ); use C4::Context; use Koha::Database; use Koha::Acquisition::Orders; --- a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t +++ a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t @@ -3,9 +3,9 @@ use Modern::Perl; use Test::More; -use C4::Acquisition; -use C4::Biblio; -use C4::Budgets; +use C4::Acquisition qw( NewBasket GetOrders GetOrdersByBiblionumber GetOrder ); +use C4::Biblio qw( AddBiblio ); +use C4::Budgets qw( AddBudget GetBudget ); use Koha::Database; use Koha::Acquisition::Orders; --- a/t/db_dependent/Acquisition/Invoices.t +++ a/t/db_dependent/Acquisition/Invoices.t @@ -11,7 +11,7 @@ use Koha::Database; use Test::More tests => 24; BEGIN { - use_ok('C4::Acquisition'); + use_ok('C4::Acquisition', qw( NewBasket GetBasket AddInvoice GetInvoice ModReceiveOrder GetInvoiceDetails GetInvoices ModInvoice CloseInvoice ReopenInvoice MergeInvoices DelInvoice )); } my $schema = Koha::Database->new()->schema(); --- a/t/db_dependent/Acquisition/NewOrder.t +++ a/t/db_dependent/Acquisition/NewOrder.t @@ -3,9 +3,9 @@ use Modern::Perl; use Test::More tests => 8; -use C4::Acquisition; -use C4::Biblio; -use C4::Budgets; +use C4::Acquisition qw( NewBasket ); +use C4::Biblio qw( AddBiblio ); +use C4::Budgets qw( AddBudget GetBudget ); use MARC::Record; use Koha::Database; use Koha::DateUtils qw( dt_from_string output_pref ); --- a/t/db_dependent/Acquisition/OrderFromSubscription.t +++ a/t/db_dependent/Acquisition/OrderFromSubscription.t @@ -4,10 +4,10 @@ use Test::More tests => 12; use t::lib::TestBuilder; -use_ok('C4::Acquisition'); -use_ok('C4::Biblio'); -use_ok('C4::Budgets'); -use_ok('C4::Serials'); +use_ok('C4::Acquisition', qw( NewBasket AddInvoice GetInvoice ModReceiveOrder GetInvoices )); +use_ok('C4::Biblio', qw( AddBiblio )); +use_ok('C4::Budgets', qw( AddBudgetPeriod AddBudget )); +use_ok('C4::Serials', qw( NewSubscription GetSubscription subscriptionCurrentlyOnOrder )); use Koha::Acquisition::Orders; use Koha::Database; --- a/t/db_dependent/Acquisition/OrderUsers.t +++ a/t/db_dependent/Acquisition/OrderUsers.t @@ -1,9 +1,9 @@ use Modern::Perl; use Test::More tests => 3; -use C4::Acquisition; -use C4::Biblio; -use C4::Letters; +use C4::Acquisition qw( NewBasket AddInvoice ModOrder ModOrderUsers GetOrder GetOrderUsers ModReceiveOrder ); +use C4::Biblio qw( AddBiblio ); +use C4::Letters qw( GetQueuedMessages ); use Koha::Database; use Koha::Acquisition::Booksellers; use Koha::Acquisition::Orders; --- a/t/db_dependent/Acquisition/StandingOrders.t +++ a/t/db_dependent/Acquisition/StandingOrders.t @@ -4,8 +4,8 @@ use Modern::Perl; use Test::More tests => 14; use C4::Context; -use C4::Acquisition; -use C4::Biblio; +use C4::Acquisition qw( NewBasket GetBasket SearchOrders AddInvoice ModReceiveOrder CancelReceipt ); +use C4::Biblio qw( AddBiblio ); use C4::Items; use C4::Budgets; use Koha::Acquisition::Orders; --- a/t/db_dependent/Acquisition/TransferOrder.t +++ a/t/db_dependent/Acquisition/TransferOrder.t @@ -4,10 +4,10 @@ use Modern::Perl; use Test::More tests => 13; use C4::Context; -use C4::Acquisition; +use C4::Acquisition qw( NewBasket GetOrders GetOrder TransferOrder SearchOrders ModReceiveOrder CancelReceipt ); use C4::Biblio; use C4::Items; -use C4::Budgets; +use C4::Budgets qw( AddBudget GetBudget ); use Koha::Database; use Koha::DateUtils; use Koha::Acquisition::Booksellers; --- a/t/db_dependent/Acquisition/close_reopen_basket.t +++ a/t/db_dependent/Acquisition/close_reopen_basket.t @@ -3,9 +3,9 @@ use Modern::Perl; use Test::More tests => 14; -use C4::Acquisition; -use C4::Biblio qw( AddBiblio DelBiblio ); -use C4::Budgets; +use C4::Acquisition qw( NewBasket GetBiblioCountByBasketno GetOrders GetOrder ReopenBasket ); +use C4::Biblio qw( AddBiblio ); +use C4::Budgets qw( AddBudget GetBudget ); use C4::Context; use Koha::Database; use Koha::Acquisition::Booksellers; --- a/t/db_dependent/Acquisition/populate_order_with_prices.t +++ a/t/db_dependent/Acquisition/populate_order_with_prices.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 44; -use C4::Acquisition; +use C4::Acquisition qw( populate_order_with_prices ); use C4::Context; use Koha::Database; use t::lib::TestBuilder; --- a/t/db_dependent/Amazon.t +++ a/t/db_dependent/Amazon.t @@ -11,7 +11,7 @@ use t::lib::Mocks; use C4::Context; BEGIN { - use_ok('C4::External::Amazon'); + use_ok('C4::External::Amazon', qw( get_amazon_tld )); } my $context = C4::Context->new(); --- a/t/db_dependent/Auth.t +++ a/t/db_dependent/Auth.t @@ -15,14 +15,13 @@ use Test::Warn; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Auth qw(checkpw); use C4::Members; use Koha::AuthUtils qw/hash_password/; use Koha::Database; use Koha::Patrons; BEGIN { - use_ok('C4::Auth'); + use_ok('C4::Auth', qw( checkauth haspermission track_login_daily checkpw get_template_and_user checkpw_hash )); } my $schema = Koha::Database->schema; --- a/t/db_dependent/Auth/haspermission.t +++ a/t/db_dependent/Auth/haspermission.t @@ -25,7 +25,7 @@ use Test::Exception; use Koha::Database; use t::lib::TestBuilder; -use C4::Auth qw(haspermission); +use C4::Auth qw( haspermission ); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; --- a/t/db_dependent/Auth_with_cas.t +++ a/t/db_dependent/Auth_with_cas.t @@ -28,7 +28,7 @@ use C4::Context; use Koha::Database; BEGIN { - use_ok('C4::Auth_with_cas'); + use_ok('C4::Auth_with_cas', qw( check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url )); can_ok('C4::Auth_with_cas', qw/ check_api_auth_cas checkpw_cas --- a/t/db_dependent/Auth_with_ldap.t +++ a/t/db_dependent/Auth_with_ldap.t @@ -120,7 +120,7 @@ $builder->build( my $patron = Koha::Patrons->find($borrower->{borrowernumber}); # C4::Auth_with_ldap needs several stuff set first ^^^ -use_ok('C4::Auth_with_ldap'); +use_ok('C4::Auth_with_ldap', qw( checkpw_ldap )); can_ok( 'C4::Auth_with_ldap', qw/ checkpw_ldap --- a/t/db_dependent/AuthoritiesMarc.t +++ a/t/db_dependent/AuthoritiesMarc.t @@ -17,7 +17,7 @@ use Koha::Database; use Koha::Authority::Types; BEGIN { - use_ok('C4::AuthoritiesMarc'); + use_ok('C4::AuthoritiesMarc', qw( GetHeaderAuthority AddAuthority AddAuthorityTrees GetAuthority BuildAuthHierarchies GenerateHierarchy BuildSummary DelAuthority CompareFieldWithAuthority ModAuthority merge )); } # We are now going to be testing the authorities hierarchy code, and --- a/t/db_dependent/Authority/Merge.t +++ a/t/db_dependent/Authority/Merge.t @@ -13,14 +13,14 @@ use Test::MockModule; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Biblio; +use C4::Biblio qw( AddBiblio GetMarcBiblio ModBiblio ); use Koha::Authorities; use Koha::Authority::ControlledIndicators; use Koha::Authority::MergeRequests; use Koha::Database; BEGIN { - use_ok('C4::AuthoritiesMarc'); + use_ok('C4::AuthoritiesMarc', qw( merge AddAuthority compare_fields DelAuthority )); } # Optionally change marc flavour --- a/t/db_dependent/BackgroundJob.t +++ a/t/db_dependent/BackgroundJob.t @@ -1,14 +1,14 @@ #!/usr/bin/perl use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_session ); use CGI qw ( -utf8 ); use Test::More tests => 18; use Koha::Database; BEGIN { - use_ok('C4::BackgroundJob'); + use_ok('C4::BackgroundJob', qw( get id fetch name invoker progress status size set finish results clear )); } my $query = CGI->new; --- a/t/db_dependent/Barcodes.t +++ a/t/db_dependent/Barcodes.t @@ -29,7 +29,7 @@ $| = 1; BEGIN { use FindBin; use lib $FindBin::Bin; - use_ok('C4::Barcodes'); + use_ok('C4::Barcodes', qw( value initial max db_max next_value next previous serial autoBarcode is_max )); } my $builder = t::lib::TestBuilder->new; --- a/t/db_dependent/Barcodes_ValueBuilder.t +++ a/t/db_dependent/Barcodes_ValueBuilder.t @@ -23,7 +23,7 @@ use t::lib::TestBuilder; use Koha::Database; BEGIN { - use_ok('C4::Barcodes::ValueBuilder'); + use_ok('C4::Barcodes::ValueBuilder', qw( get_barcode )); }; my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Biblio.t +++ a/t/db_dependent/Biblio.t @@ -30,10 +30,10 @@ use Koha::Database; use Koha::Caches; use Koha::MarcSubfieldStructures; -use C4::Linker::Default; +use C4::Linker::Default qw( get_link ); BEGIN { - use_ok('C4::Biblio'); + use_ok('C4::Biblio', qw( AddBiblio GetMarcFromKohaField BiblioAutoLink GetMarcSubfieldStructure GetMarcSubfieldStructureFromKohaField LinkBibHeadingsToAuthorities GetBiblioData GetMarcBiblio ModBiblio GetMarcISSN GetMarcControlnumber GetMarcISBN GetMarcPrice GetFrameworkCode GetMarcUrls IsMarcStructureInternal GetMarcStructure GetXmlBiblio DelBiblio )); } my $schema = Koha::Database->new->schema; @@ -472,7 +472,7 @@ sub run_tests { my $authid = $field->subfield('9'); ok($authid, 'ModBiblio adds authority id'); - use_ok('C4::AuthoritiesMarc'); + use_ok('C4::AuthoritiesMarc', qw( GetAuthority )); my $auth_record = C4::AuthoritiesMarc::GetAuthority($authid); ok($auth_record, 'Authority record successfully retrieved'); --- a/t/db_dependent/Biblio/Isbd.t +++ a/t/db_dependent/Biblio/Isbd.t @@ -25,7 +25,7 @@ use t::lib::Mocks qw( mock_preference ); use Koha::Database; BEGIN { - use_ok('C4::Biblio'); + use_ok('C4::Biblio', qw( GetISBDView )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Biblio/ModBiblioMarc.t +++ a/t/db_dependent/Biblio/ModBiblioMarc.t @@ -22,7 +22,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; use MARC::Record; -use C4::Biblio; +use C4::Biblio qw( ModBiblio ModBiblioMarc GetMarcBiblio ); use Koha::Database; my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Biblio/TransformHtmlToMarc.t +++ a/t/db_dependent/Biblio/TransformHtmlToMarc.t @@ -8,7 +8,7 @@ use Test::More tests => 2; use Koha::Caches; use Koha::Database; use Koha::MarcSubfieldStructures; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField TransformHtmlToMarc ); our ( $biblionumbertagfield, $biblionumbertagsubfield ); my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Biblio/TransformKohaToMarc.t +++ a/t/db_dependent/Biblio/TransformKohaToMarc.t @@ -8,7 +8,7 @@ use t::lib::TestBuilder; use Koha::Database; use Koha::Caches; use Koha::MarcSubfieldStructures; -use C4::Biblio; +use C4::Biblio qw( TransformKohaToMarc ); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; --- a/t/db_dependent/Biblio/TransformMarcToKoha.t +++ a/t/db_dependent/Biblio/TransformMarcToKoha.t @@ -28,7 +28,7 @@ use t::lib::TestBuilder; use Koha::Database; use Koha::Caches; use Koha::MarcSubfieldStructures; -use C4::Biblio; +use C4::Biblio qw( TransformMarcToKoha TransformMarcToKohaOneField ); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; --- a/t/db_dependent/Budgets.t +++ a/t/db_dependent/Budgets.t @@ -3,11 +3,11 @@ use Modern::Perl; use Test::More tests => 144; BEGIN { - use_ok('C4::Budgets') + use_ok('C4::Budgets', qw( AddBudgetPeriod AddBudget GetBudgetPeriods GetBudgetPeriod GetBudget ModBudgetPeriod ModBudget DelBudgetPeriod DelBudget GetBudgets GetBudgetName GetBudgetByCode GetBudgetHierarchy GetBudgetHierarchySpent GetBudgetSpent GetBudgetOrdered CloneBudgetPeriod GetBudgetsByActivity MoveOrders GetBudgetByOrderNumber SetOwnerToFundHierarchy GetBudgetAuthCats GetBudgetsPlanCell )); } use C4::Context; -use C4::Biblio; -use C4::Acquisition; +use C4::Biblio qw( AddBiblio ); +use C4::Acquisition qw( NewBasket AddInvoice GetInvoice ModReceiveOrder populate_order_with_prices ); use Koha::Acquisition::Booksellers; use Koha::Acquisition::Orders; --- a/t/db_dependent/Charset.t +++ a/t/db_dependent/Charset.t @@ -2,7 +2,7 @@ use Modern::Perl; use Test::More tests => 4; use MARC::Record; -use C4::Biblio qw( AddBiblio GetMarcFromKohaField ); +use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); use C4::Context; use C4::Charset qw( SanitizeRecord ); --- a/t/db_dependent/Circulation.t +++ a/t/db_dependent/Circulation.t @@ -32,13 +32,13 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Accounts; -use C4::Calendar; -use C4::Circulation; +use C4::Calendar qw( new insert_single_holiday insert_week_day_holiday delete_holiday ); +use C4::Circulation qw( AddIssue AddReturn CanBookBeRenewed GetIssuingCharges AddRenewal GetSoonestRenewDate GetLatestAutoRenewDate LostItem GetUpcomingDueIssues CanBookBeIssued AddIssuingCharge ProcessOfflinePayment transferbook updateWrongTransfer ); use C4::Biblio; -use C4::Items; +use C4::Items qw( ModItemTransfer ); use C4::Log; -use C4::Reserves; -use C4::Overdues qw(UpdateFine CalcFine); +use C4::Reserves qw( AddReserve ModReserve ModReserveCancelAll ModReserveAffect CheckReserves GetOtherReserves ); +use C4::Overdues qw( CalcFine UpdateFine get_chargeable_units ); use Koha::DateUtils; use Koha::Database; use Koha::Items; --- a/t/db_dependent/Circulation/Branch.t +++ a/t/db_dependent/Circulation/Branch.t @@ -17,9 +17,9 @@ use Modern::Perl; -use C4::Circulation; -use C4::Items; -use C4::Biblio; +use C4::Circulation qw( AddIssue AddReturn GetBranchBorrowerCircRule GetBranchItemRule ); +use C4::Items qw( ModItemTransfer ); +use C4::Biblio qw( AddBiblio ); use C4::Context; use Koha::CirculationRules; @@ -30,7 +30,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( AddIssue AddReturn GetBranchBorrowerCircRule GetBranchItemRule )); } can_ok( 'C4::Circulation', qw( --- a/t/db_dependent/Circulation/CalcDateDue.t +++ a/t/db_dependent/Circulation/CalcDateDue.t @@ -8,11 +8,11 @@ use DBI; use DateTime; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Calendar; +use C4::Calendar qw( new insert_single_holiday delete_holiday insert_week_day_holiday ); use Koha::CirculationRules; -use_ok('C4::Circulation'); +use_ok('C4::Circulation', qw( CalcDateDue )); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; --- a/t/db_dependent/Circulation/CalcFine.t +++ a/t/db_dependent/Circulation/CalcFine.t @@ -5,7 +5,7 @@ use Modern::Perl; use Test::More tests => 3; use C4::Context; -use C4::Overdues; +use C4::Overdues qw( CalcFine ); use Koha::DateUtils qw( dt_from_string ); --- a/t/db_dependent/Circulation/CheckIfIssuedToPatron.t +++ a/t/db_dependent/Circulation/CheckIfIssuedToPatron.t @@ -21,9 +21,9 @@ use Test::More tests => 21; use Test::MockModule; use t::lib::TestBuilder; -use C4::Circulation; +use C4::Circulation qw( CheckIfIssuedToPatron AddIssue ); use C4::Items; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Library; use Koha::Patrons; use MARC::Record; --- a/t/db_dependent/Circulation/CheckValidBarcode.t +++ a/t/db_dependent/Circulation/CheckValidBarcode.t @@ -19,15 +19,15 @@ use Modern::Perl; use Test::More tests => 10; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( CheckValidBarcode ); +use C4::Biblio qw( AddBiblio ); use C4::Items; use Koha::Database; use Koha::Library; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( CheckValidBarcode )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Circulation/GetHardDueDate.t +++ a/t/db_dependent/Circulation/GetHardDueDate.t @@ -13,7 +13,7 @@ use t::lib::TestBuilder; use Test::More tests => 9; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( GetHardDueDate GetLoanLength )); } can_ok( 'C4::Circulation', --- a/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t +++ a/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t @@ -21,8 +21,8 @@ use Test::More tests => 2; use Test::MockModule; use t::lib::TestBuilder; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( AddIssue GetPendingOnSiteCheckouts ); +use C4::Biblio qw( AddBiblio ); use C4::Items; use C4::Members; --- a/t/db_dependent/Circulation/GetTopIssues.t +++ a/t/db_dependent/Circulation/GetTopIssues.t @@ -23,8 +23,8 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Context; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( AddIssue GetTopIssues ); +use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); use C4::Items; use Koha::Database; --- a/t/db_dependent/Circulation/IsItemIssued.t +++ a/t/db_dependent/Circulation/IsItemIssued.t @@ -20,9 +20,9 @@ use Modern::Perl; use Test::More tests => 5; use Test::MockModule; -use C4::Circulation; +use C4::Circulation qw( IsItemIssued AddIssue AddReturn ); use C4::Items; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::DateUtils; use Koha::Items; --- a/t/db_dependent/Circulation/MarkIssueReturned.t +++ a/t/db_dependent/Circulation/MarkIssueReturned.t @@ -23,7 +23,7 @@ use Test::Exception; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Circulation; +use C4::Circulation qw( MarkIssueReturned AddIssue ); use C4::Context; use Koha::Checkouts; use Koha::Database; --- a/t/db_dependent/Circulation/OfflineOperation.t +++ a/t/db_dependent/Circulation/OfflineOperation.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use Modern::Perl; -use C4::Circulation; +use C4::Circulation qw( AddOfflineOperation GetOfflineOperation GetOfflineOperations DeleteOfflineOperation ); use Koha::Database; use Koha::DateUtils qw( dt_from_string output_pref ); @@ -10,7 +10,7 @@ use Koha::Library; use Test::More tests => 7; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( AddOfflineOperation GetOfflineOperation GetOfflineOperations DeleteOfflineOperation )); } can_ok( 'C4::Circulation', --- a/t/db_dependent/Circulation/ReturnClaims.t +++ a/t/db_dependent/Circulation/ReturnClaims.t @@ -24,7 +24,7 @@ use Test::Warn; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Circulation; +use C4::Circulation qw( LostItem AddIssue ); # Mock userenv, used by AddIssue my $branch; --- a/t/db_dependent/Circulation/Returns.t +++ a/t/db_dependent/Circulation/Returns.t @@ -25,9 +25,9 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Members; -use C4::Circulation; +use C4::Circulation qw( AddReturn AddIssue LostItem ); use C4::Items; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::Account::Lines; use Koha::DateUtils; --- a/t/db_dependent/Circulation/StoreLastBorrower.t +++ a/t/db_dependent/Circulation/StoreLastBorrower.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 1; -use C4::Circulation; +use C4::Circulation qw( AddReturn ); use C4::Context; use Koha::Database; use Koha::DateUtils; --- a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t +++ a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t @@ -18,7 +18,7 @@ use Modern::Perl; use Test::More tests => 10; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( TooMany AddIssue CanBookBeIssued ); use C4::Biblio; use C4::Items; use C4::Members; --- a/t/db_dependent/Circulation/TooMany.t +++ a/t/db_dependent/Circulation/TooMany.t @@ -21,7 +21,7 @@ use C4::Context; use C4::Members; use C4::Items; use C4::Biblio; -use C4::Circulation; +use C4::Circulation qw( TooMany AddIssue ); use C4::Context; use Koha::DateUtils qw( dt_from_string ); --- a/t/db_dependent/Circulation/issue.t +++ a/t/db_dependent/Circulation/issue.t @@ -23,11 +23,11 @@ use DateTime::Duration; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Biblio; -use C4::Circulation; +use C4::Biblio qw( AddBiblio ); +use C4::Circulation qw( AddIssue AddIssuingCharge AddRenewal AddReturn GetIssuingCharges GetOpenIssue GetRenewCount GetUpcomingDueIssues ); use C4::Context; use C4::Items; -use C4::Reserves; +use C4::Reserves qw( AddReserve ); use Koha::Checkouts; use Koha::Database; use Koha::DateUtils; --- a/t/db_dependent/Circulation/transferbook.t +++ a/t/db_dependent/Circulation/transferbook.t @@ -21,8 +21,8 @@ use Test::More tests => 6; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Circulation; -use C4::Reserves; +use C4::Circulation qw( transferbook AddIssue GetTransfers ); +use C4::Reserves qw( AddReserve ); use Koha::DateUtils qw( dt_from_string ); use Koha::Item::Transfers; --- a/t/db_dependent/Circulation/transfers.t +++ a/t/db_dependent/Circulation/transfers.t @@ -17,9 +17,9 @@ use Modern::Perl; use C4::Context; -use C4::Circulation; -use C4::Biblio; -use C4::Items; +use C4::Circulation qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfers GetTransfersFromTo TransferSlip ); +use C4::Biblio qw( AddBiblio ); +use C4::Items qw( ModItemTransfer ); use Koha::Database; use Koha::DateUtils; use DateTime::Duration; @@ -31,7 +31,7 @@ use Test::More tests => 22; use Test::Deep; BEGIN { - use_ok('C4::Circulation'); + use_ok('C4::Circulation', qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfers GetTransfersFromTo TransferSlip )); } can_ok( 'C4::Circulation', --- a/t/db_dependent/Contract.t +++ a/t/db_dependent/Contract.t @@ -29,7 +29,7 @@ use DateTime::Duration; use Test::More tests => 43; BEGIN { - use_ok('C4::Contract'); + use_ok('C4::Contract', qw( GetContracts GetContract AddContract ModContract DelContract )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/CourseReserves.t +++ a/t/db_dependent/CourseReserves.t @@ -23,8 +23,8 @@ use Koha::Database; use t::lib::TestBuilder; BEGIN { - use_ok('C4::Biblio'); - use_ok('C4::CourseReserves', qw/:all/); + use_ok('C4::Biblio', qw( AddBiblio )); + use_ok('C4::CourseReserves', qw( GetCourse ModCourse GetCourses DelCourse GetCourseInstructors ModCourseInstructors GetCourseItem ModCourseItem GetCourseReserve ModCourseReserve GetCourseReserves DelCourseReserve SearchCourses GetItemCourseReservesInfo )); use_ok('C4::Context'); use_ok('MARC::Field'); use_ok('MARC::Record'); --- a/t/db_dependent/CourseReserves/CourseItems.t +++ a/t/db_dependent/CourseReserves/CourseItems.t @@ -19,7 +19,7 @@ use Modern::Perl; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::CourseReserves qw/ModCourseItem ModCourseReserve DelCourseReserve GetCourseItem/; +use C4::CourseReserves qw( ModCourse ModCourseItem ModCourseReserve GetCourse GetCourseItem DelCourse DelCourseReserve ); use C4::Context; use Koha::Items; --- a/t/db_dependent/Creators/Lib.t +++ a/t/db_dependent/Creators/Lib.t @@ -26,7 +26,7 @@ use Koha::Database; use Test::Warn; BEGIN { - use_ok('C4::Creators::Lib'); + use_ok('C4::Creators::Lib', qw( get_all_templates get_all_layouts get_all_profiles get_all_image_names get_batch_summary get_label_summary get_card_summary get_barcode_types get_label_types get_font_types get_text_justification_types get_output_formats get_table_names get_unit_values html_table )); use_ok('C4::Biblio'); use_ok('C4::Context'); use_ok('Koha::Patron'); --- a/t/db_dependent/DecreaseLoanHighHolds.t +++ a/t/db_dependent/DecreaseLoanHighHolds.t @@ -18,7 +18,7 @@ use Modern::Perl; use DateTime; -use C4::Circulation; +use C4::Circulation qw( CalcDateDue checkHighHolds CanBookBeIssued ); use Koha::Database; use Koha::DateUtils; use Koha::Patrons; --- a/t/db_dependent/Exporter/Record.t +++ a/t/db_dependent/Exporter/Record.t @@ -28,7 +28,7 @@ use MARC::Batch; use File::Slurp; use Encode; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use C4::Context; use Koha::Database; use Koha::Biblio; --- a/t/db_dependent/Filter_MARC_ViewPolicy.t +++ a/t/db_dependent/Filter_MARC_ViewPolicy.t @@ -29,7 +29,7 @@ use List::MoreUtils qw/any/; use MARC::Record; use MARC::Field; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( GetMarcFromKohaField ); use Koha::Caches; use Koha::Database; --- a/t/db_dependent/Fines.t +++ a/t/db_dependent/Fines.t @@ -3,7 +3,7 @@ use Modern::Perl; use C4::Context; -use C4::Overdues; +use C4::Overdues qw( CalcFine ); use Koha::Database; use Koha::DateUtils; --- a/t/db_dependent/FrameworkPlugin.t +++ a/t/db_dependent/FrameworkPlugin.t @@ -8,8 +8,8 @@ use Test::More tests => 5; use t::lib::TestBuilder; -use C4::Auth; -use C4::Output; +use C4::Auth qw( checkauth ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Database; use Koha::FrameworkPlugin; --- a/t/db_dependent/Heading.t +++ a/t/db_dependent/Heading.t @@ -23,7 +23,7 @@ use Test::More tests => 3; use t::lib::Mocks; BEGIN { - use_ok('C4::Heading'); + use_ok('C4::Heading', qw( field valid_heading_subfield )); } subtest "MARC21 tests" => sub { --- a/t/db_dependent/Heading_MARC21.t +++ a/t/db_dependent/Heading_MARC21.t @@ -10,7 +10,7 @@ use Test::More tests => 5; use C4::Context; BEGIN { - use_ok('C4::Heading'); + use_ok('C4::Heading', qw( field new_from_field display_form search_form )); } SKIP: { --- a/t/db_dependent/Hold.t +++ a/t/db_dependent/Hold.t @@ -22,7 +22,7 @@ use C4::Context; use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::Libraries; -use C4::Calendar; +use C4::Calendar qw( new insert_single_holiday ); use Koha::Patrons; use Koha::Holds; use Koha::Item; --- a/t/db_dependent/Holds.t +++ a/t/db_dependent/Holds.t @@ -13,8 +13,8 @@ use MARC::Record; use C4::Biblio; use C4::Calendar; use C4::Items; -use C4::Reserves; -use C4::Circulation; +use C4::Reserves qw( AddReserve CalculatePriority ModReserve ToggleSuspend AutoUnsuspendReserves SuspendAll ModReserveMinusPriority AlterPriority CanItemBeReserved CheckReserves ); +use C4::Circulation qw( CanBookBeRenewed ); use Koha::Biblios; use Koha::CirculationRules; --- a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t +++ a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t @@ -3,7 +3,7 @@ use Modern::Perl; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use C4::Items; use Koha::Items; use Koha::CirculationRules; @@ -14,7 +14,7 @@ use t::lib::TestBuilder; use t::lib::Mocks; BEGIN { - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( ItemsAnyAvailableAndNotRestricted IsAvailableForItemLevelRequest )); } my $schema = Koha::Database->schema; --- a/t/db_dependent/Holds/HoldFulfillmentPolicy.t +++ a/t/db_dependent/Holds/HoldFulfillmentPolicy.t @@ -12,7 +12,7 @@ use t::lib::Mocks; use Koha::Holds; BEGIN { - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( AddReserve CheckReserves )); } my $schema = Koha::Database->schema; --- a/t/db_dependent/Holds/HoldItemtypeLimit.t +++ a/t/db_dependent/Holds/HoldItemtypeLimit.t @@ -14,7 +14,7 @@ use Koha::Holds; BEGIN { use FindBin; use lib $FindBin::Bin; - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( AddReserve CheckReserves )); } my $schema = Koha::Database->schema; --- a/t/db_dependent/Holds/LocalHoldsPriority.t +++ a/t/db_dependent/Holds/LocalHoldsPriority.t @@ -19,7 +19,7 @@ use t::lib::TestBuilder; BEGIN { use FindBin; use lib $FindBin::Bin; - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( AddReserve CheckReserves )); } my $schema = Koha::Database->schema; @@ -208,4 +208,4 @@ subtest "exclude from local holds" => sub { is($reserve->{borrowernumber}, $patron_nex_l2->borrowernumber, "Patron from other library is next checkout because item is excluded"); $schema->storage->txn_rollback; -}; +}; --- a/t/db_dependent/Holds/RevertWaitingStatus.t +++ a/t/db_dependent/Holds/RevertWaitingStatus.t @@ -24,7 +24,7 @@ use Koha::Patrons; use C4::Context; use C4::Items; use C4::Biblio; -use C4::Reserves; +use C4::Reserves qw( AddReserve ModReserve ModReserveAffect ); use t::lib::TestBuilder; use t::lib::Mocks; --- a/t/db_dependent/Holds/WaitingReserves.t +++ a/t/db_dependent/Holds/WaitingReserves.t @@ -2,7 +2,7 @@ use Modern::Perl; -use C4::Reserves; +use C4::Reserves qw( ModReserve ModReserveAffect ); use Koha::DateUtils; use t::lib::Mocks; @@ -10,7 +10,7 @@ use t::lib::TestBuilder; use Test::More tests => 11; -use_ok('C4::Reserves'); +use_ok('C4::Reserves', qw( ModReserve ModReserveAffect )); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; --- a/t/db_dependent/HoldsQueue.t +++ a/t/db_dependent/HoldsQueue.t @@ -11,10 +11,10 @@ use Modern::Perl; use Test::More tests => 57; use Data::Dumper; -use C4::Calendar; +use C4::Calendar qw( new insert_single_holiday ); use C4::Context; use C4::Members; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Database; use Koha::DateUtils; use Koha::Items; @@ -27,8 +27,8 @@ use t::lib::Mocks; BEGIN { use FindBin; use lib $FindBin::Bin; - use_ok('C4::Reserves'); - use_ok('C4::HoldsQueue'); + use_ok('C4::Reserves', qw( AddReserve ModReserve ModReserveAffect )); + use_ok('C4::HoldsQueue', qw( TransportCostMatrix GetHoldsQueueItems CreateQueue UpdateTransportCostMatrix GetPendingHoldRequestsForBib )); } my $schema = Koha::Database->schema; --- a/t/db_dependent/Holidays.t +++ a/t/db_dependent/Holidays.t @@ -30,7 +30,7 @@ use Koha::DateUtils; BEGIN { use_ok('Koha::Calendar'); - use_ok('C4::Calendar'); + use_ok('C4::Calendar', qw( insert_exception_holiday insert_week_day_holiday insert_day_month_holiday insert_single_holiday copy_to_branch get_exception_holidays isHoliday )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/ILSDI_Services.t +++ a/t/db_dependent/ILSDI_Services.t @@ -25,12 +25,12 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Items qw( ModItemTransfer ); -use C4::Circulation; +use C4::Circulation qw( AddIssue ); use Koha::AuthUtils; BEGIN { - use_ok('C4::ILSDI::Services'); + use_ok('C4::ILSDI::Services', qw( AuthenticatePatron GetPatronInfo LookupPatron HoldTitle HoldItem GetRecords RenewLoan )); } my $schema = Koha::Database->schema; --- a/t/db_dependent/Illrequests.t +++ a/t/db_dependent/Illrequests.t @@ -19,7 +19,7 @@ use Modern::Perl; use File::Basename qw/basename/; -use C4::Circulation qw(AddIssue AddReturn); +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Database; use Koha::Illrequestattributes; --- a/t/db_dependent/ImportBatch.t +++ a/t/db_dependent/ImportBatch.t @@ -16,7 +16,7 @@ BEGIN { # Mock pluginsdir before loading Plugins module my $path = dirname(__FILE__) . '/../lib'; t::lib::Mocks::mock_config( 'pluginsdir', $path ); - use_ok('C4::ImportBatch'); + use_ok('C4::ImportBatch', qw( AddImportBatch GetImportBatch AddBiblioToBatch AddItemsToImportBiblio GetRecordFromImportBiblio SetMatchedBiblionumber GetImportBiblios GetItemNumbersFromImportBatch CleanBatch DeleteBatch RecordsFromMarcPlugin )); } # Start transaction --- a/t/db_dependent/ImportExportFramework.t +++ a/t/db_dependent/ImportExportFramework.t @@ -26,7 +26,7 @@ use File::Basename qw( dirname ); use Koha::Database; use Koha::BiblioFrameworks; use Koha::MarcSubfieldStructures; -use C4::ImportExportFramework; +use C4::ImportExportFramework qw( ImportFramework ExportFramework ); my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; --- a/t/db_dependent/Installer.t +++ a/t/db_dependent/Installer.t @@ -29,7 +29,7 @@ use utf8; use Koha::Database; BEGIN { - use_ok('C4::Installer'); + use_ok('C4::Installer', qw( column_exists index_exists foreign_key_exists primary_key_exists marc_framework_sql_list )); } ok( my $installer = C4::Installer->new(), 'Testing NewInstaller' ); --- a/t/db_dependent/Items.t +++ a/t/db_dependent/Items.t @@ -19,8 +19,8 @@ use Modern::Perl; use Data::Dumper; use MARC::Record; -use C4::Items; -use C4::Biblio; +use C4::Items qw( ModItemTransfer GetHiddenItemnumbers GetItemsInfo SearchItems AddItemFromMarc ModItemFromMarc get_hostitemnumbers_of Item2Marc ); +use C4::Biblio qw( GetMarcFromKohaField EmbedItemsInMarcBiblio GetMarcBiblio AddBiblio ); use Koha::Items; use Koha::Database; use Koha::DateUtils qw( dt_from_string ); --- a/t/db_dependent/Items/AutomaticItemModificationByAge.t +++ a/t/db_dependent/Items/AutomaticItemModificationByAge.t @@ -7,8 +7,8 @@ use MARC::Field; use DateTime; use DateTime::Duration; -use C4::Items; -use C4::Biblio; +use C4::Items qw( GetMarcItem ToggleNewStatus ); +use C4::Biblio qw( AddBiblio GetMarcFromKohaField ); use C4::Context; use Koha::DateUtils; use Koha::Items; --- a/t/db_dependent/Items/GetHostItemsInfo.t +++ a/t/db_dependent/Items/GetHostItemsInfo.t @@ -4,7 +4,7 @@ use Test::More tests => 1; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Items; +use C4::Items qw( GetHostItemsInfo ); use Koha::Database; my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Items/GetItemsForInventory.t +++ a/t/db_dependent/Items/GetItemsForInventory.t @@ -25,8 +25,8 @@ use t::lib::TestBuilder; use List::MoreUtils qw( any none ); use C4::Biblio qw(AddBiblio); -use C4::Reserves; -use C4::ClassSource; +use C4::Reserves qw( AddReserve ); +use C4::ClassSource qw( GetClassSort ); use Koha::AuthorisedValues; use Koha::Biblios; use Koha::Database; @@ -34,7 +34,7 @@ use MARC::Record; BEGIN { use_ok('C4::Context'); - use_ok('C4::Items'); + use_ok('C4::Items', qw( GetItemsForInventory )); use_ok('C4::Biblio'); use_ok('C4::Koha'); } --- a/t/db_dependent/Items/MoveItemFromBiblio.t +++ a/t/db_dependent/Items/MoveItemFromBiblio.t @@ -18,7 +18,7 @@ use Modern::Perl; use Test::More tests => 8; -use C4::Items; +use C4::Items qw( MoveItemFromBiblio ); use C4::Reserves; use Koha::Database; use Koha::Holds; --- a/t/db_dependent/Koha.t +++ a/t/db_dependent/Koha.t @@ -14,7 +14,7 @@ use Koha::AuthorisedValue; use Koha::AuthorisedValueCategories; BEGIN { - use_ok('C4::Koha', qw( :DEFAULT GetItemTypesCategorized)); + use_ok('C4::Koha', qw( GetAuthorisedValues GetItemTypesCategorized xml_escape )); use_ok('C4::Members'); } --- a/t/db_dependent/Koha/Account/Line.t +++ a/t/db_dependent/Koha/Account/Line.t @@ -25,7 +25,7 @@ use Test::MockModule; use DateTime; -use C4::Circulation qw/AddIssue AddReturn/; +use C4::Circulation qw( AddRenewal CanBookBeRenewed LostItem AddIssue AddReturn ); use Koha::Account; use Koha::Account::Lines; use Koha::Account::Offsets; --- a/t/db_dependent/Koha/Acquisition/Basket.t +++ a/t/db_dependent/Koha/Acquisition/Basket.t @@ -25,7 +25,7 @@ use Test::Exception; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Acquisition; +use C4::Acquisition qw( NewBasket ModBasket ModBasketHeader ); use Koha::Database; use Koha::DateUtils qw(dt_from_string); --- a/t/db_dependent/Koha/Acquisition/Booksellers.t +++ a/t/db_dependent/Koha/Acquisition/Booksellers.t @@ -21,10 +21,10 @@ use Test::More tests => 3; use t::lib::TestBuilder; -use C4::Acquisition; -use C4::Biblio; -use C4::Budgets; -use C4::Serials; +use C4::Acquisition qw( NewBasket ); +use C4::Biblio qw( AddBiblio ); +use C4::Budgets qw( AddBudgetPeriod AddBudget ); +use C4::Serials qw( NewSubscription SearchSubscriptions ); use Koha::Acquisition::Booksellers; use Koha::Database; --- a/t/db_dependent/Koha/Acquisition/Order.t +++ a/t/db_dependent/Koha/Acquisition/Order.t @@ -25,7 +25,7 @@ use Test::Exception; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Biblios; use Koha::Database; --- a/t/db_dependent/Koha/ActionLogs.t +++ a/t/db_dependent/Koha/ActionLogs.t @@ -20,7 +20,7 @@ use Modern::Perl; use Test::More tests => 3; use C4::Context; -use C4::Log; +use C4::Log qw( logaction ); use Koha::Database; use Koha::DateUtils qw( dt_from_string ); --- a/t/db_dependent/Koha/Authorities.t +++ a/t/db_dependent/Koha/Authorities.t @@ -29,7 +29,7 @@ use Test::MockObject; use Test::Warn; use C4::Context; -use C4::AuthoritiesMarc; +use C4::AuthoritiesMarc qw( merge AddAuthority ); use Koha::Authority; use Koha::Authority::ControlledIndicators; use Koha::Authorities; --- a/t/db_dependent/Koha/Biblio.t +++ a/t/db_dependent/Koha/Biblio.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 14; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ModBiblio ); use Koha::Database; use Koha::Acquisition::Orders; --- a/t/db_dependent/Koha/Biblio/Metadata.t +++ a/t/db_dependent/Koha/Biblio/Metadata.t @@ -22,7 +22,7 @@ use Test::Exception; use t::lib::TestBuilder; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Database; BEGIN { --- a/t/db_dependent/Koha/Biblios.t +++ a/t/db_dependent/Koha/Biblios.t @@ -27,8 +27,8 @@ use Test::MockModule; use MARC::Field; use C4::Items; -use C4::Biblio; -use C4::Reserves; +use C4::Biblio qw( AddBiblio ModBiblio ); +use C4::Reserves qw( AddReserve ); use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Biblios; --- a/t/db_dependent/Koha/Charges/Fees.t +++ a/t/db_dependent/Koha/Charges/Fees.t @@ -28,7 +28,7 @@ use t::lib::TestBuilder; use t::lib::Dates; use Time::Fake; -use C4::Calendar; +use C4::Calendar qw( new insert_week_day_holiday delete_holiday ); use Koha::DateUtils qw(dt_from_string); BEGIN { --- a/t/db_dependent/Koha/Checkouts.t +++ a/t/db_dependent/Koha/Checkouts.t @@ -21,7 +21,7 @@ use Modern::Perl; use Test::More tests => 10; -use C4::Circulation; +use C4::Circulation qw( MarkIssueReturned AddReturn ); use Koha::Checkouts; use Koha::Database; use Koha::DateUtils qw( dt_from_string ); --- a/t/db_dependent/Koha/Club/Enrollment.t +++ a/t/db_dependent/Koha/Club/Enrollment.t @@ -45,4 +45,4 @@ subtest 'is_canceled' => sub { ok($enrollment->is_canceled, 'Enrollment should be canceled'); $schema->storage->txn_rollback; -} +} --- a/t/db_dependent/Koha/Filter/EmbedItems.t +++ a/t/db_dependent/Koha/Filter/EmbedItems.t @@ -21,7 +21,7 @@ use Test::More tests => 1; use t::lib::TestBuilder; -use C4::Biblio; +use C4::Biblio qw( GetMarcSubfieldStructure ); use Koha::Database; use Koha::RecordProcessor; --- a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t +++ a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t @@ -25,7 +25,7 @@ use t::lib::TestBuilder; use MARC::Record; -use C4::Biblio qw/AddBiblio GetMarcBiblio/; +use C4::Biblio qw( GetMarcFromKohaField AddBiblio GetMarcBiblio ); use Koha::Database; use Koha::RecordProcessor; --- a/t/db_dependent/Koha/Holds.t +++ a/t/db_dependent/Koha/Holds.t @@ -22,8 +22,8 @@ use Modern::Perl; use Test::More tests => 6; use Test::Warn; -use C4::Circulation; -use C4::Reserves; +use C4::Circulation qw( AddIssue ); +use C4::Reserves qw( AddReserve ModReserve ModReserveCancelAll ); use Koha::AuthorisedValueCategory; use Koha::Database; use Koha::Holds; --- a/t/db_dependent/Koha/Item.t +++ a/t/db_dependent/Koha/Item.t @@ -22,8 +22,8 @@ use Modern::Perl; use Test::More tests => 9; use Test::Exception; -use C4::Biblio; -use C4::Circulation; +use C4::Biblio qw( GetMarcSubfieldStructure ); +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Items; use Koha::Database; --- a/t/db_dependent/Koha/ItemTypes.t +++ a/t/db_dependent/Koha/ItemTypes.t @@ -25,7 +25,7 @@ use Test::More tests => 14; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Calendar; +use C4::Calendar qw( new ); use Koha::Biblioitems; use Koha::Libraries; use Koha::Database; --- a/t/db_dependent/Koha/Items.t +++ a/t/db_dependent/Koha/Items.t @@ -25,7 +25,7 @@ use Test::MockModule; use Test::Exception; use Time::Fake; -use C4::Circulation; +use C4::Circulation qw( AddIssue LostItem AddReturn ); use C4::Context; use Koha::Item; use Koha::Item::Transfer::Limits; --- a/t/db_dependent/Koha/Object.t +++ a/t/db_dependent/Koha/Object.t @@ -23,8 +23,8 @@ use Test::Warn; use DateTime; use C4::Context; -use C4::Circulation; # AddIssue -use C4::Biblio; # AddBiblio +use C4::Circulation qw( AddIssue ); +use C4::Biblio qw( AddBiblio ); use Koha::Database; --- a/t/db_dependent/Koha/Patron/Category.t +++ a/t/db_dependent/Koha/Patron/Category.t @@ -201,4 +201,4 @@ subtest 'effective_require_strong_password' => sub { is($category->effective_require_strong_password, 1, 'Patron should be required strong password from category'); $schema->storage->txn_rollback; -}; +}; --- a/t/db_dependent/Koha/Patrons.t +++ a/t/db_dependent/Koha/Patrons.t @@ -29,9 +29,9 @@ use JSON; use Data::Dumper; use utf8; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use C4::Biblio; -use C4::Auth qw(checkpw_hash); +use C4::Auth qw( checkpw checkpw_hash ); use Koha::ActionLogs; use Koha::Holds; --- a/t/db_dependent/Koha/Plugins/Circulation_hooks.t +++ a/t/db_dependent/Koha/Plugins/Circulation_hooks.t @@ -22,7 +22,7 @@ use Test::Warn; use File::Basename; -use C4::Circulation qw(AddIssue AddRenewal AddReturn); +use C4::Circulation qw( AddIssue AddRenewal AddReturn ); use t::lib::Mocks; use t::lib::TestBuilder; --- a/t/db_dependent/Koha/Plugins/Holds_hooks.t +++ a/t/db_dependent/Koha/Plugins/Holds_hooks.t @@ -22,7 +22,7 @@ use Test::Warn; use File::Basename; -use C4::Reserves qw(AddReserve); +use C4::Reserves qw( AddReserve ); use t::lib::Mocks; use t::lib::TestBuilder; --- a/t/db_dependent/Koha/Pseudonymization.t +++ a/t/db_dependent/Koha/Pseudonymization.t @@ -22,8 +22,8 @@ use Modern::Perl; use Test::More tests => 3; use Try::Tiny; -use C4::Circulation; -use C4::Stats; +use C4::Circulation qw( AddIssue AddReturn ); +use C4::Stats qw( UpdateStats ); use Koha::Database; use Koha::DateUtils qw( dt_from_string ); --- a/t/db_dependent/Koha/SearchEngine/Indexer.t +++ a/t/db_dependent/Koha/SearchEngine/Indexer.t @@ -15,10 +15,10 @@ use Test::MockObject; use t::lib::Mocks; #use C4::Biblio qw//; -use C4::AuthoritiesMarc; -use C4::Biblio; -use C4::Circulation; -use C4::Items; +use C4::AuthoritiesMarc qw( AddAuthority DelAuthority merge ); +use C4::Biblio qw( ModZebra ModBiblio ModBiblioMarc DelBiblio ); +use C4::Circulation qw( MarkIssueReturned AddReturn LostItem ); +use C4::Items qw( ModDateLastSeen ModItemTransfer ); use Koha::Database; use Koha::DateUtils; use Koha::SearchEngine::Elasticsearch; --- a/t/db_dependent/Koha/Statistics.t +++ a/t/db_dependent/Koha/Statistics.t @@ -23,7 +23,7 @@ use Test::More tests => 4; use Koha::Database; use Koha::Statistics; -use C4::Stats; +use C4::Stats qw( UpdateStats ); use t::lib::TestBuilder; --- a/t/db_dependent/Koha/Z3950Responder/Session.t +++ a/t/db_dependent/Koha/Z3950Responder/Session.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 3; use t::lib::TestBuilder; -use C4::Items; +use C4::Items qw( GetMarcItem ); BEGIN { use_ok('Koha::Z3950Responder'); --- a/t/db_dependent/Koha/Z3950Responder/Session2.t +++ a/t/db_dependent/Koha/Z3950Responder/Session2.t @@ -3,7 +3,7 @@ use Modern::Perl; use Test::More tests => 3; use t::lib::TestBuilder; -use C4::Items; +use C4::Items qw( GetMarcItem ); use Koha::Caches; --- a/t/db_dependent/Koha_Authority.t +++ a/t/db_dependent/Koha_Authority.t @@ -20,8 +20,8 @@ use Modern::Perl; use C4::Context; -use C4::Charset; -use C4::AuthoritiesMarc; +use C4::Charset qw( MarcToUTF8Record ); +use C4::AuthoritiesMarc qw( AddAuthority ); use Koha::Database; use Test::More; use File::Basename; --- a/t/db_dependent/Koha_ExternalContent_RecordedBooks.t +++ a/t/db_dependent/Koha_ExternalContent_RecordedBooks.t @@ -3,7 +3,7 @@ use Modern::Perl; use t::lib::Mocks; use t::lib::TestBuilder; use Test::More tests => 3; # last test to print -use C4::Auth; +use C4::Auth qw( get_session ); use Koha::Database; use Module::Load::Conditional qw( can_load ); --- a/t/db_dependent/Labels/t_Batch.t +++ a/t/db_dependent/Labels/t_Batch.t @@ -27,13 +27,13 @@ use MARC::Field; use t::lib::TestBuilder; use C4::Context; -use C4::Items; -use C4::Biblio; +use C4::Items qw( AddItemBatchFromMarc ); +use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); use Koha::Database; use Koha::Libraries; BEGIN { - use_ok('C4::Labels::Batch'); + use_ok('C4::Labels::Batch', qw( save retrieve delete )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Languages.t +++ a/t/db_dependent/Languages.t @@ -13,7 +13,7 @@ use t::lib::Mocks; use Koha::Database; BEGIN { - use_ok('C4::Languages'); + use_ok('C4::Languages', qw( accept_language getAllLanguages getLanguages getTranslatedLanguages get_rfc4646_from_iso639 )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Letters.t +++ a/t/db_dependent/Letters.t @@ -44,9 +44,9 @@ $email_sender_module->mock( use_ok('C4::Context'); use_ok('C4::Members'); -use_ok('C4::Acquisition'); -use_ok('C4::Biblio'); -use_ok('C4::Letters'); +use_ok('C4::Acquisition', qw( NewBasket )); +use_ok('C4::Biblio', qw( AddBiblio GetBiblioData )); +use_ok('C4::Letters', qw( GetMessageTransportTypes GetMessage EnqueueLetter GetQueuedMessages SendQueuedMessages ResendMessage GetLetters GetPreparedLetter SendAlerts )); use t::lib::Mocks; use t::lib::TestBuilder; use Koha::Database; @@ -472,7 +472,7 @@ is($err->{error}, 'something went wrong', "Send exception, error message returne } { -use C4::Serials; +use C4::Serials qw( NewSubscription GetSerials findSerialsByStatus ModSerialStatus ); my $notes = 'notes'; my $internalnotes = 'intnotes'; --- a/t/db_dependent/Letters/GetLettersAvailableForALibrary.t +++ a/t/db_dependent/Letters/GetLettersAvailableForALibrary.t @@ -2,7 +2,7 @@ use Modern::Perl; use Test::More tests => 19; use C4::Context; -use C4::Letters qw( GetLettersAvailableForALibrary DelLetter ); +use C4::Letters qw( GetLetters GetLettersAvailableForALibrary DelLetter ); use Koha::Database; my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Letters/TemplateToolkit.t +++ a/t/db_dependent/Letters/TemplateToolkit.t @@ -28,9 +28,9 @@ use MARC::Record; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Circulation; -use C4::Letters; -use C4::Members; +use C4::Circulation qw( AddIssue AddReturn ); +use C4::Letters qw( GetPreparedLetter ); +use C4::Members qw( IssueSlip ); use C4::Biblio; use Koha::Database; use Koha::DateUtils; --- a/t/db_dependent/LibraryGroups.t +++ a/t/db_dependent/LibraryGroups.t @@ -162,4 +162,4 @@ subtest 'Koha::Library::Groups->get_root_ancestor' => sub { is($ancestor1->id, $groupY->id, "Get root ancestor should return group's root ancestor"); ok($ancestor1->id ne $ancestor2->id, "Both root groups should have different ids"); -}; +}; --- a/t/db_dependent/Linker_Default.t +++ a/t/db_dependent/Linker_Default.t @@ -21,8 +21,8 @@ use Test::More tests => 2; use MARC::Record; use MARC::Field; use MARC::File::XML; -use C4::Heading; -use C4::Linker::FirstMatch; +use C4::Heading qw( authorities field new_from_field auth_type search_form ); +use C4::Linker::Default; use Test::MockModule; use t::lib::Mocks qw( mock_preference ); use t::lib::TestBuilder; --- a/t/db_dependent/Linker_FirstMatch.t +++ a/t/db_dependent/Linker_FirstMatch.t @@ -24,7 +24,7 @@ use Test::More tests => 3; use MARC::Record; use MARC::Field; use MARC::File::XML; -use C4::Heading; +use C4::Heading qw( authorities field new_from_field ); use C4::Linker::FirstMatch; use Test::MockModule; use t::lib::Mocks qw( mock_preference ); --- a/t/db_dependent/Log.t +++ a/t/db_dependent/Log.t @@ -18,8 +18,8 @@ use Modern::Perl; use Test::More tests => 3; use C4::Context; -use C4::Log; -use C4::Auth qw/checkpw/; +use C4::Log qw( logaction cronlogaction ); +use C4::Auth qw( checkpw ); use Koha::Database; use Koha::DateUtils; use Koha::ActionLogs; --- a/t/db_dependent/MarcModificationTemplates.t +++ a/t/db_dependent/MarcModificationTemplates.t @@ -9,7 +9,7 @@ use t::lib::Mocks; use_ok("MARC::Field"); use_ok("MARC::Record"); -use_ok("C4::MarcModificationTemplates"); +use_ok('C4::MarcModificationTemplates', qw( AddModificationTemplate AddModificationTemplateAction GetModificationTemplateAction GetModificationTemplateActions ModModificationTemplateAction MoveModificationTemplateAction DelModificationTemplate DelModificationTemplateAction ModifyRecordWithTemplate GetModificationTemplates )); my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; --- a/t/db_dependent/Members.t +++ a/t/db_dependent/Members.t @@ -33,7 +33,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; BEGIN { - use_ok('C4::Members'); + use_ok('C4::Members', qw( checkcardnumber GetBorrowersToExpunge DeleteUnverifiedOpacRegistrations DeleteExpiredOpacRegistrations )); } my $schema = Koha::Database->schema; --- a/t/db_dependent/Members/GetAllIssues.t +++ a/t/db_dependent/Members/GetAllIssues.t @@ -22,10 +22,10 @@ use Test::MockModule; use t::lib::TestBuilder; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( AddIssue ); +use C4::Biblio qw( AddBiblio ); use C4::Items; -use C4::Members; +use C4::Members qw( GetAllIssues ); use Koha::Libraries; use Koha::Patrons; use MARC::Record; --- a/t/db_dependent/Members/IssueSlip.t +++ a/t/db_dependent/Members/IssueSlip.t @@ -24,10 +24,10 @@ use Test::MockModule; use Test::MockTime qw( set_fixed_time ); use t::lib::TestBuilder; -use C4::Circulation; -use C4::Biblio; +use C4::Circulation qw( AddIssue AddReturn ); +use C4::Biblio qw( AddBiblio ); use C4::Items; -use C4::Members; +use C4::Members qw( IssueSlip ); use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Library; --- a/t/db_dependent/Members/Statistics.t +++ a/t/db_dependent/Members/Statistics.t @@ -5,7 +5,7 @@ use Test::More tests => 2; use t::lib::Mocks; -use C4::Members::Statistics; +use C4::Members::Statistics qw( get_fields ); use Koha::Database; # we need the db here; get_fields looks for the item columns my $schema = Koha::Database->schema; --- a/t/db_dependent/Message.t +++ a/t/db_dependent/Message.t @@ -22,7 +22,7 @@ use utf8; use t::lib::TestBuilder; -use C4::Letters; +use C4::Letters qw( GetPreparedLetter ); use Koha::Database; my $schema = Koha::Database->schema; --- a/t/db_dependent/MungeMarcPrice.t +++ a/t/db_dependent/MungeMarcPrice.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use Modern::Perl; -use C4::Biblio; +use C4::Biblio qw( MungeMarcPrice ); use Koha::Database; use Koha::Acquisition::Currencies; use Test::More; --- a/t/db_dependent/OAI/AndSets.t +++ a/t/db_dependent/OAI/AndSets.t @@ -25,8 +25,8 @@ use MARC::Record; use Data::Dumper; use Koha::Database; -use C4::Biblio; -use C4::OAI::Sets; +use C4::Biblio qw( GetMarcBiblio ); +use C4::OAI::Sets qw( AddOAISet ModOAISet ModOAISetMappings CalcOAISetsBiblio ); use t::lib::TestBuilder; --- a/t/db_dependent/OAI/Server.t +++ a/t/db_dependent/OAI/Server.t @@ -32,7 +32,7 @@ use YAML::XS; use t::lib::Mocks; -use C4::Biblio; +use C4::Biblio qw( AddBiblio GetMarcBiblio ModBiblio ); use C4::Context; use Koha::Biblio::Metadatas; --- a/t/db_dependent/OAI/Sets.t +++ a/t/db_dependent/OAI/Sets.t @@ -24,8 +24,8 @@ use Test::Warn; use MARC::Record; use Koha::Database; -use C4::Biblio; -use C4::OAI::Sets; +use C4::Biblio qw( GetMarcBiblio ); +use C4::OAI::Sets qw( AddOAISet GetOAISets GetOAISet GetOAISetBySpec ModOAISet ModOAISetMappings GetOAISetsMappings GetOAISetMappings AddOAISetsBiblios GetOAISetsBiblio ModOAISetsBiblios DelOAISet DelOAISetsBiblio UpdateOAISetsBiblio CalcOAISetsBiblio ); use t::lib::TestBuilder; use t::lib::Mocks; --- a/t/db_dependent/Overdues.t +++ a/t/db_dependent/Overdues.t @@ -11,7 +11,7 @@ use Koha::Libraries; use t::lib::Mocks; use t::lib::TestBuilder; -use_ok('C4::Overdues'); +use_ok('C4::Overdues', qw( GetOverdueMessageTransportTypes GetBranchcodesWithOverdueRules UpdateFine )); can_ok('C4::Overdues', 'GetOverdueMessageTransportTypes'); can_ok('C4::Overdues', 'GetBranchcodesWithOverdueRules'); --- a/t/db_dependent/Passwordrecovery.t +++ a/t/db_dependent/Passwordrecovery.t @@ -18,7 +18,7 @@ use Modern::Perl; use C4::Context; -use C4::Letters; +use C4::Letters qw( GetQueuedMessages ); use Koha::Database; use Koha::DateUtils; use Koha::Patrons; --- a/t/db_dependent/Patron/Borrower_PrevCheckout.t +++ a/t/db_dependent/Patron/Borrower_PrevCheckout.t @@ -2,7 +2,7 @@ use Modern::Perl; use C4::Members; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn CanBookBeIssued ); use Koha::Database; use Koha::DateUtils; use Koha::Patrons; --- a/t/db_dependent/Patron/Messages.t +++ a/t/db_dependent/Patron/Messages.t @@ -47,4 +47,4 @@ subtest 'Delete a patron having messages' => sub { is(Koha::Patron::Messages->find($message->{message_id}), undef, 'Message is deleted'); }; -$schema->storage->txn_rollback; +$schema->storage->txn_rollback; --- a/t/db_dependent/Patroncards.t +++ a/t/db_dependent/Patroncards.t @@ -20,7 +20,7 @@ use Test::MockModule; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Patroncards::Layout; +use C4::Patroncards::Layout qw( save new ); subtest '->save' => sub { plan tests => 1; --- a/t/db_dependent/Record.t +++ a/t/db_dependent/Record.t @@ -10,7 +10,7 @@ use C4::Context; use Koha::Database; BEGIN { - use_ok('C4::Record'); + use_ok('C4::Record', qw( marc2marc marc2marcxml marcxml2marc marc2dcxml marc2modsxml marc2bibtex )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Record/Record.t +++ a/t/db_dependent/Record/Record.t @@ -27,7 +27,7 @@ use constant WHEREAMI => 't/db_dependent/Record/testrecords'; # specify the number of tests use Test::More tests => 21; #FIXME Commented out two failing tests #use C4::Context; -use C4::Record; +use C4::Record qw( marc2marc marc2marcxml marc2dcxml changeEncoding ); =head1 NAME --- a/t/db_dependent/Record/marcrecord2csv.t +++ a/t/db_dependent/Record/marcrecord2csv.t @@ -7,12 +7,12 @@ use MARC::Record; use MARC::Field; use Text::CSV::Encoded; -use C4::Biblio qw( AddBiblio ); +use C4::Biblio qw( AddBiblio GetMarcBiblio ); use C4::Context; -use C4::Record; +use C4::Record qw( marcrecord2csv ); use Koha::Database; -use C4::Items; +use C4::Items qw( AddItemFromMarc ); use t::lib::TestBuilder; --- a/t/db_dependent/Reports.t +++ a/t/db_dependent/Reports.t @@ -9,7 +9,7 @@ use warnings; use Test::More tests => 2; BEGIN { - use_ok('C4::Reports'); + use_ok('C4::Reports', qw( GetDelimiterChoices )); } --- a/t/db_dependent/Reports/Guided.t +++ a/t/db_dependent/Reports/Guided.t @@ -28,7 +28,7 @@ use Koha::Items; use Koha::Reports; use Koha::Notice::Messages; -use_ok('C4::Reports::Guided'); +use_ok('C4::Reports::Guided', qw( execute_query save_report delete_report strip_limit GetReservedAuthorisedValues IsAuthorisedValueValid GetParametersFromSQL ValidateSQLParameters get_saved_reports update_sql get_report_areas convert_sql EmailReport nb_rows )); can_ok( 'C4::Reports::Guided', qw(save_report delete_report execute_query) --- a/t/db_dependent/Reserves.t +++ a/t/db_dependent/Reserves.t @@ -27,11 +27,11 @@ use t::lib::TestBuilder; use MARC::Record; use DateTime::Duration; -use C4::Circulation; +use C4::Circulation qw( AddReturn AddIssue ); use C4::Items; -use C4::Biblio; +use C4::Biblio qw( GetMarcBiblio GetMarcFromKohaField ModBiblio ); use C4::Members; -use C4::Reserves; +use C4::Reserves qw( AddReserve CheckReserves GetReservesControlBranch ModReserve ModReserveAffect ReserveSlip CalculatePriority CanReserveBeCanceledFromOpac CanBookBeReserved IsAvailableForItemLevelRequest MoveReserve ChargeReserveFee RevertWaitingStatus CanItemBeReserved MergeHolds ); use Koha::ActionLogs; use Koha::Caches; use Koha::DateUtils; --- a/t/db_dependent/Reserves/AutoUnsuspendReserves.t +++ a/t/db_dependent/Reserves/AutoUnsuspendReserves.t @@ -22,7 +22,7 @@ use Test::More tests => 1; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Reserves; +use C4::Reserves qw( AutoUnsuspendReserves ); use Koha::Database; use Koha::DateUtils; use Koha::Holds; --- a/t/db_dependent/Reserves/CancelExpiredReserves.t +++ a/t/db_dependent/Reserves/CancelExpiredReserves.t @@ -7,7 +7,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Members; -use C4::Reserves; +use C4::Reserves qw( CancelExpiredReserves ); use Koha::Database; use Koha::DateUtils; use Koha::Holds; --- a/t/db_dependent/Reserves/GetReserveFee.t +++ a/t/db_dependent/Reserves/GetReserveFee.t @@ -26,8 +26,8 @@ use Test::MockModule; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Circulation; -use C4::Reserves qw|AddReserve|; +use C4::Circulation qw( AddIssue ); +use C4::Reserves qw( GetReserveFee ChargeReserveFee AddReserve ); use Koha::Database; my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Reserves/MultiplePerRecord.t +++ a/t/db_dependent/Reserves/MultiplePerRecord.t @@ -23,7 +23,7 @@ use Test::More tests => 16; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Reserves qw( GetMaxPatronHoldsForRecord AddReserve CanBookBeReserved ); +use C4::Reserves qw( GetMaxPatronHoldsForRecord CanBookBeReserved AddReserve ); use Koha::Database; use Koha::Holds; --- a/t/db_dependent/RotatingCollections.t +++ a/t/db_dependent/RotatingCollections.t @@ -19,8 +19,8 @@ use Modern::Perl; use Test::More tests => 53; use C4::Context; -use C4::RotatingCollections; -use C4::Biblio; +use C4::RotatingCollections qw( AddItemToCollection CreateCollection DeleteCollection GetCollection GetCollectionItemBranches GetCollections GetItemsInCollection RemoveItemFromCollection TransferCollection UpdateCollection isItemInAnyCollection isItemInThisCollection ); +use C4::Biblio qw( AddBiblio ); use Koha::Database; use Koha::Library; --- a/t/db_dependent/SIP/ILS.t +++ a/t/db_dependent/SIP/ILS.t @@ -25,8 +25,8 @@ use Test::More tests => 13; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Reserves; -use C4::Circulation; +use C4::Reserves qw( AddReserve ); +use C4::Circulation qw( AddIssue ); use Koha::CirculationRules; use Koha::Database; use Koha::DateUtils; --- a/t/db_dependent/SIP/Message.t +++ a/t/db_dependent/SIP/Message.t @@ -30,7 +30,7 @@ use Test::Warn; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Reserves qw(AddReserve); +use C4::Reserves qw( AddReserve ); use C4::Circulation qw( AddReturn ); use Koha::Database; use Koha::AuthUtils qw(hash_password); --- a/t/db_dependent/SIP/SIPServer.t +++ a/t/db_dependent/SIP/SIPServer.t @@ -37,7 +37,7 @@ BEGIN { $mockPrefork->mock( 'run', sub {} ); } -use C4::SIP::SIPServer; +use C4::SIP::SIPServer qw( get_timeout ); # Start testing ! # TODO We should include more tests here. --- a/t/db_dependent/SIP/Transaction.t +++ a/t/db_dependent/SIP/Transaction.t @@ -18,7 +18,7 @@ use C4::SIP::ILS::Transaction::Hold; use C4::SIP::ILS::Transaction::Checkout; use C4::SIP::ILS::Transaction::Checkin; -use C4::Reserves; +use C4::Reserves qw( AddReserve ModReserve ModReserveAffect RevertWaitingStatus ); use Koha::CirculationRules; use Koha::Item::Transfer; use Koha::DateUtils qw( dt_from_string output_pref ); --- a/t/db_dependent/Search.t +++ a/t/db_dependent/Search.t @@ -262,7 +262,7 @@ sub run_marc21_search_tests { my $context = C4::Context->new("$datadir/etc/koha-conf.xml"); $context->set_context(); - use_ok('C4::Search'); + use_ok('C4::Search', qw( getIndexes FindDuplicate SimpleSearch getRecords buildQuery searchResults )); # set search syspreferences to a known starting point $QueryStemming = 0; @@ -836,7 +836,7 @@ sub run_unimarc_search_tests { my $context = C4::Context->new("$datadir/etc/koha-conf.xml"); $context->set_context(); - use_ok('C4::Search'); + use_ok('C4::Search', qw( getIndexes FindDuplicate SimpleSearch getRecords buildQuery searchResults )); # set search syspreferences to a known starting point $QueryStemming = 0; @@ -859,7 +859,7 @@ sub run_unimarc_search_tests { is($total_hits, 1, 'UNIMARC generic item index (bug 10037)'); # authority records - use_ok('C4::AuthoritiesMarc'); + use_ok('C4::AuthoritiesMarc', qw( SearchAuthorities )); my ($auths, $count) = SearchAuthorities( ['mainentry'], ['and'], [''], ['contains'], --- a/t/db_dependent/Search/History.t +++ a/t/db_dependent/Search/History.t @@ -8,7 +8,7 @@ use List::MoreUtils qw/all any none/; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Auth; +use C4::Auth qw( get_session checkauth get_template_and_user ); use Koha::Database; use Test::More tests => 27; @@ -28,7 +28,7 @@ my $dbh = C4::Context->dbh; t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); use_ok('Koha::DateUtils'); -use_ok('C4::Search::History'); +use_ok('C4::Search::History', qw( add get delete get_from_session )); my $userid = 123; my $previous_sessionid = "PREVIOUS_SESSIONID"; --- a/t/db_dependent/Serials.t +++ a/t/db_dependent/Serials.t @@ -5,12 +5,12 @@ use Modern::Perl; -use C4::Serials; +use C4::Serials qw( updateClaim NewSubscription GetSubscription GetSubscriptionHistoryFromSubscriptionId SearchSubscriptions ModSubscription GetExpirationDate GetSerials GetSerialInformation NewIssue AddItem2Serial DelSubscription GetFullSubscription PrepareSerialsData GetSubscriptionsFromBiblionumber ModSubscriptionHistory GetSerials2 GetLatestSerials GetNextSeq GetSeq CountSubscriptionFromBiblionumber ModSerialStatus findSerialsByStatus HasSubscriptionStrictlyExpired HasSubscriptionExpired GetLateOrMissingIssues check_routing addroutingmember GetNextDate ); use C4::Serials::Frequency; use C4::Serials::Numberpattern; -use C4::Biblio; -use C4::Budgets; -use C4::Items; +use C4::Biblio qw( AddBiblio GetMarcFromKohaField ); +use C4::Budgets qw( AddBudgetPeriod AddBudget ); +use C4::Items qw( AddItemFromMarc ); use Koha::Database; use Koha::DateUtils; use Koha::Acquisition::Booksellers; @@ -19,7 +19,7 @@ use t::lib::TestBuilder; use Test::More tests => 49; BEGIN { - use_ok('C4::Serials'); + use_ok('C4::Serials', qw( updateClaim NewSubscription GetSubscription GetSubscriptionHistoryFromSubscriptionId SearchSubscriptions ModSubscription GetExpirationDate GetSerials GetSerialInformation NewIssue AddItem2Serial DelSubscription GetFullSubscription PrepareSerialsData GetSubscriptionsFromBiblionumber ModSubscriptionHistory GetSerials2 GetLatestSerials GetNextSeq GetSeq CountSubscriptionFromBiblionumber ModSerialStatus findSerialsByStatus HasSubscriptionStrictlyExpired HasSubscriptionExpired GetLateOrMissingIssues check_routing addroutingmember GetNextDate )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Serials/Claims.t +++ a/t/db_dependent/Serials/Claims.t @@ -2,10 +2,10 @@ use Modern::Perl; use Test::More tests => 17; use C4::Acquisition; -use C4::Budgets; +use C4::Budgets qw( AddBudgetPeriod AddBudget ); use Koha::Database; use Koha::Acquisition::Booksellers; -use_ok('C4::Serials'); +use_ok('C4::Serials', qw( GetSuppliersWithLateIssues NewSubscription GetLateOrMissingIssues updateClaim )); use Koha::DateUtils qw( dt_from_string output_pref ); --- a/t/db_dependent/Serials/Frequency.t +++ a/t/db_dependent/Serials/Frequency.t @@ -8,7 +8,7 @@ use Modern::Perl; my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; -use C4::Serials::Frequency; +use C4::Serials::Frequency qw( GetSubscriptionFrequencies DelSubscriptionFrequency GetSubscriptionFrequency ModSubscriptionFrequency AddSubscriptionFrequency ); # Start by deleting all frequencies. my @frequencies = GetSubscriptionFrequencies(); --- a/t/db_dependent/Serials/GetFictiveIssueNumber.t +++ a/t/db_dependent/Serials/GetFictiveIssueNumber.t @@ -6,7 +6,7 @@ use Modern::Perl; use Test::More tests => 5; use Koha::Database; -use C4::Serials; +use C4::Serials qw( GetFictiveIssueNumber GetSubscription ); use C4::Serials::Frequency; my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Serials/GetNextDate.t +++ a/t/db_dependent/Serials/GetNextDate.t @@ -4,7 +4,7 @@ use Modern::Perl; use Test::More tests => 102; use Koha::Database; -use C4::Serials; +use C4::Serials qw( GetNextDate ); use C4::Serials::Frequency; my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Serials/GetNextSeq.t +++ a/t/db_dependent/Serials/GetNextSeq.t @@ -9,7 +9,7 @@ my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; use C4::Serials::Frequency; -use C4::Serials; +use C4::Serials qw( GetNextDate GetNextSeq ); my $frequency = { description => "One issue per day", --- a/t/db_dependent/Serials/Numberpattern.t +++ a/t/db_dependent/Serials/Numberpattern.t @@ -9,7 +9,7 @@ use Koha::Database; my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; -use C4::Serials::Numberpattern; +use C4::Serials::Numberpattern qw( GetSubscriptionNumberpatterns GetSubscriptionNumberpattern DelSubscriptionNumberpattern ModSubscriptionNumberpattern AddSubscriptionNumberpattern ); # Start by deleting all numberpatterns. my @numberpatterns = GetSubscriptionNumberpatterns(); --- a/t/db_dependent/Serials/ReNewSubscription.t +++ a/t/db_dependent/Serials/ReNewSubscription.t @@ -27,7 +27,7 @@ use Test::MockModule; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Serials; +use C4::Serials qw( NewSubscription ReNewSubscription GetSubscription GetSubscriptionLength ); use Koha::Database; use Koha::Subscription::Histories; --- a/t/db_dependent/Serials_2.t +++ a/t/db_dependent/Serials_2.t @@ -10,8 +10,8 @@ use Koha::Database; use Koha::Patrons; use t::lib::Mocks; use t::lib::TestBuilder; -use_ok('C4::Serials'); -use_ok('C4::Budgets'); +use_ok('C4::Serials', qw( NewSubscription GetSubscription NewIssue GetPreviousSerialid )); +use_ok('C4::Budgets', qw( AddBudgetPeriod AddBudget )); # Mock userenv local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /redefined/ }; --- a/t/db_dependent/ShelfBrowser.t +++ a/t/db_dependent/ShelfBrowser.t @@ -8,12 +8,12 @@ use MARC::Record; use C4::Context; use C4::Items; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use Koha::Database; use t::lib::TestBuilder; -use_ok('C4::ShelfBrowser'); +use_ok('C4::ShelfBrowser', qw( GetNearbyItems )); my $schema = Koha::Database->schema; $schema->storage->txn_begin; --- a/t/db_dependent/Stats.t +++ a/t/db_dependent/Stats.t @@ -1,13 +1,13 @@ #!/usr/bin/perl use Modern::Perl; -use C4::Stats; +use C4::Stats qw( UpdateStats ); use Koha::Database; use Test::More tests => 18; BEGIN { - use_ok('C4::Stats'); + use_ok('C4::Stats', qw( UpdateStats )); } can_ok( 'C4::Stats', --- a/t/db_dependent/Suggestions.t +++ a/t/db_dependent/Suggestions.t @@ -25,7 +25,7 @@ use t::lib::Mocks; use t::lib::TestBuilder; use C4::Context; -use C4::Letters; +use C4::Letters qw( GetQueuedMessages GetMessage ); use C4::Budgets qw( AddBudgetPeriod AddBudget GetBudget ); use Koha::Database; use Koha::DateUtils qw( dt_from_string output_pref ); @@ -34,7 +34,7 @@ use Koha::Patrons; use Koha::Suggestions; BEGIN { - use_ok('C4::Suggestions'); + use_ok('C4::Suggestions', qw( NewSuggestion GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionFromBiblionumber GetSuggestionInfoFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio SearchSuggestion DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/Tags.t +++ a/t/db_dependent/Tags.t @@ -30,7 +30,7 @@ use Koha::Tags; use Koha::Tags::Approvals; use Koha::Tags::Indexes; -use C4::Tags; +use C4::Tags qw( add_tag_approval add_tag add_tag_index get_tag_rows get_tag stratify_tags ); # So any output is readable :-D binmode STDOUT, ':encoding(utf8)'; --- a/t/db_dependent/Templates.t +++ a/t/db_dependent/Templates.t @@ -27,10 +27,10 @@ use File::Temp qw/tempfile/; use t::lib::Mocks; -use C4::Auth qw//; +use C4::Auth qw( get_template_and_user ); BEGIN { - use_ok( 'C4::Templates' ); + use_ok('C4::Templates', qw( GetColumnDefs getlanguagecookie setlanguagecookie themelanguage gettemplate param output availablethemes badtemplatecheck )); can_ok( 'C4::Templates', qw/ GetColumnDefs getlanguagecookie --- a/t/db_dependent/UsageStats.t +++ a/t/db_dependent/UsageStats.t @@ -25,11 +25,11 @@ use Koha::Biblios; use Koha::Libraries; BEGIN { - use_ok('C4::UsageStats'); + use_ok('C4::UsageStats', qw( NeedUpdate BuildReport ReportToCommunity _count )); use_ok('C4::Context'); - use_ok('C4::Biblio'); + use_ok('C4::Biblio', qw( UpdateTotalIssues )); use_ok( 'C4::AuthoritiesMarc', qw(AddAuthority) ); - use_ok('C4::Reserves'); + use_ok('C4::Reserves', qw( AddReserve )); use_ok('MARC::Record'); use_ok('Koha::Acquisition::Orders'); } --- a/t/db_dependent/Utils/Datatables.t +++ a/t/db_dependent/Utils/Datatables.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 1; -use C4::Utils::DataTables; +use C4::Utils::DataTables qw( dt_build_orderby ); use t::lib::Mocks; use t::lib::TestBuilder; --- a/t/db_dependent/Utils/Datatables_Virtualshelves.t +++ a/t/db_dependent/Utils/Datatables_Virtualshelves.t @@ -19,7 +19,7 @@ use Modern::Perl; use Test::More tests => 13; -use C4::Biblio; +use C4::Biblio qw( AddBiblio ); use C4::Context; use Koha::Library; --- a/t/db_dependent/XISBN.t +++ a/t/db_dependent/XISBN.t @@ -8,8 +8,8 @@ use Modern::Perl; use Test::More tests => 6; use List::MoreUtils qw(any none); use MARC::Record; -use C4::Biblio; -use C4::XISBN; +use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); +use C4::XISBN qw( get_xisbns ); use C4::Context; use C4::Search; use Koha::Database; @@ -17,7 +17,7 @@ use t::lib::Mocks; use Test::MockModule; BEGIN { - use_ok('C4::XISBN'); + use_ok('C4::XISBN', qw( get_xisbns )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/XSLT.t +++ a/t/db_dependent/XSLT.t @@ -26,7 +26,7 @@ use t::lib::Mocks; use Koha::ItemTypes; BEGIN { - use_ok('C4::XSLT'); + use_ok('C4::XSLT', qw( transformMARCXML4XSLT getAuthorisedValues4MARCSubfields buildKohaItemsNamespace )); } my $schema = Koha::Database->new->schema; --- a/t/db_dependent/api/v1/auth.t +++ a/t/db_dependent/api/v1/auth.t @@ -24,7 +24,7 @@ use Test::Warn; use t::lib::TestBuilder; use t::lib::Mocks; -use C4::Auth; +use C4::Auth qw( get_session ); use Koha::Database; my $schema = Koha::Database->new->schema; --- a/t/db_dependent/api/v1/checkouts.t +++ a/t/db_dependent/api/v1/checkouts.t @@ -26,7 +26,7 @@ use t::lib::TestBuilder; use DateTime; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( AddIssue AddReturn ); use Koha::Database; use Koha::DateUtils; --- a/t/db_dependent/api/v1/holds.t +++ a/t/db_dependent/api/v1/holds.t @@ -28,7 +28,7 @@ use Mojo::JSON qw(encode_json); use C4::Context; use Koha::Patrons; -use C4::Reserves; +use C4::Reserves qw( AddReserve CanItemBeReserved CanBookBeReserved ); use C4::Items; use Koha::Database; --- a/t/db_dependent/api/v1/return_claims.t +++ a/t/db_dependent/api/v1/return_claims.t @@ -24,7 +24,7 @@ use Test::Warn; use t::lib::Mocks; use t::lib::TestBuilder; -use C4::Circulation qw(AddIssue); +use C4::Circulation qw( AddIssue ); use Koha::Checkouts::ReturnClaims; use Koha::Database; --- a/t/db_dependent/rollingloans.t +++ a/t/db_dependent/rollingloans.t @@ -2,7 +2,7 @@ use Modern::Perl; use C4::Context; -use C4::Circulation; +use C4::Circulation qw( CanBookBeIssued AddIssue AddReturn ); use C4::Members; use C4::Items; use Koha::DateUtils; --- a/t/db_dependent/selenium/basic_workflow.t +++ a/t/db_dependent/selenium/basic_workflow.t @@ -37,7 +37,7 @@ use Modern::Perl; use Time::HiRes qw(gettimeofday); use POSIX qw(strftime); use C4::Context; -use C4::Biblio qw( AddBiblio ); # We shouldn't use it +use C4::Biblio qw( AddBiblio ); use Koha::CirculationRules; --- a/t/db_dependent/selenium/regressions.t +++ a/t/db_dependent/selenium/regressions.t @@ -25,7 +25,7 @@ use Test::MockModule; use C4::Context; use C4::Biblio qw( AddBiblio ); -use C4::Circulation; +use C4::Circulation qw( AddIssue ); use Koha::AuthUtils; use t::lib::Mocks; use t::lib::Selenium; --- a/t/db_dependent/www/regressions.t +++ a/t/db_dependent/www/regressions.t @@ -23,7 +23,7 @@ use t::lib::TestBuilder; use t::lib::Mocks; use C4::Context; -use C4::Biblio; +use C4::Biblio qw( ModBiblio ); use Koha::Database; use Koha::Caches; --- a/t/db_dependent/zebra_config.pl +++ a/t/db_dependent/zebra_config.pl @@ -2,10 +2,10 @@ use Modern::Perl; -use File::Copy; -use File::Path qw(make_path); -use File::Find; -use File::Basename; +use File::Copy qw( copy ); +use File::Path qw( make_path ); +use File::Find qw( find ); +use File::Basename qw( dirname ); use File::Spec; use C4::Context; --- a/t/lib/Dates.pm +++ a/t/lib/Dates.pm @@ -1,7 +1,7 @@ package t::lib::Dates; use Modern::Perl; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use DateTime; =head1 NAME --- a/t/lib/Koha/BackgroundJob/BatchTest.pm +++ a/t/lib/Koha/BackgroundJob/BatchTest.pm @@ -16,7 +16,7 @@ package t::lib::Koha::BackgroundJob::BatchTest; # along with Koha; if not, see . use Modern::Perl; -use JSON qw( encode_json decode_json ); +use JSON qw( decode_json encode_json ); use Koha::BackgroundJobs; use Koha::DateUtils qw( dt_from_string ); --- a/t/lib/Koha/Plugin/BadAPIRoute.pm +++ a/t/lib/Koha/Plugin/BadAPIRoute.pm @@ -2,7 +2,7 @@ package Koha::Plugin::BadAPIRoute; use Modern::Perl; -use Mojo::JSON qw(decode_json); +use Mojo::JSON qw( decode_json ); use base qw(Koha::Plugins::Base); --- a/t/lib/Koha/Plugin/Test.pm +++ a/t/lib/Koha/Plugin/Test.pm @@ -6,7 +6,7 @@ use Modern::Perl; use Koha::Exceptions::Exception; use Koha::Plugins::Tab; -use Mojo::JSON qw(decode_json); +use Mojo::JSON qw( decode_json ); ## Required for all plugins use base qw(Koha::Plugins::Base); --- a/t/lib/Mocks.pm +++ a/t/lib/Mocks.pm @@ -16,7 +16,7 @@ package t::lib::Mocks; # along with Koha; if not, see . use Modern::Perl; -use C4::Context; +use C4::Context qw( config new preference userenv _new_userenv set_userenv ); use Test::MockModule; use Test::MockObject; --- a/t/lib/Selenium.pm +++ a/t/lib/Selenium.pm @@ -18,10 +18,8 @@ package t::lib::Selenium; use Modern::Perl; use Carp qw( croak ); -use JSON qw( from_json ); -use File::Slurp qw( write_file ); -use C4::Context; +use C4::Context qw( new config preference interface ); use base qw(Class::Accessor); __PACKAGE__->mk_accessors(qw(login password base_url opac_base_url selenium_addr selenium_port driver)); --- a/t/lib/TestBuilder.pm +++ a/t/lib/TestBuilder.pm @@ -2,16 +2,15 @@ package t::lib::TestBuilder; use Modern::Perl; -use Koha::Database; -use C4::Biblio; -use C4::Items; -use Koha::Biblios; -use Koha::Items; +use Koha::Database qw( schema ); +use C4::Biblio qw( AddBiblio ); +use Koha::Biblios qw( _type ); +use Koha::Items qw( _type ); use Koha::DateUtils qw( dt_from_string ); use Bytes::Random::Secure; -use Carp; -use Module::Load; +use Carp qw( carp ); +use Module::Load qw( load ); use String::Random; use constant { --- a/tags/list.pl +++ a/tags/list.pl @@ -20,13 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw(:DEFAULT check_cookie_auth); -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetBiblioData ); use C4::Context; -use C4::Items; -use C4::Koha; -use C4::Tags qw(get_tags remove_tag get_tag_rows); -use C4::Output; +use C4::Items qw( GetItemsInfo ); +use C4::Tags qw( get_tag_rows get_tags remove_tag ); +use C4::Output qw( output_html_with_http_headers ); my $needed_flags = { tools => 'moderate_tags' }; # FIXME: replace when more specific permission is created. --- a/tags/review.pl +++ a/tags/review.pl @@ -20,17 +20,21 @@ # along with Koha; if not, see . use Modern::Perl; -use Data::Dumper; -use POSIX; +use POSIX qw( ceil exit ); use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request -use URI::Escape; -use C4::Auth qw(:DEFAULT check_cookie_auth); +use URI::Escape qw( uri_escape_utf8 ); +use C4::Auth qw( check_cookie_auth get_template_and_user ); use C4::Context; -use Koha::DateUtils; -# use C4::Koha; -use C4::Output qw(:html :ajax pagination_bar); -use C4::Tags qw(get_tags get_approval_rows approval_counts whitelist blacklist is_approved); +use Koha::DateUtils qw( dt_from_string output_pref ); +use C4::Output qw( output_with_http_headers is_ajax pagination_bar output_html_with_http_headers ); +use C4::Tags qw( + approval_counts + blacklist + get_approval_rows + is_approved + whitelist +); my $script_name = "/cgi-bin/koha/tags/review.pl"; my $needed_flags = { tools => 'moderate_tags' }; # FIXME: replace when more specific permission is created. --- a/tools/access_files.pl +++ a/tools/access_files.pl @@ -23,14 +23,13 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI; use C4::Context; -use C4::Output; -use C4::Koha; -use File::stat qw(stat); -use Digest::MD5 qw(md5_hex); -use Encode; +use C4::Output qw( output_html_with_http_headers ); +use File::stat qw( stat ); +use Digest::MD5 qw( md5_hex ); +use Encode qw( decode ); my $input = CGI->new; my $file_id = $input->param("id"); --- a/tools/ajax-inventory.pl +++ a/tools/ajax-inventory.pl @@ -2,7 +2,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( check_api_auth ); use C4::Items qw( ModDateLastSeen ); my $input = CGI->new; --- a/tools/automatic_item_modification_by_age.pl +++ a/tools/automatic_item_modification_by_age.pl @@ -32,12 +32,11 @@ This script allows a user to update the new status for items. use Modern::Perl; use CGI; -use JSON qw( to_json from_json ); +use JSON qw( to_json ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Items; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use C4::Koha; use Koha::Items; --- a/tools/background-job-progress.pl +++ a/tools/background-job-progress.pl @@ -20,11 +20,10 @@ use Modern::Perl; # standard or CPAN modules used -use IO::File; use CGI qw ( -utf8 ); use CGI::Session; use C4::Context; -use C4::Auth qw/check_cookie_auth/; +use C4::Auth qw( check_cookie_auth ); use C4::BackgroundJob; use CGI::Cookie; # need to check cookies before # having CGI parse the POST request --- a/tools/batchMod.pl +++ a/tools/batchMod.pl @@ -20,26 +20,32 @@ use CGI qw ( -utf8 ); use Modern::Perl; -use Try::Tiny; - -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Circulation; +use Try::Tiny qw( catch try ); + +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Biblio qw( + DelBiblio + GetAuthorisedValueDesc + GetMarcFromKohaField + GetMarcStructure + IsMarcStructureInternal + TransformHtmlToXml +); +use C4::Items qw( GetItemsInfo Item2Marc ModItemFromMarc ); +use C4::Circulation qw( LostItem IsItemIssued ); use C4::Context; use C4::Koha; use C4::BackgroundJob; -use C4::ClassSource; -use C4::Members; +use C4::ClassSource qw( GetClassSources GetClassSource ); use MARC::File::XML; -use List::MoreUtils qw/uniq/; +use List::MoreUtils qw( uniq ); use Koha::Database; use Koha::Exceptions::Exception; use Koha::AuthorisedValues; use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::ItemTypes; use Koha::Patrons; --- a/tools/batch_delete_records.pl +++ a/tools/batch_delete_records.pl @@ -23,10 +23,10 @@ use Modern::Perl; use CGI; use List::MoreUtils qw( uniq ); -use C4::Auth; -use C4::Output; -use C4::AuthoritiesMarc; -use C4::Biblio; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); use Koha::Virtualshelves; use Koha::Authorities; --- a/tools/batch_record_modification.pl +++ a/tools/batch_record_modification.pl @@ -22,14 +22,15 @@ use Modern::Perl; use CGI; use List::MoreUtils qw( uniq ); -use JSON qw( encode_json ); -use Try::Tiny; +use Try::Tiny qw( catch try ); use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); -use C4::AuthoritiesMarc qw( BuildSummary ModAuthority ); -use C4::Biblio qw( GetMarcBiblio ModBiblio ); -use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModificationTemplates ); +use C4::Auth qw( get_template_and_user ); +use C4::MarcModificationTemplates qw( + GetModificationTemplateActions + GetModificationTemplates +); use Koha::Biblios; use Koha::BackgroundJob::BatchUpdateBiblio; --- a/tools/batch_records_ajax.pl +++ a/tools/batch_records_ajax.pl @@ -32,12 +32,11 @@ the records from an import batch. use Modern::Perl; use CGI qw ( -utf8 ); -use JSON qw/ to_json /; +use JSON qw( to_json ); use C4::Context; -use C4::Charset; -use C4::Auth qw/check_cookie_auth/; -use C4::ImportBatch; +use C4::Auth qw( check_cookie_auth ); +use C4::ImportBatch qw( GetImportBatch GetImportRecordsRange GetImportRecordMatches ); my $input = CGI->new; --- a/tools/cleanborrowers.pl +++ a/tools/cleanborrowers.pl @@ -34,16 +34,13 @@ This script allows to do 2 things. use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Members; -use C4::Circulation; # AnonymiseIssueHistory. +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Members qw( GetBorrowersToExpunge ); use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::Patron::Categories; use Koha::Patrons; -use Date::Calc qw/Today Add_Delta_YM/; -use Koha::Patrons; -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); my $cgi = CGI->new; --- a/tools/copy-holidays.pl +++ a/tools/copy-holidays.pl @@ -21,7 +21,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Output; --- a/tools/csv-profiles.pl +++ a/tools/csv-profiles.pl @@ -37,11 +37,10 @@ This script allow the user to define a new profile for CSV export use Modern::Perl; use Encode; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use CGI qw ( -utf8 ); -use C4::Koha; use Koha::CsvProfiles; my $input = CGI->new; --- a/tools/exceptionHolidays.pl +++ a/tools/exceptionHolidays.pl @@ -4,12 +4,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Output; use DateTime; use C4::Calendar; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); my $input = CGI->new; my $dbh = C4::Context->dbh(); --- a/tools/export.pl +++ a/tools/export.pl @@ -19,15 +19,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); use MARC::File::XML; -use List::MoreUtils qw(uniq); -use C4::Auth; -use C4::Output; +use List::MoreUtils qw( uniq ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Authority::Types; use Koha::Biblioitems; use Koha::CsvProfiles; use Koha::Database; -use Koha::DateUtils qw( dt_from_string output_pref ); +use Koha::DateUtils qw( dt_from_string ); use Koha::Exporter::Record; use Koha::ItemTypes; use Koha::Libraries; --- a/tools/holidays.pl +++ a/tools/holidays.pl @@ -20,11 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use C4::Calendar; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; --- a/tools/import_borrowers.pl +++ a/tools/import_borrowers.pl @@ -36,16 +36,16 @@ use Modern::Perl; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Templates; use Koha::Patrons; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Token; use Koha::Libraries; use Koha::Patron::Categories; use Koha::Patron::Attribute::Types; -use Koha::List::Patron; +use Koha::List::Patron qw( AddPatronList AddPatronsToList ); use Koha::Patrons::Import; my $Import = Koha::Patrons::Import->new(); --- a/tools/inventory.pl +++ a/tools/inventory.pl @@ -26,18 +26,17 @@ my $input = CGI->new; my $uploadbarcodes = $input->param('uploadbarcodes'); my $barcodelist = $input->param('barcodelist'); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Biblio; -use C4::Items; -use C4::Koha; -use C4::Circulation; -use C4::Reports::Guided; #_get_column_defs -use C4::Charset; +use C4::Output qw( output_html_with_http_headers ); +use C4::Items qw( GetItemsForInventory ); +use C4::Koha qw( GetAuthorisedValues ); +use C4::Circulation qw( AddReturn ); +use C4::Reports::Guided qw( ); +use C4::Charset qw( NormalizeString ); use Koha::Biblios; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::AuthorisedValues; use Koha::BiblioFrameworks; use Koha::ClassSources; @@ -371,7 +370,7 @@ $template->param( # Export to csv if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){ - eval {use Text::CSV}; + eval {use Text::CSV ();}; my $csv = Text::CSV->new or die Text::CSV->error_diag (); binmode STDOUT, ":encoding(UTF-8)"; --- a/tools/koha-news.pl +++ a/tools/koha-news.pl @@ -24,13 +24,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Languages qw(getTranslatedLanguages); -use Date::Calc qw/Date_to_Days Today/; -use Koha::DateUtils; +use C4::Output qw( output_html_with_http_headers ); +use C4::Languages qw( getTranslatedLanguages ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Koha::News; my $cgi = CGI->new; --- a/tools/letter.pl +++ a/tools/letter.pl @@ -42,11 +42,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use C4::Letters; -use C4::Log; +use C4::Output qw( output_html_with_http_headers ); +use C4::Letters qw( GetMessageTransportTypes ); +use C4::Log qw( logaction ); use Koha::Notice::Templates; use Koha::Patron::Attribute::Types; --- a/tools/manage-marc-import.pl +++ a/tools/manage-marc-import.pl @@ -27,11 +27,9 @@ use MARC::File::USMARC; # Koha modules used use C4::Context; use C4::Koha; -use C4::Auth; -use C4::AuthoritiesMarc; -use C4::Output; -use C4::Biblio; -use C4::ImportBatch; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::ImportBatch qw( CleanBatch DeleteBatch GetImportBatch GetImportBatchOverlayAction GetImportBatchNoMatchAction GetImportBatchItemAction SetImportBatchOverlayAction SetImportBatchNoMatchAction SetImportBatchItemAction BatchFindDuplicates SetImportBatchMatcher GetItemNumbersFromImportBatch GetImportBatchRangeDesc GetNumberOfNonZ3950ImportBatches BatchCommitRecords BatchRevertRecords ); use C4::Matcher; use C4::BackgroundJob; use C4::Labels::Batch; --- a/tools/marc_modification_templates.pl +++ a/tools/marc_modification_templates.pl @@ -20,10 +20,18 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; -use C4::Output; -use C4::MarcModificationTemplates; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::MarcModificationTemplates qw( + AddModificationTemplate + AddModificationTemplateAction + DelModificationTemplate + DelModificationTemplateAction + GetModificationTemplateActions + GetModificationTemplates + ModModificationTemplateAction + MoveModificationTemplateAction +); my $cgi = CGI->new; --- a/tools/modborrowers.pl +++ a/tools/modborrowers.pl @@ -27,16 +27,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); +use C4::Koha qw( GetAuthorisedValues ); use C4::Members; -use C4::Output; -use List::MoreUtils qw /any uniq/; +use C4::Output qw( output_html_with_http_headers ); use Koha::DateUtils qw( dt_from_string ); -use Koha::List::Patron; +use Koha::List::Patron qw( GetPatronLists ); use Koha::Libraries; use Koha::Patron::Categories; -use Koha::Patron::Debarments; +use Koha::Patron::Debarments qw( AddDebarment DelDebarment GetDebarments ); use Koha::Patrons; my $input = CGI->new; --- a/tools/newHolidays.pl +++ a/tools/newHolidays.pl @@ -21,12 +21,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; +use C4::Auth qw( checkauth ); use C4::Output; use C4::Calendar; use DateTime; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string output_pref ); my $input = CGI->new; my $dbh = C4::Context->dbh(); --- a/tools/overduerules.pl +++ a/tools/overduerules.pl @@ -20,12 +20,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Koha; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use C4::Letters; use C4::Members; -use C4::Overdues; +use C4::Overdues qw( GetOverdueMessageTransportTypes ); use Koha::Libraries; use Koha::Patron::Categories; --- a/tools/picture-upload.pl +++ a/tools/picture-upload.pl @@ -22,12 +22,11 @@ use Modern::Perl; use File::Temp; -use File::Copy; use CGI qw ( -utf8 ); use GD; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_and_exit output_html_with_http_headers ); use C4::Members; use Koha::Logger; --- a/tools/problem-reports.pl +++ a/tools/problem-reports.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::ProblemReports; my $query = CGI->new; --- a/tools/quotes-upload.pl +++ a/tools/quotes-upload.pl @@ -22,10 +22,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); use autouse 'Data::Dumper' => qw(Dumper); -use C4::Auth; -use C4::Koha; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); my $cgi = CGI->new; --- a/tools/quotes.pl +++ a/tools/quotes.pl @@ -18,11 +18,11 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Try::Tiny; +use Try::Tiny qw( catch try ); -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Quotes; my $input = CGI->new; --- a/tools/scheduler.pl +++ a/tools/scheduler.pl @@ -19,12 +19,12 @@ use Modern::Perl; use C4::Context; -use C4::Scheduler; -use C4::Reports::Guided; -use C4::Auth; +use C4::Scheduler qw( add_at_job get_jobs remove_at_job ); +use C4::Reports::Guided qw( get_saved_reports ); +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); -use C4::Output; -use Koha::DateUtils;; +use C4::Output qw( output_html_with_http_headers ); +use Koha::DateUtils qw( dt_from_string output_pref );; my $input = CGI->new; my $base; --- a/tools/showdiffmarc.pl +++ a/tools/showdiffmarc.pl @@ -26,11 +26,11 @@ use CGI qw(:standard -utf8); # Koha modules used use C4::Context; -use C4::Output; -use C4::Auth; -use C4::Biblio; -use C4::AuthoritiesMarc; -use C4::ImportBatch; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Auth qw( get_template_and_user ); +use C4::ImportBatch qw( GetRecordFromImportBiblio GetImportBiblios ); use Koha::Biblios; --- a/tools/stage-marc-import.pl +++ a/tools/stage-marc-import.pl @@ -33,14 +33,13 @@ use MARC::File::USMARC; # Koha modules used use C4::Context; -use C4::Auth; -use C4::Output; -use C4::Biblio; -use C4::ImportBatch; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::ImportBatch qw( RecordsFromMARCXMLFile RecordsFromISO2709File RecordsFromMarcPlugin BatchStageMarcRecords BatchFindDuplicates SetImportBatchMatcher SetImportBatchOverlayAction SetImportBatchNoMatchAction SetImportBatchItemAction ); use C4::Matcher; use Koha::UploadedFiles; use C4::BackgroundJob; -use C4::MarcModificationTemplates; +use C4::MarcModificationTemplates qw( GetModificationTemplates ); use Koha::Plugins; use Koha::ImportBatches; --- a/tools/stockrotation.pl +++ a/tools/stockrotation.pl @@ -27,16 +27,16 @@ use Modern::Perl; use CGI; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; +use C4::Output qw( output_html_with_http_headers ); use Koha::Libraries; use Koha::StockRotationRotas; use Koha::StockRotationItems; use Koha::StockRotationStages; use Koha::Item; -use Koha::Util::StockRotation qw(:ALL); +use Koha::Util::StockRotation qw( get_branches get_stages move_to_next_stage toggle_indemand remove_from_stage add_items_to_rota get_barcodes_status ); my $input = CGI->new; --- a/tools/tools-home.pl +++ a/tools/tools-home.pl @@ -18,9 +18,9 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Output; -use C4::Tags qw/get_count_by_tag_status/; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Tags qw( get_count_by_tag_status ); use Koha::Reviews; my $query = CGI->new; --- a/tools/upload-cover-image.pl +++ a/tools/upload-cover-image.pl @@ -43,13 +43,13 @@ use File::Temp; use CGI qw ( -utf8 ); use GD; use C4::Context; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Biblios; use Koha::CoverImages; use Koha::Items; use Koha::UploadedFiles; -use C4::Log; +use C4::Log qw( logaction ); my $input = CGI->new; --- a/tools/upload-file.pl +++ a/tools/upload-file.pl @@ -23,10 +23,10 @@ use CGI qw ( -utf8 ); use CGI::Cookie; use Encode; use JSON; -use URI::Escape; +use URI::Escape qw( uri_unescape ); use C4::Context; -use C4::Auth qw/check_cookie_auth haspermission/; +use C4::Auth qw( check_cookie_auth get_session ); use Koha::Uploader; # upload-file.pl must authenticate the user --- a/tools/upload.pl +++ a/tools/upload.pl @@ -21,8 +21,8 @@ use Modern::Perl; use CGI qw/-utf8/; use JSON; -use C4::Auth; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); use Koha::UploadedFiles; use constant ERR_READING => 'UPLERR_FILE_NOT_READ'; --- a/tools/viewlog.pl +++ a/tools/viewlog.pl @@ -20,19 +20,17 @@ use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use CGI qw ( -utf8 ); use Text::CSV::Encoded; use C4::Context; -use C4::Koha; -use C4::Output; -use C4::Items; -use C4::Serials; -use C4::Search; # enabled_staff_search_views +use C4::Output qw( output_html_with_http_headers ); +use C4::Serials qw( CountSubscriptionFromBiblionumber ); +use C4::Search qw( enabled_staff_search_views ); use Koha::ActionLogs; use Koha::Database; -use Koha::DateUtils; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::Patrons; --- a/virtualshelves/addbybiblionumber.pl +++ a/virtualshelves/addbybiblionumber.pl @@ -59,9 +59,8 @@ addbybiblionumber.pl use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Biblio; -use C4::Output; -use C4::Auth; +use C4::Output qw( output_html_with_http_headers ); +use C4::Auth qw( get_template_and_user ); use Koha::Biblios; use Koha::Virtualshelves; --- a/virtualshelves/downloadshelf.pl +++ a/virtualshelves/downloadshelf.pl @@ -20,14 +20,12 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw(encode); -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Output qw( output_html_with_http_headers ); use C4::Record; -use C4::Ris; +use C4::Ris qw( marc2ris ); use Koha::CsvProfiles; use Koha::Virtualshelves; --- a/virtualshelves/sendshelf.pl +++ a/virtualshelves/sendshelf.pl @@ -20,14 +20,20 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use Encode qw( encode ); -use Carp; -use Try::Tiny; - -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; +use Encode; +use Carp qw( carp ); +use Try::Tiny qw( catch try ); + +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( + GetBiblioData + GetMarcAuthors + GetMarcBiblio + GetMarcISBN + GetMarcSubjects +); +use C4::Items qw( GetItemsInfo ); +use C4::Output qw( output_html_with_http_headers ); use Koha::Email; use Koha::Virtualshelves; --- a/virtualshelves/shelves.pl +++ a/virtualshelves/shelves.pl @@ -19,12 +19,17 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth; -use C4::Biblio; -use C4::Koha; -use C4::Items; +use C4::Auth qw( get_template_and_user ); +use C4::Biblio qw( GetMarcBiblio ); +use C4::Koha qw( + GetNormalizedEAN + GetNormalizedISBN + GetNormalizedOCLCNumber + GetNormalizedUPC +); +use C4::Items qw( GetItemsLocationInfo ); use C4::Members; -use C4::Output; +use C4::Output qw( pagination_bar output_html_with_http_headers ); use C4::XSLT; use Koha::Biblios; --- a/xt/yaml_valid.pl +++ a/xt/yaml_valid.pl @@ -18,7 +18,7 @@ # along with Koha; if not, see . use Modern::Perl; -use Getopt::Long; +use Getopt::Long qw( GetOptions ); use YAML::XS; my $usage = <