From 88b33c98492bcbb95ebd37b75913d21cbffe7514 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 9 Nov 2016 12:06:44 +0000 Subject: [PATCH] Bug 17600: Standardize our EXPORT_OK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On bug 17591 we discovered that there was something weird going on with the way we export and use subroutines/modules. This patch tries to standardize our EXPORT to use EXPORT_OK only. That way we will need to explicitely define the subroutine we want to use from a module. This patch is a squashed version of: Bug 17600: After export.pl Bug 17600: After perlimport Bug 17600: Manual changes Bug 17600: Other manual changes after second perlimports run Bug 17600: Fix tests And a lot of other manual changes. export.pl is a dirty script that can be found on bug 17600. "perlimport" is: git clone https://github.com/oalders/App-perlimports.git cd App-perlimports/ cpanm --installdeps . export PERL5LIB="$PERL5LIB:/kohadevbox/koha/App-perlimports/lib" find . \( -name "*.pl" -o -name "*.pm" \) -exec perl App-perlimports/script/perlimports --inplace-edit --no-preserve-unused --filename {} \; The ideas of this patch are to: * use EXPORT_OK instead of EXPORT * perltidy the EXPORT_OK list * remove '&' before the subroutine names * remove some uneeded use statements * explicitely import the subroutines we need within the controllers or modules Note that the private subroutines (starting with _) should not be exported (and not used from outside of the module except from tests). EXPORT vs EXPORT_OK (from https://www.thegeekstuff.com/2010/06/perl-exporter-examples/) """ Export allows to export the functions and variables of modules to user’s namespace using the standard import method. This way, we don’t need to create the objects for the modules to access it’s members. @EXPORT and @EXPORT_OK are the two main variables used during export operation. @EXPORT contains list of symbols (subroutines and variables) of the module to be exported into the caller namespace. @EXPORT_OK does export of symbols on demand basis. """ If this patch caused a conflict with a patch you wrote prior to its push: * Make sure you are not reintroducing a "use" statement that has been removed * "$subroutine" is not exported by the C4::$MODULE module means that you need to add the subroutine to the @EXPORT_OK list * Bareword "$subroutine" not allowed while "strict subs" means that you didn't imported the subroutine from the module: - use $MODULE qw( $subroutine list ); You can also use the fully qualified namespace: C4::$MODULE::$subroutine Signed-off-by: Jonathan Druart --- 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(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index 7d7ac760184..ad0d34f184d 100644 --- a/C4/Accounts.pm +++ b/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 ); } diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 1d6f350487c..3d74f847a69 100644 --- a/C4/Acquisition.pm +++ b/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 ); } diff --git a/C4/Auth.pm b/C4/Auth.pm index 4ca4935ea13..133cb032600 100644 --- a/C4/Auth.pm +++ b/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'); diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm index 855766bd0f7..8c922ece6a5 100644 --- a/C4/Auth_with_cas.pm +++ b/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; diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index 296f4099eb4..7f6c99a9a46 100644 --- a/C4/Auth_with_ldap.pm +++ b/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: diff --git a/C4/Auth_with_shibboleth.pm b/C4/Auth_with_shibboleth.pm index e3af9eb9d82..e214a5307ce 100644 --- a/C4/Auth_with_shibboleth.pm +++ b/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); } diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 1bb808bb9c4..2b31146199f 100644 --- a/C4/AuthoritiesMarc.pm +++ b/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 + ); } diff --git a/C4/AuthoritiesMarc/MARC21.pm b/C4/AuthoritiesMarc/MARC21.pm index c704a682322..c3c6f847303 100644 --- a/C4/AuthoritiesMarc/MARC21.pm +++ b/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 diff --git a/C4/BackgroundJob.pm b/C4/BackgroundJob.pm index 48683f97659..733f72e11b1 100644 --- a/C4/BackgroundJob.pm +++ b/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; diff --git a/C4/Barcodes.pm b/C4/Barcodes.pm index bd50054949e..957d60f2835 100644 --- a/C4/Barcodes.pm +++ b/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')) { diff --git a/C4/Barcodes/EAN13.pm b/C4/Barcodes/EAN13.pm index c691b0ec083..7927d195369 100644 --- a/C4/Barcodes/EAN13.pm +++ b/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); diff --git a/C4/Barcodes/annual.pm b/C4/Barcodes/annual.pm index b0d46c13595..0d7e05ae00a 100644 --- a/C4/Barcodes/annual.pm +++ b/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); diff --git a/C4/Barcodes/hbyymmincr.pm b/C4/Barcodes/hbyymmincr.pm index 28cb3f81865..bd345a6d62d 100644 --- a/C4/Barcodes/hbyymmincr.pm +++ b/C4/Barcodes/hbyymmincr.pm @@ -19,7 +19,7 @@ package C4::Barcodes::hbyymmincr; use Modern::Perl; -use Carp; +use Carp qw( carp ); use C4::Context; diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 8aeef65c96c..ebebe415c85 100644 --- a/C4/Biblio.pm +++ b/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; diff --git a/C4/Breeding.pm b/C4/Breeding.pm index 6b103b3cdbd..ce99efeac8f 100644 --- a/C4/Breeding.pm +++ b/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 diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 15d7e0e05f7..888bd7bee49 100644 --- a/C4/Budgets.pm +++ b/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-----------------------------"; diff --git a/C4/Calendar.pm b/C4/Calendar.pm index 6a5d8a79a49..257119c8e32 100644 --- a/C4/Calendar.pm +++ b/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; diff --git a/C4/Charset.pm b/C4/Charset.pm index c215a56667c..e780cef4f0f 100644 --- a/C4/Charset.pm +++ b/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 diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 330b1bbaeb7..05492309640 100644 --- a/C4/Circulation.pm +++ b/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 diff --git a/C4/ClassSortRoutine.pm b/C4/ClassSortRoutine.pm index 77826cff1bd..248baa74a82 100644 --- a/C4/ClassSortRoutine.pm +++ b/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(); diff --git a/C4/ClassSortRoutine/Dewey.pm b/C4/ClassSortRoutine/Dewey.pm index 111bafb5373..eedf4ed768b 100644 --- a/C4/ClassSortRoutine/Dewey.pm +++ b/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); diff --git a/C4/ClassSortRoutine/Generic.pm b/C4/ClassSortRoutine/Generic.pm index 8b7d890394f..665dd53ca63 100644 --- a/C4/ClassSortRoutine/Generic.pm +++ b/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); diff --git a/C4/ClassSortRoutine/LCC.pm b/C4/ClassSortRoutine/LCC.pm index 5f9c8f9c6f8..b943fb683e2 100644 --- a/C4/ClassSortRoutine/LCC.pm +++ b/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); diff --git a/C4/ClassSource.pm b/C4/ClassSource.pm index 8c133bce704..e9487912e95 100644 --- a/C4/ClassSource.pm +++ b/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(); diff --git a/C4/ClassSplitRoutine.pm b/C4/ClassSplitRoutine.pm index cfa84033894..ed6f665170c 100644 --- a/C4/ClassSplitRoutine.pm +++ b/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 diff --git a/C4/Context.pm b/C4/Context.pm index db896ad4737..63187bf4b70 100644 --- a/C4/Context.pm +++ b/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; diff --git a/C4/Contract.pm b/C4/Contract.pm index 13b9538e271..2630af403e8 100644 --- a/C4/Contract.pm +++ b/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 diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm index 77945341a83..7f9a4aa7f61 100644 --- a/C4/CourseReserves.pm +++ b/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' ); } diff --git a/C4/Creators.pm b/C4/Creators.pm index 27043227f20..de81a8bc393 100644 --- a/C4/Creators.pm +++ b/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; } diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm index f64d871be0d..d4831ab4797 100644 --- a/C4/Creators/Lib.pm +++ b/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); diff --git a/C4/Creators/PDF.pm b/C4/Creators/PDF.pm index 9796feb8328..e90b0bd3d7d 100644 --- a/C4/Creators/PDF.pm +++ b/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 { diff --git a/C4/Creators/Profile.pm b/C4/Creators/Profile.pm index 2b2ab924b5a..cd1de4038b6 100644 --- a/C4/Creators/Profile.pm +++ b/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 { diff --git a/C4/Creators/Template.pm b/C4/Creators/Template.pm index 30d27dd3e7e..1636c16cfb3 100644 --- a/C4/Creators/Template.pm +++ b/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 { diff --git a/C4/External/BakerTaylor.pm b/C4/External/BakerTaylor.pm index d6957d8e100..13b2b5302e6 100644 --- a/C4/External/BakerTaylor.pm +++ b/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 diff --git a/C4/External/OverDrive.pm b/C4/External/OverDrive.pm index 897e2b3c48c..efc663f893a 100644 --- a/C4/External/OverDrive.pm +++ b/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; diff --git a/C4/External/Syndetics.pm b/C4/External/Syndetics.pm index 0570d0f7d6b..7788ee5f512 100644 --- a/C4/External/Syndetics.pm +++ b/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 ); } diff --git a/C4/Heading.pm b/C4/Heading.pm index c65c127736c..bd4eed27deb 100644 --- a/C4/Heading.pm +++ b/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 diff --git a/C4/Heading/MARC21.pm b/C4/Heading/MARC21.pm index 6a1a3346b2f..b021447c88e 100644 --- a/C4/Heading/MARC21.pm +++ b/C4/Heading/MARC21.pm @@ -19,7 +19,6 @@ package C4::Heading::MARC21; use strict; use warnings; -use MARC::Record; use MARC::Field; diff --git a/C4/Heading/UNIMARC.pm b/C4/Heading/UNIMARC.pm index b998433a438..9767f751a75 100644 --- a/C4/Heading/UNIMARC.pm +++ b/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; diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 3774214527e..06b0b2a2efa 100644 --- a/C4/HoldsQueue.pm +++ b/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 ); } diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index a28c382d683..54ef7837118 100644 --- a/C4/ILSDI/Services.pm +++ b/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; diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 2a5696d5132..9a4978f8fca 100644 --- a/C4/ImportBatch.pm +++ b/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 diff --git a/C4/ImportExportFramework.pm b/C4/ImportExportFramework.pm index 51c0aae7421..2ad5ac9b1c7 100644 --- a/C4/ImportExportFramework.pm +++ b/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 ); } diff --git a/C4/InstallAuth.pm b/C4/InstallAuth.pm index c3f5adcaa13..bb868aa33e9 100644 --- a/C4/InstallAuth.pm +++ b/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 diff --git a/C4/Installer.pm b/C4/Installer.pm index 2d6b523eed0..7aa85def4ab 100644 --- a/C4/Installer.pm +++ b/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 diff --git a/C4/Installer/PerlModules.pm b/C4/Installer/PerlModules.pm index 01ccc53fea9..f143bc6cc17 100644 --- a/C4/Installer/PerlModules.pm +++ b/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 { diff --git a/C4/Installer/UpgradeBackup.pm b/C4/Installer/UpgradeBackup.pm index 2ca97b66936..61aa6fb2d9d 100644 --- a/C4/Installer/UpgradeBackup.pm +++ b/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; diff --git a/C4/ItemCirculationAlertPreference.pm b/C4/ItemCirculationAlertPreference.pm index c7935163f22..45d30d95b7b 100644 --- a/C4/ItemCirculationAlertPreference.pm +++ b/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; diff --git a/C4/Items.pm b/C4/Items.pm index 1f0d560e86e..14774e48e17 100644 --- a/C4/Items.pm +++ b/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; diff --git a/C4/Koha.pm b/C4/Koha.pm index 8388005a172..681d6ff38f8 100644 --- a/C4/Koha.pm +++ b/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 diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm index deb7429bc6f..5f3a610079c 100644 --- a/C4/Labels/Label.pm +++ b/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; diff --git a/C4/Languages.pm b/C4/Languages.pm index 58cf16c1857..b9c7e6dce93 100644 --- a/C4/Languages.pm +++ b/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 diff --git a/C4/Letters.pm b/C4/Letters.pm index 6b86105cbc3..177a4f51f67 100644 --- a/C4/Letters.pm +++ b/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 ); } diff --git a/C4/Linker.pm b/C4/Linker.pm index 969d2eac99e..0648ee3e030 100644 --- a/C4/Linker.pm +++ b/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); diff --git a/C4/Linker/Default.pm b/C4/Linker/Default.pm index 934e87536a2..c5cbee0e704 100644 --- a/C4/Linker/Default.pm +++ b/C4/Linker/Default.pm @@ -19,7 +19,6 @@ package C4::Linker::Default; use strict; use warnings; -use Carp; use MARC::Field; use C4::Heading; diff --git a/C4/Linker/FirstMatch.pm b/C4/Linker/FirstMatch.pm index 13c852532a5..873395a3628 100644 --- a/C4/Linker/FirstMatch.pm +++ b/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 diff --git a/C4/Linker/LastMatch.pm b/C4/Linker/LastMatch.pm index 1109f7aaef5..1f873d8c5b4 100644 --- a/C4/Linker/LastMatch.pm +++ b/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 diff --git a/C4/Log.pm b/C4/Log.pm index dc3c63fa809..5a9077de0dd 100644 --- a/C4/Log.pm +++ b/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 diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm index a82dcbaed53..13b81ca0b41 100644 --- a/C4/MarcModificationTemplates.pm +++ b/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 ); } diff --git a/C4/Matcher.pm b/C4/Matcher.pm index 923b4accf1d..e8a8ec3f741 100644 --- a/C4/Matcher.pm +++ b/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 diff --git a/C4/Members.pm b/C4/Members.pm index 301e6f7e106..73b254cb5ee 100644 --- a/C4/Members.pm +++ b/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 ); } diff --git a/C4/Members/Statistics.pm b/C4/Members/Statistics.pm index e8c5d1fcdcd..8259dda3197 100644 --- a/C4/Members/Statistics.pm +++ b/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 ); } diff --git a/C4/Message.pm b/C4/Message.pm index e10e3c594b4..3a3216657bd 100644 --- a/C4/Message.pm +++ b/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 diff --git a/C4/OAI/Sets.pm b/C4/OAI/Sets.pm index 0ecdc77b7d9..ac9eb22dce7 100644 --- a/C4/OAI/Sets.pm +++ b/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 ); } diff --git a/C4/Output.pm b/C4/Output.pm index d57a80d32c8..09dc73d41dd 100644 --- a/C4/Output.pm +++ b/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 diff --git a/C4/Output/JSONStream.pm b/C4/Output/JSONStream.pm index 816ede80310..a16143c5349 100644 --- a/C4/Output/JSONStream.pm +++ b/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; diff --git a/C4/Overdues.pm b/C4/Overdues.pm index e76cf79fcee..54a42649f72 100644 --- a/C4/Overdues.pm +++ b/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 ); } diff --git a/C4/Patroncards.pm b/C4/Patroncards.pm index 98fb59c28b0..7358b29075a 100644 --- a/C4/Patroncards.pm +++ b/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; diff --git a/C4/Patroncards/Patroncard.pm b/C4/Patroncards/Patroncard.pm index 6482198d322..92511474202 100644 --- a/C4/Patroncards/Patroncard.pm +++ b/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 diff --git a/C4/Record.pm b/C4/Record.pm index 0c3c670ef30..d2377edd030 100644 --- a/C4/Record.pm +++ b/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 diff --git a/C4/Reports.pm b/C4/Reports.pm index 4d566b01412..ef1f00417eb 100644 --- a/C4/Reports.pm +++ b/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 ); } diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index 113d1b5447d..6611393ca05 100644 --- a/C4/Reports/Guided.pm +++ b/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 ); } diff --git a/C4/Reserves.pm b/C4/Reserves.pm index dfd0c70568c..54d2b00cb00 100644 --- a/C4/Reserves.pm +++ b/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 diff --git a/C4/Ris.pm b/C4/Ris.pm index 867030c73c0..9ab50d924b3 100644 --- a/C4/Ris.pm +++ b/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; diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm index 2732a69b808..a1f8df740d6 100644 --- a/C4/RotatingCollections.pm +++ b/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 ); } diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm index 13509cc6bd5..3cacc3aa44c 100644 --- a/C4/SIP/ILS.pm +++ b/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; diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index b2063a48bc5..48df606cad1 100644 --- a/C4/SIP/ILS/Item.pm +++ b/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; diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm index 83b66d778b0..a4e09304aca 100644 --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ b/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; diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm index b321a248760..f5c88766ca1 100644 --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ b/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; diff --git a/C4/SIP/ILS/Transaction/Hold.pm b/C4/SIP/ILS/Transaction/Hold.pm index 2bc1133e8d0..82fddf1e970 100644 --- a/C4/SIP/ILS/Transaction/Hold.pm +++ b/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, diff --git a/C4/SIP/ILS/Transaction/Renew.pm b/C4/SIP/ILS/Transaction/Renew.pm index e950424d74c..9e5579ee874 100644 --- a/C4/SIP/ILS/Transaction/Renew.pm +++ b/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; diff --git a/C4/SIP/ILS/Transaction/RenewAll.pm b/C4/SIP/ILS/Transaction/RenewAll.pm index 23d552b22e3..5acd53efb7b 100644 --- a/C4/SIP/ILS/Transaction/RenewAll.pm +++ b/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; diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm index f1c1ae448b3..4f0a0a627f5 100644 --- a/C4/SIP/SIPServer.pm +++ b/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"; diff --git a/C4/SIP/Sip.pm b/C4/SIP/Sip.pm index 3d68f9765c7..2842a611b6f 100644 --- a/C4/SIP/Sip.pm +++ b/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); diff --git a/C4/Scheduler.pm b/C4/Scheduler.pm index a1c1ae557f9..e2f6d85f654 100644 --- a/C4/Scheduler.pm +++ b/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 diff --git a/C4/Scrubber.pm b/C4/Scrubber.pm index 494b079496b..0fcd3580bc2 100644 --- a/C4/Scrubber.pm +++ b/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; diff --git a/C4/Search.pm b/C4/Search.pm index 03f7ecf5912..1ca987add2b 100644 --- a/C4/Search.pm +++ b/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 diff --git a/C4/Search/History.pm b/C4/Search/History.pm index 8406f3086bc..df36cb0fbc7 100644 --- a/C4/Search/History.pm +++ b/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) = @_; diff --git a/C4/Search/PazPar2.pm b/C4/Search/PazPar2.pm index a1682930d04..886cc868cac 100644 --- a/C4/Search/PazPar2.pm +++ b/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 diff --git a/C4/Serials.pm b/C4/Serials.pm index a2c1e24acb7..d840bf24b72 100644 --- a/C4/Serials.pm +++ b/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 ); } diff --git a/C4/Serials/Frequency.pm b/C4/Serials/Frequency.pm index 509f6801f5f..9db52c88397 100644 --- a/C4/Serials/Frequency.pm +++ b/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 ); } diff --git a/C4/Serials/Numberpattern.pm b/C4/Serials/Numberpattern.pm index 3c35b628dc2..5c31bc6cf53 100644 --- a/C4/Serials/Numberpattern.pm +++ b/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 ); } diff --git a/C4/Service.pm b/C4/Service.pm index 790f147f073..c50051d6aac 100644 --- a/C4/Service.pm +++ b/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; diff --git a/C4/ShelfBrowser.pm b/C4/ShelfBrowser.pm index b115c935415..0b1bec414d1 100644 --- a/C4/ShelfBrowser.pm +++ b/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 ); } diff --git a/C4/SocialData.pm b/C4/SocialData.pm index 218cf4e9f7e..8217ccb49ea 100644 --- a/C4/SocialData.pm +++ b/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 diff --git a/C4/Stats.pm b/C4/Stats.pm index ff2eae9d7d5..7d63f18aa98 100644 --- a/C4/Stats.pm +++ b/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 + ); } diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 37a482e2d38..ba72a1888ad 100644 --- a/C4/Suggestions.pm +++ b/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( diff --git a/C4/Tags.pm b/C4/Tags.pm index 7e1a22154f6..e01244f9279 100644 --- a/C4/Tags.pm +++ b/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."; diff --git a/C4/Templates.pm b/C4/Templates.pm index 644e235b91e..f6fefaa6fa5 100644 --- a/C4/Templates.pm +++ b/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; diff --git a/C4/TmplTokenType.pm b/C4/TmplTokenType.pm index c8a5c96e890..91bc40c23c6 100644 --- a/C4/TmplTokenType.pm +++ b/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; diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 3c4ec3dafc3..be49a53b087 100644 --- a/C4/UsageStats.pm +++ b/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; diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm index a718a9633e5..3d677b8e010 100644 --- a/C4/Utils/DataTables/Members.pm +++ b/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 ) = @_; diff --git a/C4/Utils/DataTables/VirtualShelves.pm b/C4/Utils/DataTables/VirtualShelves.pm index 5a349326b1d..cc52165a2f3 100644 --- a/C4/Utils/DataTables/VirtualShelves.pm +++ b/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 { diff --git a/C4/XISBN.pm b/C4/XISBN.pm index 65ef2878db1..c6e03d30710 100644 --- a/C4/XISBN.pm +++ b/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 diff --git a/C4/XSLT.pm b/C4/XSLT.pm index b8ae90e9782..245d76b74f7 100644 --- a/C4/XSLT.pm +++ b/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 } ); } diff --git a/Koha/Account.pm b/Koha/Account.pm index bd4af13a2d7..23252c73329 100644 --- a/Koha/Account.pm +++ b/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; diff --git a/Koha/Account/CreditType.pm b/Koha/Account/CreditType.pm index 359618922fc..faf65cfce4e 100644 --- a/Koha/Account/CreditType.pm +++ b/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; diff --git a/Koha/Account/CreditTypes.pm b/Koha/Account/CreditTypes.pm index 2b058ded373..27b43e6d923 100644 --- a/Koha/Account/CreditTypes.pm +++ b/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; diff --git a/Koha/Account/DebitType.pm b/Koha/Account/DebitType.pm index 57cf2cc1f6f..1d5f7f14189 100644 --- a/Koha/Account/DebitType.pm +++ b/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; diff --git a/Koha/Account/DebitTypes.pm b/Koha/Account/DebitTypes.pm index 8b3558be6f4..3860264d50e 100644 --- a/Koha/Account/DebitTypes.pm +++ b/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; diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index bd233e3b36d..36a420b10c4 100644 --- a/Koha/Account/Line.pm +++ b/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; diff --git a/Koha/Account/Lines.pm b/Koha/Account/Lines.pm index d593893924e..ab8986db2d4 100644 --- a/Koha/Account/Lines.pm +++ b/Koha/Account/Lines.pm @@ -17,7 +17,6 @@ package Koha::Account::Lines; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Account::Line; diff --git a/Koha/Account/Offset.pm b/Koha/Account/Offset.pm index 0751ce80363..1ff8c11da2d 100644 --- a/Koha/Account/Offset.pm +++ b/Koha/Account/Offset.pm @@ -17,7 +17,6 @@ package Koha::Account::Offset; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Account::Lines; diff --git a/Koha/Account/Offsets.pm b/Koha/Account/Offsets.pm index 0083f0d3ab8..6a401968f2d 100644 --- a/Koha/Account/Offsets.pm +++ b/Koha/Account/Offsets.pm @@ -17,7 +17,6 @@ package Koha::Account::Offsets; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Basket.pm b/Koha/Acquisition/Basket.pm index 4f105579019..6717f5f9d47 100644 --- a/Koha/Acquisition/Basket.pm +++ b/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 ); diff --git a/Koha/Acquisition/Bookseller/Contact.pm b/Koha/Acquisition/Bookseller/Contact.pm index 61da32eac03..1b184fb3ddf 100644 --- a/Koha/Acquisition/Bookseller/Contact.pm +++ b/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'; diff --git a/Koha/Acquisition/Bookseller/Contacts.pm b/Koha/Acquisition/Bookseller/Contacts.pm index 053e7a6d975..fa066f45afa 100644 --- a/Koha/Acquisition/Bookseller/Contacts.pm +++ b/Koha/Acquisition/Bookseller/Contacts.pm @@ -2,7 +2,6 @@ package Koha::Acquisition::Bookseller::Contacts; use Modern::Perl; -use Carp; use base qw( Koha::Objects ); diff --git a/Koha/Acquisition/Currencies.pm b/Koha/Acquisition/Currencies.pm index 5e730e568cb..42f1d2ff200 100644 --- a/Koha/Acquisition/Currencies.pm +++ b/Koha/Acquisition/Currencies.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Currencies; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Currency.pm b/Koha/Acquisition/Currency.pm index 050cf6c4a1e..8404d4bb42f 100644 --- a/Koha/Acquisition/Currency.pm +++ b/Koha/Acquisition/Currency.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Currency; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Invoice/Adjustment.pm b/Koha/Acquisition/Invoice/Adjustment.pm index 0d0bac73536..e0f1db3d0fa 100644 --- a/Koha/Acquisition/Invoice/Adjustment.pm +++ b/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; diff --git a/Koha/Acquisition/Invoice/Adjustments.pm b/Koha/Acquisition/Invoice/Adjustments.pm index 3a43904b069..f45f12b79ed 100644 --- a/Koha/Acquisition/Invoice/Adjustments.pm +++ b/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; diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm index 07dea689390..090920d92c1 100644 --- a/Koha/Acquisition/Order.pm +++ b/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; diff --git a/Koha/Acquisition/Order/Claim.pm b/Koha/Acquisition/Order/Claim.pm index e377e4b6797..902283080d7 100644 --- a/Koha/Acquisition/Order/Claim.pm +++ b/Koha/Acquisition/Order/Claim.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Order::Claim; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Order/Claims.pm b/Koha/Acquisition/Order/Claims.pm index 9e96045711a..3190733652c 100644 --- a/Koha/Acquisition/Order/Claims.pm +++ b/Koha/Acquisition/Order/Claims.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Order::Claims; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Acquisition/Orders.pm b/Koha/Acquisition/Orders.pm index 2b06b81d1e5..b2496260a98 100644 --- a/Koha/Acquisition/Orders.pm +++ b/Koha/Acquisition/Orders.pm @@ -17,7 +17,6 @@ package Koha::Acquisition::Orders; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AdvancedEditorMacro.pm b/Koha/AdvancedEditorMacro.pm index 975f850fa9e..6627b325de9 100644 --- a/Koha/AdvancedEditorMacro.pm +++ b/Koha/AdvancedEditorMacro.pm @@ -16,7 +16,6 @@ package Koha::AdvancedEditorMacro; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AdvancedEditorMacros.pm b/Koha/AdvancedEditorMacros.pm index 4fdf25ba9fc..d890185e4d5 100644 --- a/Koha/AdvancedEditorMacros.pm +++ b/Koha/AdvancedEditorMacros.pm @@ -16,7 +16,6 @@ package Koha::AdvancedEditorMacros; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ApiKey.pm b/Koha/ApiKey.pm index 80d630c323a..d966bc58491 100644 --- a/Koha/ApiKey.pm +++ b/Koha/ApiKey.pm @@ -19,7 +19,6 @@ package Koha::ApiKey; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/ApiKeys.pm b/Koha/ApiKeys.pm index 8eb84d1b61a..07cabd32044 100644 --- a/Koha/ApiKeys.pm +++ b/Koha/ApiKeys.pm @@ -19,7 +19,6 @@ package Koha::ApiKeys; use Modern::Perl; -use Carp; use Koha::Database; use Koha::ApiKey; diff --git a/Koha/ArticleRequest.pm b/Koha/ArticleRequest.pm index 6b8809bc334..05b0e325429 100644 --- a/Koha/ArticleRequest.pm +++ b/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); diff --git a/Koha/ArticleRequests.pm b/Koha/ArticleRequests.pm index 9b27615573a..2d3dce5627f 100644 --- a/Koha/ArticleRequests.pm +++ b/Koha/ArticleRequests.pm @@ -19,7 +19,6 @@ package Koha::ArticleRequests; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AudioAlert.pm b/Koha/AudioAlert.pm index 6cddd28b94d..6d5cf639e03 100644 --- a/Koha/AudioAlert.pm +++ b/Koha/AudioAlert.pm @@ -19,7 +19,6 @@ package Koha::AudioAlert; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AudioAlerts.pm b/Koha/AudioAlerts.pm index daca3c6aede..11aede083c8 100644 --- a/Koha/AudioAlerts.pm +++ b/Koha/AudioAlerts.pm @@ -19,7 +19,6 @@ package Koha::AudioAlerts; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AuthUtils.pm b/Koha/AuthUtils.pm index 3bf28ef73ad..49d2723c54e 100644 --- a/Koha/AuthUtils.pm +++ b/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 diff --git a/Koha/AuthorisedValue.pm b/Koha/AuthorisedValue.pm index 636ce95b3cd..8f97bb1ede0 100644 --- a/Koha/AuthorisedValue.pm +++ b/Koha/AuthorisedValue.pm @@ -19,7 +19,6 @@ package Koha::AuthorisedValue; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/AuthorisedValueCategories.pm b/Koha/AuthorisedValueCategories.pm index 915e7d0fb06..21e4eee49f6 100644 --- a/Koha/AuthorisedValueCategories.pm +++ b/Koha/AuthorisedValueCategories.pm @@ -17,7 +17,6 @@ package Koha::AuthorisedValueCategories; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/AuthorisedValueCategory.pm b/Koha/AuthorisedValueCategory.pm index 73f578ac4c6..e14129f80d6 100644 --- a/Koha/AuthorisedValueCategory.pm +++ b/Koha/AuthorisedValueCategory.pm @@ -17,7 +17,6 @@ package Koha::AuthorisedValueCategory; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/AuthorisedValues.pm b/Koha/AuthorisedValues.pm index b23190da725..b89ed9be4a3 100644 --- a/Koha/AuthorisedValues.pm +++ b/Koha/AuthorisedValues.pm @@ -19,7 +19,6 @@ package Koha::AuthorisedValues; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Authorities.pm b/Koha/Authorities.pm index 0145eb368eb..a509b75fa2d 100644 --- a/Koha/Authorities.pm +++ b/Koha/Authorities.pm @@ -19,7 +19,6 @@ package Koha::Authorities; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Authority/MergeRequests.pm b/Koha/Authority/MergeRequests.pm index 315fe4ba67c..481118e0f57 100644 --- a/Koha/Authority/MergeRequests.pm +++ b/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); diff --git a/Koha/Authority/Type.pm b/Koha/Authority/Type.pm index 8d9caba1fdb..7c6327e86b6 100644 --- a/Koha/Authority/Type.pm +++ b/Koha/Authority/Type.pm @@ -17,7 +17,6 @@ package Koha::Authority::Type; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Authority/Types.pm b/Koha/Authority/Types.pm index 85991d85c09..aa399b4dcc5 100644 --- a/Koha/Authority/Types.pm +++ b/Koha/Authority/Types.pm @@ -17,7 +17,6 @@ package Koha::Authority::Types; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm index 09139bdbdd0..c303fa175ec 100644 --- a/Koha/BackgroundJob.pm +++ b/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 ); diff --git a/Koha/BackgroundJob/BatchUpdateAuthority.pm b/Koha/BackgroundJob/BatchUpdateAuthority.pm index 24f1e9a4000..5969a1311d5 100644 --- a/Koha/BackgroundJob/BatchUpdateAuthority.pm +++ b/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 ); diff --git a/Koha/BackgroundJob/BatchUpdateBiblio.pm b/Koha/BackgroundJob/BatchUpdateBiblio.pm index 7cb7969474d..9371e2212ff 100644 --- a/Koha/BackgroundJob/BatchUpdateBiblio.pm +++ b/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 ); diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index be9561f5835..26ee7abd960 100644 --- a/Koha/Biblio.pm +++ b/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 ); diff --git a/Koha/Biblio/Metadatas.pm b/Koha/Biblio/Metadatas.pm index 65a17bed326..d31b86501e8 100644 --- a/Koha/Biblio/Metadatas.pm +++ b/Koha/Biblio/Metadatas.pm @@ -17,7 +17,6 @@ package Koha::Biblio::Metadatas; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/BiblioFramework.pm b/Koha/BiblioFramework.pm index ca69f37e843..30367570ba0 100644 --- a/Koha/BiblioFramework.pm +++ b/Koha/BiblioFramework.pm @@ -17,7 +17,6 @@ package Koha::BiblioFramework; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/BiblioFrameworks.pm b/Koha/BiblioFrameworks.pm index 16db02b5862..7202d2fec5f 100644 --- a/Koha/BiblioFrameworks.pm +++ b/Koha/BiblioFrameworks.pm @@ -17,7 +17,6 @@ package Koha::BiblioFrameworks; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/BiblioUtils.pm b/Koha/BiblioUtils.pm index 9be2e6168ac..1ece4a8317b 100644 --- a/Koha/BiblioUtils.pm +++ b/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); diff --git a/Koha/BiblioUtils/Iterator.pm b/Koha/BiblioUtils/Iterator.pm index f8a4e41019d..c75a3733e5c 100644 --- a/Koha/BiblioUtils/Iterator.pm +++ b/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; diff --git a/Koha/Biblioitem.pm b/Koha/Biblioitem.pm index 8f63a7cc983..eec0cdc6374 100644 --- a/Koha/Biblioitem.pm +++ b/Koha/Biblioitem.pm @@ -17,7 +17,6 @@ package Koha::Biblioitem; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Biblioitems.pm b/Koha/Biblioitems.pm index d35a0d4fc48..b8d2ba8d564 100644 --- a/Koha/Biblioitems.pm +++ b/Koha/Biblioitems.pm @@ -17,7 +17,6 @@ package Koha::Biblioitems; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Biblios.pm b/Koha/Biblios.pm index 9491fb3112f..416aa2bbe5f 100644 --- a/Koha/Biblios.pm +++ b/Koha/Biblios.pm @@ -19,7 +19,6 @@ package Koha::Biblios; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Cache.pm b/Koha/Cache.pm index ec153baff9f..2186d827438 100644 --- a/Koha/Cache.pm +++ b/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; diff --git a/Koha/Cache/Object.pm b/Koha/Cache/Object.pm index f232541b378..4bdd9106b3d 100644 --- a/Koha/Cache/Object.pm +++ b/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); diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index 05f91767161..5ffebb47ab7 100644 --- a/Koha/Calendar.pm +++ b/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; diff --git a/Koha/Cash/Register.pm b/Koha/Cash/Register.pm index 2daa52ed41d..72288bdadb8 100644 --- a/Koha/Cash/Register.pm +++ b/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; diff --git a/Koha/Cash/Register/Action.pm b/Koha/Cash/Register/Action.pm index ede413c21d3..34118695c4e 100644 --- a/Koha/Cash/Register/Action.pm +++ b/Koha/Cash/Register/Action.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Action; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Cash/Register/Actions.pm b/Koha/Cash/Register/Actions.pm index bdff33ed73f..d470b4d4379 100644 --- a/Koha/Cash/Register/Actions.pm +++ b/Koha/Cash/Register/Actions.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Actions; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Cash/Register/Cashup.pm b/Koha/Cash/Register/Cashup.pm index d3047036a4b..480bbf0e48c 100644 --- a/Koha/Cash/Register/Cashup.pm +++ b/Koha/Cash/Register/Cashup.pm @@ -17,7 +17,6 @@ package Koha::Cash::Register::Cashup; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Cash/Register/Cashups.pm b/Koha/Cash/Register/Cashups.pm index 8e82a01717d..58a562c0cbe 100644 --- a/Koha/Cash/Register/Cashups.pm +++ b/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; diff --git a/Koha/Cash/Registers.pm b/Koha/Cash/Registers.pm index e022279cb78..9576492caa8 100644 --- a/Koha/Cash/Registers.pm +++ b/Koha/Cash/Registers.pm @@ -17,7 +17,6 @@ package Koha::Cash::Registers; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Charges/Fees.pm b/Koha/Charges/Fees.pm index 7eff76ba794..a9bbf0fe601 100644 --- a/Koha/Charges/Fees.pm +++ b/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 ); diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm index 3693beeb90e..cc001942485 100644 --- a/Koha/Checkout.pm +++ b/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; diff --git a/Koha/Checkouts.pm b/Koha/Checkouts.pm index 0f2da95c651..76a3b9e6868 100644 --- a/Koha/Checkouts.pm +++ b/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); diff --git a/Koha/Checkouts/ReturnClaims.pm b/Koha/Checkouts/ReturnClaims.pm index fa601bdd66a..c1c2b3bd443 100644 --- a/Koha/Checkouts/ReturnClaims.pm +++ b/Koha/Checkouts/ReturnClaims.pm @@ -19,7 +19,6 @@ package Koha::Checkouts::ReturnClaims; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm index df1314613e1..d1c5648ff32 100644 --- a/Koha/CirculationRules.pm +++ b/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; diff --git a/Koha/Cities.pm b/Koha/Cities.pm index c66c4929acf..eabe4909f35 100644 --- a/Koha/Cities.pm +++ b/Koha/Cities.pm @@ -17,7 +17,6 @@ package Koha::Cities; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/City.pm b/Koha/City.pm index d6466315b57..e95f081644a 100644 --- a/Koha/City.pm +++ b/Koha/City.pm @@ -17,7 +17,6 @@ package Koha::City; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSortRule.pm b/Koha/ClassSortRule.pm index f1e7788cc5b..73f181e573b 100644 --- a/Koha/ClassSortRule.pm +++ b/Koha/ClassSortRule.pm @@ -17,7 +17,6 @@ package Koha::ClassSortRule; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSortRules.pm b/Koha/ClassSortRules.pm index 07dc543df5e..1a59b0b6a8d 100644 --- a/Koha/ClassSortRules.pm +++ b/Koha/ClassSortRules.pm @@ -17,7 +17,6 @@ package Koha::ClassSortRules; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSource.pm b/Koha/ClassSource.pm index 734757768bc..3b192ee1240 100644 --- a/Koha/ClassSource.pm +++ b/Koha/ClassSource.pm @@ -17,7 +17,6 @@ package Koha::ClassSource; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSources.pm b/Koha/ClassSources.pm index 3b6f891d9bd..7a56ab8b3cc 100644 --- a/Koha/ClassSources.pm +++ b/Koha/ClassSources.pm @@ -17,7 +17,6 @@ package Koha::ClassSources; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ClassSplitRule.pm b/Koha/ClassSplitRule.pm index a8b6401e3c1..28937fc59d9 100644 --- a/Koha/ClassSplitRule.pm +++ b/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; diff --git a/Koha/Club.pm b/Koha/Club.pm index 7e488399eb2..d4e00dae5be 100644 --- a/Koha/Club.pm +++ b/Koha/Club.pm @@ -19,7 +19,6 @@ package Koha::Club; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Enrollment.pm b/Koha/Club/Enrollment.pm index 143a1e95ec9..e9e434bc176 100644 --- a/Koha/Club/Enrollment.pm +++ b/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); diff --git a/Koha/Club/Enrollment/Field.pm b/Koha/Club/Enrollment/Field.pm index 0a616bbfc41..54ffaff0319 100644 --- a/Koha/Club/Enrollment/Field.pm +++ b/Koha/Club/Enrollment/Field.pm @@ -19,7 +19,6 @@ package Koha::Club::Enrollment::Field; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Enrollment/Fields.pm b/Koha/Club/Enrollment/Fields.pm index 29f6fa22386..590c2651613 100644 --- a/Koha/Club/Enrollment/Fields.pm +++ b/Koha/Club/Enrollment/Fields.pm @@ -19,7 +19,6 @@ package Koha::Club::Enrollment::Fields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Enrollments.pm b/Koha/Club/Enrollments.pm index 3e63f559bdc..8e7327b323d 100644 --- a/Koha/Club/Enrollments.pm +++ b/Koha/Club/Enrollments.pm @@ -19,7 +19,6 @@ package Koha::Club::Enrollments; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Field.pm b/Koha/Club/Field.pm index 764cf2a3537..956ee7ae459 100644 --- a/Koha/Club/Field.pm +++ b/Koha/Club/Field.pm @@ -19,7 +19,6 @@ package Koha::Club::Field; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Fields.pm b/Koha/Club/Fields.pm index 8e72ee8f617..7a2837b1a07 100644 --- a/Koha/Club/Fields.pm +++ b/Koha/Club/Fields.pm @@ -19,7 +19,6 @@ package Koha::Club::Fields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Hold.pm b/Koha/Club/Hold.pm index 46f9f319330..fbf35f43144 100644 --- a/Koha/Club/Hold.pm +++ b/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 diff --git a/Koha/Club/Hold/PatronHold.pm b/Koha/Club/Hold/PatronHold.pm index 4368a39c954..b24b33fc2e1 100644 --- a/Koha/Club/Hold/PatronHold.pm +++ b/Koha/Club/Hold/PatronHold.pm @@ -19,7 +19,6 @@ package Koha::Club::Hold::PatronHold; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Hold/PatronHolds.pm b/Koha/Club/Hold/PatronHolds.pm index f7d4ad70cab..76fffcbdcc0 100644 --- a/Koha/Club/Hold/PatronHolds.pm +++ b/Koha/Club/Hold/PatronHolds.pm @@ -19,7 +19,6 @@ package Koha::Club::Hold::PatronHolds; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Holds.pm b/Koha/Club/Holds.pm index 6ec9f413d19..8a8a20334c3 100644 --- a/Koha/Club/Holds.pm +++ b/Koha/Club/Holds.pm @@ -19,7 +19,6 @@ package Koha::Club::Holds; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template.pm b/Koha/Club/Template.pm index bdf8019cff2..57d87f95369 100644 --- a/Koha/Club/Template.pm +++ b/Koha/Club/Template.pm @@ -19,7 +19,6 @@ package Koha::Club::Template; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template/EnrollmentField.pm b/Koha/Club/Template/EnrollmentField.pm index bca9123809c..ba1fdb0b1db 100644 --- a/Koha/Club/Template/EnrollmentField.pm +++ b/Koha/Club/Template/EnrollmentField.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::EnrollmentField; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template/EnrollmentFields.pm b/Koha/Club/Template/EnrollmentFields.pm index 27996bf529a..4b383f5a97a 100644 --- a/Koha/Club/Template/EnrollmentFields.pm +++ b/Koha/Club/Template/EnrollmentFields.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::EnrollmentFields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template/Field.pm b/Koha/Club/Template/Field.pm index 9255fda188d..ab5cb809b16 100644 --- a/Koha/Club/Template/Field.pm +++ b/Koha/Club/Template/Field.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::Field; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Template/Fields.pm b/Koha/Club/Template/Fields.pm index 1fee0a1745b..bf9fd9bd549 100644 --- a/Koha/Club/Template/Fields.pm +++ b/Koha/Club/Template/Fields.pm @@ -19,7 +19,6 @@ package Koha::Club::Template::Fields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Club/Templates.pm b/Koha/Club/Templates.pm index 00940a760ca..b365ade79b5 100644 --- a/Koha/Club/Templates.pm +++ b/Koha/Club/Templates.pm @@ -19,7 +19,6 @@ package Koha::Club::Templates; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Clubs.pm b/Koha/Clubs.pm index 28fa41e81ac..d206b9023af 100644 --- a/Koha/Clubs.pm +++ b/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 ); diff --git a/Koha/Config.pm b/Koha/Config.pm index face2fc11f5..512d4fab144 100644 --- a/Koha/Config.pm +++ b/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"; diff --git a/Koha/Config/SysPref.pm b/Koha/Config/SysPref.pm index 1775160cb5e..dd743f8ef2b 100644 --- a/Koha/Config/SysPref.pm +++ b/Koha/Config/SysPref.pm @@ -19,7 +19,6 @@ package Koha::Config::SysPref; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Config/SysPrefs.pm b/Koha/Config/SysPrefs.pm index 6a5ad952f56..8b08d71a322 100644 --- a/Koha/Config/SysPrefs.pm +++ b/Koha/Config/SysPrefs.pm @@ -19,7 +19,6 @@ package Koha::Config::SysPrefs; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Course.pm b/Koha/Course.pm index 0ce658b0b42..9ede81bd3ce 100644 --- a/Koha/Course.pm +++ b/Koha/Course.pm @@ -17,7 +17,6 @@ package Koha::Course; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Course/Instructor.pm b/Koha/Course/Instructor.pm index 62385d0b751..e6c4db97398 100644 --- a/Koha/Course/Instructor.pm +++ b/Koha/Course/Instructor.pm @@ -17,7 +17,6 @@ package Koha::Course::Instructor; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Course/Instructors.pm b/Koha/Course/Instructors.pm index 68211eb793f..f69dd48ca09 100644 --- a/Koha/Course/Instructors.pm +++ b/Koha/Course/Instructors.pm @@ -17,7 +17,6 @@ package Koha::Course::Instructors; use Modern::Perl; -use Carp; use Koha::Course::Instructor; diff --git a/Koha/Course/Item.pm b/Koha/Course/Item.pm index 948a90c84bd..d55382c7a2c 100644 --- a/Koha/Course/Item.pm +++ b/Koha/Course/Item.pm @@ -17,7 +17,6 @@ package Koha::Course::Item; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Course/Items.pm b/Koha/Course/Items.pm index 7fc713dee12..9076540c7a2 100644 --- a/Koha/Course/Items.pm +++ b/Koha/Course/Items.pm @@ -17,7 +17,6 @@ package Koha::Course::Items; use Modern::Perl; -use Carp; use Koha::Course::Item; diff --git a/Koha/Course/Reserve.pm b/Koha/Course/Reserve.pm index ff2e0711c52..963a2ee272d 100644 --- a/Koha/Course/Reserve.pm +++ b/Koha/Course/Reserve.pm @@ -17,7 +17,6 @@ package Koha::Course::Reserve; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Course/Reserves.pm b/Koha/Course/Reserves.pm index 631ba49a935..e96cee63167 100644 --- a/Koha/Course/Reserves.pm +++ b/Koha/Course/Reserves.pm @@ -17,7 +17,6 @@ package Koha::Course::Reserves; use Modern::Perl; -use Carp; use Koha::Course::Reserve; diff --git a/Koha/Courses.pm b/Koha/Courses.pm index f0fb3ec29de..df2a74163ec 100644 --- a/Koha/Courses.pm +++ b/Koha/Courses.pm @@ -17,7 +17,6 @@ package Koha::Courses; use Modern::Perl; -use Carp; use Koha::Course; diff --git a/Koha/CoverImage.pm b/Koha/CoverImage.pm index 7edb35b5821..e5467bedebc 100644 --- a/Koha/CoverImage.pm +++ b/Koha/CoverImage.pm @@ -17,7 +17,6 @@ package Koha::CoverImage; use Modern::Perl; -use Carp; use GD; use Koha::Database; diff --git a/Koha/CoverImages.pm b/Koha/CoverImages.pm index 4dff96d9e59..bf807b08134 100644 --- a/Koha/CoverImages.pm +++ b/Koha/CoverImages.pm @@ -17,7 +17,6 @@ package Koha::CoverImages; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/CsvProfile.pm b/Koha/CsvProfile.pm index 68fd8cfec2b..c0d4d6a57c8 100644 --- a/Koha/CsvProfile.pm +++ b/Koha/CsvProfile.pm @@ -17,7 +17,6 @@ package Koha::CsvProfile; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/CsvProfiles.pm b/Koha/CsvProfiles.pm index 05dc6a3f7db..1ea493a4477 100644 --- a/Koha/CsvProfiles.pm +++ b/Koha/CsvProfiles.pm @@ -17,7 +17,6 @@ package Koha::CsvProfiles; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Database.pm b/Koha/Database.pm index df4d45ce7b2..fec7424eb37 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -33,7 +33,6 @@ Koha::Database =cut use Modern::Perl; -use Carp; use C4::Context; use base qw(Class::Accessor); diff --git a/Koha/Desk.pm b/Koha/Desk.pm index cd4379d9586..b92ec93e403 100644 --- a/Koha/Desk.pm +++ b/Koha/Desk.pm @@ -18,7 +18,6 @@ package Koha::Desk; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Desks.pm b/Koha/Desks.pm index a8b452cc7ef..20fb541c663 100644 --- a/Koha/Desks.pm +++ b/Koha/Desks.pm @@ -19,7 +19,6 @@ package Koha::Desks; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/EDI.pm b/Koha/EDI.pm index 5857f4eff7f..7a09ee367b4 100644 --- a/Koha/EDI.pm +++ b/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; diff --git a/Koha/Edifact.pm b/Koha/Edifact.pm index 38756270b27..b3b3bf473ed 100644 --- a/Koha/Edifact.pm +++ b/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; diff --git a/Koha/Edifact/Line.pm b/Koha/Edifact/Line.pm index 8d14ba5e5f8..172e4fbe18d 100644 --- a/Koha/Edifact/Line.pm +++ b/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 ) = @_; diff --git a/Koha/Edifact/Order.pm b/Koha/Edifact/Order.pm index f1648c6ab4d..772eb03861e 100644 --- a/Koha/Edifact/Order.pm +++ b/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; diff --git a/Koha/Edifact/Transport.pm b/Koha/Edifact/Transport.pm index e52b6ef468b..833c44e896a 100644 --- a/Koha/Edifact/Transport.pm +++ b/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 { diff --git a/Koha/Email.pm b/Koha/Email.pm index 9c077a6b84b..5083af8bbd9 100644 --- a/Koha/Email.pm +++ b/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; diff --git a/Koha/Exporter/Record.pm b/Koha/Exporter/Record.pm index eaebe576393..05cfe3e2a71 100644 --- a/Koha/Exporter/Record.pm +++ b/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) = @_; diff --git a/Koha/ExternalContent.pm b/Koha/ExternalContent.pm index 578e035cf5d..be5174d32e2 100644 --- a/Koha/ExternalContent.pm +++ b/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; diff --git a/Koha/ExternalContent/OverDrive.pm b/Koha/ExternalContent/OverDrive.pm index ad36c18ce89..6247dfee6e8 100644 --- a/Koha/ExternalContent/OverDrive.pm +++ b/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; diff --git a/Koha/ExternalContent/RecordedBooks.pm b/Koha/ExternalContent/RecordedBooks.pm index 2e8c33bffdb..10e5b6bd65e 100644 --- a/Koha/ExternalContent/RecordedBooks.pm +++ b/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; diff --git a/Koha/Filter/MARC/EmbedItemsAvailability.pm b/Koha/Filter/MARC/EmbedItemsAvailability.pm index ac4eaee1d4d..2e8a6c0e84a 100644 --- a/Koha/Filter/MARC/EmbedItemsAvailability.pm +++ b/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); diff --git a/Koha/Filter/MARC/EmbedSeeFromHeadings.pm b/Koha/Filter/MARC/EmbedSeeFromHeadings.pm index 9ed7b45bea5..b00a9a2d6ed 100644 --- a/Koha/Filter/MARC/EmbedSeeFromHeadings.pm +++ b/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'; diff --git a/Koha/Filter/MARC/Null.pm b/Koha/Filter/MARC/Null.pm index dc5a016934b..d504fe41da3 100644 --- a/Koha/Filter/MARC/Null.pm +++ b/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'; diff --git a/Koha/Filter/MARC/ViewPolicy.pm b/Koha/Filter/MARC/ViewPolicy.pm index 1b7ef7468c4..0523b1bc51b 100644 --- a/Koha/Filter/MARC/ViewPolicy.pm +++ b/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(). diff --git a/Koha/Hold.pm b/Koha/Hold.pm index bd5458f4943..0aa9eab133c 100644 --- a/Koha/Hold.pm +++ b/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; diff --git a/Koha/Holds.pm b/Koha/Holds.pm index 296f99cb0a1..fdc492b0ce7 100644 --- a/Koha/Holds.pm +++ b/Koha/Holds.pm @@ -19,7 +19,6 @@ package Koha::Holds; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/I18N.pm b/Koha/I18N.pm index ca0ceae0c9c..64fab1db256 100644 --- a/Koha/I18N.pm +++ b/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'; diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index 01d421f63df..2eaa5accda4 100644 --- a/Koha/Illrequest.pm +++ b/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); diff --git a/Koha/Illrequest/Config.pm b/Koha/Illrequest/Config.pm index 9eaf6233058..82b77685aca 100644 --- a/Koha/Illrequest/Config.pm +++ b/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; diff --git a/Koha/Illrequest/Logger.pm b/Koha/Illrequest/Logger.pm index 971b3a8b761..2e7b1f09d7d 100644 --- a/Koha/Illrequest/Logger.pm +++ b/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 ); diff --git a/Koha/Item.pm b/Koha/Item.pm index 47a86eb0bb9..c653dc25831 100644 --- a/Koha/Item.pm +++ b/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; diff --git a/Koha/Item/Search/Field.pm b/Koha/Item/Search/Field.pm index 77e5309b302..6c343b66f0d 100644 --- a/Koha/Item/Search/Field.pm +++ b/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; diff --git a/Koha/Item/Transfer.pm b/Koha/Item/Transfer.pm index 06588e01b16..286e0fd276f 100644 --- a/Koha/Item/Transfer.pm +++ b/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); diff --git a/Koha/Item/Transfer/Limit.pm b/Koha/Item/Transfer/Limit.pm index db9db5037c0..195e54e1718 100644 --- a/Koha/Item/Transfer/Limit.pm +++ b/Koha/Item/Transfer/Limit.pm @@ -18,7 +18,6 @@ package Koha::Item::Transfer::Limit; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Item/Transfers.pm b/Koha/Item/Transfers.pm index 738cc2aea80..be5c0e098c0 100644 --- a/Koha/Item/Transfers.pm +++ b/Koha/Item/Transfers.pm @@ -17,7 +17,6 @@ package Koha::Item::Transfers; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/ItemType.pm b/Koha/ItemType.pm index 939c97704e0..258ce91c1ce 100644 --- a/Koha/ItemType.pm +++ b/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; diff --git a/Koha/ItemTypes.pm b/Koha/ItemTypes.pm index 746bbb23ea8..13caa648a81 100644 --- a/Koha/ItemTypes.pm +++ b/Koha/ItemTypes.pm @@ -17,7 +17,6 @@ package Koha::ItemTypes; use Modern::Perl; -use Carp; use C4::Languages; diff --git a/Koha/Items.pm b/Koha/Items.pm index 16479835536..2643223d3bb 100644 --- a/Koha/Items.pm +++ b/Koha/Items.pm @@ -19,7 +19,6 @@ package Koha::Items; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/KeyboardShortcut.pm b/Koha/KeyboardShortcut.pm index 332d047dc1a..da13ce147b5 100644 --- a/Koha/KeyboardShortcut.pm +++ b/Koha/KeyboardShortcut.pm @@ -17,7 +17,6 @@ package Koha::KeyboardShortcut; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/KeyboardShortcuts.pm b/Koha/KeyboardShortcuts.pm index de5c4a1d67b..d75f4ce880c 100644 --- a/Koha/KeyboardShortcuts.pm +++ b/Koha/KeyboardShortcuts.pm @@ -17,7 +17,6 @@ package Koha::KeyboardShortcuts; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Libraries.pm b/Koha/Libraries.pm index 8a45cc26add..20ceb8aa348 100644 --- a/Koha/Libraries.pm +++ b/Koha/Libraries.pm @@ -19,7 +19,6 @@ package Koha::Libraries; use Modern::Perl; -use Carp; use C4::Context; diff --git a/Koha/Library.pm b/Koha/Library.pm index af2319a3f68..7ee84baca46 100644 --- a/Koha/Library.pm +++ b/Koha/Library.pm @@ -19,7 +19,6 @@ package Koha::Library; use Modern::Perl; -use Carp; use C4::Context; diff --git a/Koha/Library/Group.pm b/Koha/Library/Group.pm index 4a4ea032743..aaf68530d5a 100644 --- a/Koha/Library/Group.pm +++ b/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); diff --git a/Koha/Library/Groups.pm b/Koha/Library/Groups.pm index dc17c21c519..f72e544262f 100644 --- a/Koha/Library/Groups.pm +++ b/Koha/Library/Groups.pm @@ -19,7 +19,6 @@ package Koha::Library::Groups; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Library/OverDriveInfo.pm b/Koha/Library/OverDriveInfo.pm index e234b71bfab..0554c0b0d84 100644 --- a/Koha/Library/OverDriveInfo.pm +++ b/Koha/Library/OverDriveInfo.pm @@ -17,7 +17,6 @@ package Koha::Library::OverDriveInfo; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Library/OverDriveInfos.pm b/Koha/Library/OverDriveInfos.pm index d8a028eb6b3..3a3509d6a0c 100644 --- a/Koha/Library/OverDriveInfos.pm +++ b/Koha/Library/OverDriveInfos.pm @@ -17,7 +17,6 @@ package Koha::Library::OverDriveInfos; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Linktracker.pm b/Koha/Linktracker.pm index 4adea13d51f..d4519e396d4 100644 --- a/Koha/Linktracker.pm +++ b/Koha/Linktracker.pm @@ -32,7 +32,6 @@ Koha::Linktracker =cut use Modern::Perl; -use Carp; use C4::Context; use base qw(Class::Accessor); diff --git a/Koha/List/Patron.pm b/Koha/List/Patron.pm index c6f43848a31..28b1cd93baf 100644 --- a/Koha/List/Patron.pm +++ b/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; diff --git a/Koha/Logger.pm b/Koha/Logger.pm index 2751bf189b6..c91a3bb3b48 100644 --- a/Koha/Logger.pm +++ b/Koha/Logger.pm @@ -37,7 +37,6 @@ Koha::Logger use Modern::Perl; use Log::Log4perl; -use Carp; use C4::Context; diff --git a/Koha/MarcSubfieldStructure.pm b/Koha/MarcSubfieldStructure.pm index fb80dd086fc..e88d0da2cf8 100644 --- a/Koha/MarcSubfieldStructure.pm +++ b/Koha/MarcSubfieldStructure.pm @@ -17,7 +17,6 @@ package Koha::MarcSubfieldStructure; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/MarcSubfieldStructures.pm b/Koha/MarcSubfieldStructures.pm index e1e6bc8814e..03d3eba17c5 100644 --- a/Koha/MarcSubfieldStructures.pm +++ b/Koha/MarcSubfieldStructures.pm @@ -17,7 +17,6 @@ package Koha::MarcSubfieldStructures; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/MessageAttribute.pm b/Koha/MessageAttribute.pm index acc7ccc9692..c728b3415fa 100644 --- a/Koha/MessageAttribute.pm +++ b/Koha/MessageAttribute.pm @@ -19,7 +19,6 @@ package Koha::MessageAttribute; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/MessageAttributes.pm b/Koha/MessageAttributes.pm index 2c314d73011..5bc70575083 100644 --- a/Koha/MessageAttributes.pm +++ b/Koha/MessageAttributes.pm @@ -19,7 +19,6 @@ package Koha::MessageAttributes; use Modern::Perl; -use Carp; use base qw(Koha::Objects); use Koha::MessageAttribute; diff --git a/Koha/MetaSearcher.pm b/Koha/MetaSearcher.pm index 47dffe801ef..5a385e82e47 100644 --- a/Koha/MetaSearcher.pm +++ b/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; diff --git a/Koha/MetadataRecord.pm b/Koha/MetadataRecord.pm index ce792f7ead2..3426ea5d2e0 100644 --- a/Koha/MetadataRecord.pm +++ b/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; diff --git a/Koha/MetadataRecord/Authority.pm b/Koha/MetadataRecord/Authority.pm index 31e5b530394..d16970a828d 100644 --- a/Koha/MetadataRecord/Authority.pm +++ b/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); diff --git a/Koha/News.pm b/Koha/News.pm index 82f9918de24..5bb78a6a30e 100644 --- a/Koha/News.pm +++ b/Koha/News.pm @@ -19,7 +19,6 @@ package Koha::News; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/NewsItem.pm b/Koha/NewsItem.pm index cd33b5109ad..152e7770238 100644 --- a/Koha/NewsItem.pm +++ b/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; diff --git a/Koha/Notice/Message.pm b/Koha/Notice/Message.pm index 3cdb09d12a6..fcf7eca2a67 100644 --- a/Koha/Notice/Message.pm +++ b/Koha/Notice/Message.pm @@ -17,7 +17,6 @@ package Koha::Notice::Message; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Notice/Messages.pm b/Koha/Notice/Messages.pm index 3ef9d947314..3fedd5d1424 100644 --- a/Koha/Notice/Messages.pm +++ b/Koha/Notice/Messages.pm @@ -17,7 +17,6 @@ package Koha::Notice::Messages; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Notice/Template.pm b/Koha/Notice/Template.pm index 95003a7a1cc..76694816902 100644 --- a/Koha/Notice/Template.pm +++ b/Koha/Notice/Template.pm @@ -17,7 +17,6 @@ package Koha::Notice::Template; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Notice/Templates.pm b/Koha/Notice/Templates.pm index 8105f975680..27922e6aa00 100644 --- a/Koha/Notice/Templates.pm +++ b/Koha/Notice/Templates.pm @@ -17,7 +17,6 @@ package Koha::Notice::Templates; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/OAI/Server/Description.pm b/Koha/OAI/Server/Description.pm index a0e92213ce5..83469b8daa5 100644 --- a/Koha/OAI/Server/Description.pm +++ b/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 { diff --git a/Koha/OAI/Server/GetRecord.pm b/Koha/OAI/Server/GetRecord.pm index db94c517c57..4e4985ea8e1 100644 --- a/Koha/OAI/Server/GetRecord.pm +++ b/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"); diff --git a/Koha/OAI/Server/ListBase.pm b/Koha/OAI/Server/ListBase.pm index 03d13f7a0a3..877f7c137da 100644 --- a/Koha/OAI/Server/ListBase.pm +++ b/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 { diff --git a/Koha/OAI/Server/ListSets.pm b/Koha/OAI/Server/ListSets.pm index 68264787f1f..8a4be18ae42 100644 --- a/Koha/OAI/Server/ListSets.pm +++ b/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"); diff --git a/Koha/OAI/Server/Repository.pm b/Koha/OAI/Server/Repository.pm index ad18c2dc139..0c4c30bb09c 100644 --- a/Koha/OAI/Server/Repository.pm +++ b/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 diff --git a/Koha/Object.pm b/Koha/Object.pm index 806d42d1aaa..08602da67f9 100644 --- a/Koha/Object.pm +++ b/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 diff --git a/Koha/Object/Limit/Library.pm b/Koha/Object/Limit/Library.pm index 1b7606f6084..557baf90381 100644 --- a/Koha/Object/Limit/Library.pm +++ b/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 diff --git a/Koha/Objects.pm b/Koha/Objects.pm index fab6f9046db..3ee0a55742d 100644 --- a/Koha/Objects.pm +++ b/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; diff --git a/Koha/Old/Holds.pm b/Koha/Old/Holds.pm index e12e1446b2f..415c4c9b7ec 100644 --- a/Koha/Old/Holds.pm +++ b/Koha/Old/Holds.pm @@ -19,7 +19,6 @@ package Koha::Old::Holds; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Patron.pm b/Koha/Patron.pm index e202fecdb70..941dace0df8 100644 --- a/Koha/Patron.pm +++ b/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; diff --git a/Koha/Patron/Category.pm b/Koha/Patron/Category.pm index 713dcf92497..892d00c2ae2 100644 --- a/Koha/Patron/Category.pm +++ b/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); diff --git a/Koha/Patron/Discharge.pm b/Koha/Patron/Discharge.pm index f35f434109c..8ad1696bc5d 100644 --- a/Koha/Patron/Discharge.pm +++ b/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 ); diff --git a/Koha/Patron/Image.pm b/Koha/Patron/Image.pm index 06caa3022a0..643ad2c1f01 100644 --- a/Koha/Patron/Image.pm +++ b/Koha/Patron/Image.pm @@ -17,7 +17,6 @@ package Koha::Patron::Image; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Patron/Images.pm b/Koha/Patron/Images.pm index aec39197c29..02a907f09f9 100644 --- a/Koha/Patron/Images.pm +++ b/Koha/Patron/Images.pm @@ -17,7 +17,6 @@ package Koha::Patron::Images; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Patron/Message.pm b/Koha/Patron/Message.pm index d56c07a7121..fa4473d2201 100644 --- a/Koha/Patron/Message.pm +++ b/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; diff --git a/Koha/Patron/Messages.pm b/Koha/Patron/Messages.pm index 3bd98e33524..7cc729ac867 100644 --- a/Koha/Patron/Messages.pm +++ b/Koha/Patron/Messages.pm @@ -17,7 +17,6 @@ package Koha::Patron::Messages; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Patron/Modification.pm b/Koha/Patron/Modification.pm index 51f182a80b9..3c92a6286a9 100644 --- a/Koha/Patron/Modification.pm +++ b/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); diff --git a/Koha/Patron/Modifications.pm b/Koha/Patron/Modifications.pm index 1ca0ab11633..f6665e8ddbc 100644 --- a/Koha/Patron/Modifications.pm +++ b/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); diff --git a/Koha/Patron/Password/Recovery.pm b/Koha/Patron/Password/Recovery.pm index 0dafdae4f33..5fb1402dee2 100644 --- a/Koha/Patron/Password/Recovery.pm +++ b/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 diff --git a/Koha/Patron/Relationship.pm b/Koha/Patron/Relationship.pm index d8cbb1c18e7..88ede2cc519 100644 --- a/Koha/Patron/Relationship.pm +++ b/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; diff --git a/Koha/Patron/Relationships.pm b/Koha/Patron/Relationships.pm index 7c2a9bc51f4..56f0fd9dd52 100644 --- a/Koha/Patron/Relationships.pm +++ b/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; diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm index 616fefacbae..4f2b55956a7 100644 --- a/Koha/Patrons.pm +++ b/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); diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm index cd6f4aa303d..fe3fd80c11e 100644 --- a/Koha/Patrons/Import.pm +++ b/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 diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm index 36e60904159..b8f9f86a339 100644 --- a/Koha/Plugins.pm +++ b/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; diff --git a/Koha/Plugins/Base.pm b/Koha/Plugins/Base.pm index a5cb15e3c16..e935e74a186 100644 --- a/Koha/Plugins/Base.pm +++ b/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 diff --git a/Koha/Plugins/Handler.pm b/Koha/Plugins/Handler.pm index 6c6ae73023c..a32487d4ad0 100644 --- a/Koha/Plugins/Handler.pm +++ b/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; diff --git a/Koha/Plugins/Method.pm b/Koha/Plugins/Method.pm index ce313b5ff02..b6e2e750b8d 100644 --- a/Koha/Plugins/Method.pm +++ b/Koha/Plugins/Method.pm @@ -17,7 +17,6 @@ package Koha::Plugins::Method; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Plugins/Methods.pm b/Koha/Plugins/Methods.pm index 1e3e00d5c4e..e99b8b5b38c 100644 --- a/Koha/Plugins/Methods.pm +++ b/Koha/Plugins/Methods.pm @@ -17,7 +17,6 @@ package Koha::Plugins::Methods; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/PseudonymizedTransaction.pm b/Koha/PseudonymizedTransaction.pm index 78a1190f7c2..70049a48c92 100644 --- a/Koha/PseudonymizedTransaction.pm +++ b/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; diff --git a/Koha/PseudonymizedTransactions.pm b/Koha/PseudonymizedTransactions.pm index 06ea08a0103..8b2e60ba683 100644 --- a/Koha/PseudonymizedTransactions.pm +++ b/Koha/PseudonymizedTransactions.pm @@ -16,7 +16,6 @@ package Koha::PseudonymizedTransactions; use Modern::Perl; -use Carp; use Koha::Database; use Koha::PseudonymizedTransaction; diff --git a/Koha/Quote.pm b/Koha/Quote.pm index 49868aa2a3b..3ce1985462c 100644 --- a/Koha/Quote.pm +++ b/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; diff --git a/Koha/Quotes.pm b/Koha/Quotes.pm index 746fff0bc1e..d9fc43f9bf4 100644 --- a/Koha/Quotes.pm +++ b/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); diff --git a/Koha/REST/Plugin/PluginRoutes.pm b/Koha/REST/Plugin/PluginRoutes.pm index d434ee537d3..cf7eea882b9 100644 --- a/Koha/REST/Plugin/PluginRoutes.pm +++ b/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 diff --git a/Koha/REST/Plugin/Query.pm b/Koha/REST/Plugin/Query.pm index e6bb370d061..5603e602944 100644 --- a/Koha/REST/Plugin/Query.pm +++ b/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; diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm index 1c6c03582f5..1c22a769d7e 100644 --- a/Koha/REST/V1.pm +++ b/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 diff --git a/Koha/REST/V1/Acquisitions/Funds.pm b/Koha/REST/V1/Acquisitions/Funds.pm index ee0704674a0..c4209289fea 100644 --- a/Koha/REST/V1/Acquisitions/Funds.pm +++ b/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 diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm index e104ce5dea5..cc12ecd2ffb 100644 --- a/Koha/REST/V1/Acquisitions/Orders.pm +++ b/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 diff --git a/Koha/REST/V1/Acquisitions/Vendors.pm b/Koha/REST/V1/Acquisitions/Vendors.pm index 8720a426292..eb0d4112e28 100644 --- a/Koha/REST/V1/Acquisitions/Vendors.pm +++ b/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 diff --git a/Koha/REST/V1/AdvancedEditorMacro.pm b/Koha/REST/V1/AdvancedEditorMacro.pm index 86a2f466488..472d4ce87c0 100644 --- a/Koha/REST/V1/AdvancedEditorMacro.pm +++ b/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 diff --git a/Koha/REST/V1/Auth.pm b/Koha/REST/V1/Auth.pm index ea29bd69291..2361aae361f 100644 --- a/Koha/REST/V1/Auth.pm +++ b/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 diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm index 92d31348d45..3ddb896e73e 100644 --- a/Koha/REST/V1/Biblios.pm +++ b/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 diff --git a/Koha/REST/V1/CashRegisters/Cashups.pm b/Koha/REST/V1/CashRegisters/Cashups.pm index 8bb483bdde8..12b6f302143 100644 --- a/Koha/REST/V1/CashRegisters/Cashups.pm +++ b/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; diff --git a/Koha/REST/V1/Checkouts.pm b/Koha/REST/V1/Checkouts.pm index 8fc07181b11..e670987bffe 100644 --- a/Koha/REST/V1/Checkouts.pm +++ b/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 diff --git a/Koha/REST/V1/CirculationRules.pm b/Koha/REST/V1/CirculationRules.pm index baa04b52117..636985fba64 100644 --- a/Koha/REST/V1/CirculationRules.pm +++ b/Koha/REST/V1/CirculationRules.pm @@ -21,7 +21,6 @@ use Mojo::Base 'Mojolicious::Controller'; use Koha::CirculationRules; -use Try::Tiny; =head1 API diff --git a/Koha/REST/V1/Cities.pm b/Koha/REST/V1/Cities.pm index cfa8d53422e..3dfc91d56ff 100644 --- a/Koha/REST/V1/Cities.pm +++ b/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 diff --git a/Koha/REST/V1/Clubs/Holds.pm b/Koha/REST/V1/Clubs/Holds.pm index 726f6f20deb..3333d75e7df 100644 --- a/Koha/REST/V1/Clubs/Holds.pm +++ b/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 diff --git a/Koha/REST/V1/Config/SMTP/Servers.pm b/Koha/REST/V1/Config/SMTP/Servers.pm index 205f074fcaa..5949c535f4a 100644 --- a/Koha/REST/V1/Config/SMTP/Servers.pm +++ b/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 diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm index 08bf1a1fe3d..7541a5c653d 100644 --- a/Koha/REST/V1/Holds.pm +++ b/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 diff --git a/Koha/REST/V1/ImportBatchProfiles.pm b/Koha/REST/V1/ImportBatchProfiles.pm index 9988d0f002d..ddac0eee4fb 100644 --- a/Koha/REST/V1/ImportBatchProfiles.pm +++ b/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 diff --git a/Koha/REST/V1/Items.pm b/Koha/REST/V1/Items.pm index 21e7aa9febb..1887bce5145 100644 --- a/Koha/REST/V1/Items.pm +++ b/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 diff --git a/Koha/REST/V1/Libraries.pm b/Koha/REST/V1/Libraries.pm index 9025adbe7c1..b6ec20e69d3 100644 --- a/Koha/REST/V1/Libraries.pm +++ b/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 diff --git a/Koha/REST/V1/OAuth.pm b/Koha/REST/V1/OAuth.pm index 090c7899245..922134ddc7b 100644 --- a/Koha/REST/V1/OAuth.pm +++ b/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'; diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm index a88610bfdac..80b64ee9636 100644 --- a/Koha/REST/V1/Patrons.pm +++ b/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 diff --git a/Koha/REST/V1/Patrons/Account.pm b/Koha/REST/V1/Patrons/Account.pm index 1bf64aa58c9..1c932c07f71 100644 --- a/Koha/REST/V1/Patrons/Account.pm +++ b/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 diff --git a/Koha/REST/V1/Patrons/Attributes.pm b/Koha/REST/V1/Patrons/Attributes.pm index f769765a738..4095a9220a1 100644 --- a/Koha/REST/V1/Patrons/Attributes.pm +++ b/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 diff --git a/Koha/REST/V1/Patrons/Password.pm b/Koha/REST/V1/Patrons/Password.pm index 82531d9d498..bb53ad5d4c4 100644 --- a/Koha/REST/V1/Patrons/Password.pm +++ b/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 diff --git a/Koha/REST/V1/Quotes.pm b/Koha/REST/V1/Quotes.pm index 49c6e4cab6d..53475ec9c2b 100644 --- a/Koha/REST/V1/Quotes.pm +++ b/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 diff --git a/Koha/REST/V1/ReturnClaims.pm b/Koha/REST/V1/ReturnClaims.pm index c9fa8333879..850b0f76c25 100644 --- a/Koha/REST/V1/ReturnClaims.pm +++ b/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 diff --git a/Koha/REST/V1/Static.pm b/Koha/REST/V1/Static.pm index 233fa4e751d..2b7f20e123d 100644 --- a/Koha/REST/V1/Static.pm +++ b/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 diff --git a/Koha/REST/V1/TransferLimits.pm b/Koha/REST/V1/TransferLimits.pm index 8ce82911926..c7d056d18d1 100644 --- a/Koha/REST/V1/TransferLimits.pm +++ b/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 diff --git a/Koha/Rating.pm b/Koha/Rating.pm index 93061812607..35ecf0e7ec0 100644 --- a/Koha/Rating.pm +++ b/Koha/Rating.pm @@ -17,7 +17,6 @@ package Koha::Rating; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Ratings.pm b/Koha/Ratings.pm index 8d3b50acaa1..41e1197842f 100644 --- a/Koha/Ratings.pm +++ b/Koha/Ratings.pm @@ -17,7 +17,6 @@ package Koha::Ratings; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/RecordProcessor.pm b/Koha/RecordProcessor.pm index a501c5010a1..ec7cbea0cad 100644 --- a/Koha/RecordProcessor.pm +++ b/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); diff --git a/Koha/Report.pm b/Koha/Report.pm index 1e6510219d7..176fb6e2535 100644 --- a/Koha/Report.pm +++ b/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 ); diff --git a/Koha/Reports.pm b/Koha/Reports.pm index 873f295abdd..d0f952ce09f 100644 --- a/Koha/Reports.pm +++ b/Koha/Reports.pm @@ -17,7 +17,6 @@ package Koha::Reports; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Review.pm b/Koha/Review.pm index 68f60081319..eae983e8601 100644 --- a/Koha/Review.pm +++ b/Koha/Review.pm @@ -17,7 +17,6 @@ package Koha::Review; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Reviews.pm b/Koha/Reviews.pm index 517d93626f7..5e9be0bbbf5 100644 --- a/Koha/Reviews.pm +++ b/Koha/Reviews.pm @@ -17,7 +17,6 @@ package Koha::Reviews; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SMS/Provider.pm b/Koha/SMS/Provider.pm index c651265294d..3771acfb980 100644 --- a/Koha/SMS/Provider.pm +++ b/Koha/SMS/Provider.pm @@ -19,7 +19,6 @@ package Koha::SMS::Provider; use Modern::Perl; -use Carp; use Koha::Patrons; diff --git a/Koha/SMS/Providers.pm b/Koha/SMS/Providers.pm index 35a1aacc30e..3cb2f90756e 100644 --- a/Koha/SMS/Providers.pm +++ b/Koha/SMS/Providers.pm @@ -19,7 +19,6 @@ package Koha::SMS::Providers; use Modern::Perl; -use Carp; use Koha::SMS::Provider; diff --git a/Koha/Schema/Loader/mysql.pm b/Koha/Schema/Loader/mysql.pm index f272e6534f7..4f321b8ba5d 100644 --- a/Koha/Schema/Loader/mysql.pm +++ b/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. diff --git a/Koha/Script.pm b/Koha/Script.pm index aaa2e8b5607..d9e11ea7d8e 100644 --- a/Koha/Script.pm +++ b/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; diff --git a/Koha/SearchEngine.pm b/Koha/SearchEngine.pm index 7aa1f85a6d9..7c08af9f6a3 100644 --- a/Koha/SearchEngine.pm +++ b/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 diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index 74250f3e48f..8950f8fb9ec 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/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 )); diff --git a/Koha/SearchEngine/Elasticsearch/Indexer.pm b/Koha/SearchEngine/Elasticsearch/Indexer.pm index 0c9b3ff380f..0a10832d2ec 100644 --- a/Koha/SearchEngine/Elasticsearch/Indexer.pm +++ b/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; diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index a39931ab0bb..45e8c1f2c2e 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/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; diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index ff56ad1174d..3afcf75c376 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/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 )); diff --git a/Koha/SearchEngine/Indexer.pm b/Koha/SearchEngine/Indexer.pm index 64262ff5877..e64fa35c46c 100644 --- a/Koha/SearchEngine/Indexer.pm +++ b/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'; diff --git a/Koha/SearchEngine/QueryBuilder.pm b/Koha/SearchEngine/QueryBuilder.pm index 62a6b2c49ee..11e6c948429 100644 --- a/Koha/SearchEngine/QueryBuilder.pm +++ b/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"); diff --git a/Koha/SearchEngine/Search.pm b/Koha/SearchEngine/Search.pm index 0b7222741aa..578ae8979c9 100644 --- a/Koha/SearchEngine/Search.pm +++ b/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'; diff --git a/Koha/SearchEngine/Zebra/Indexer.pm b/Koha/SearchEngine/Zebra/Indexer.pm index 8ead358d9ea..01326d510bd 100644 --- a/Koha/SearchEngine/Zebra/Indexer.pm +++ b/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 diff --git a/Koha/SearchEngine/Zebra/Search.pm b/Koha/SearchEngine/Zebra/Search.pm index 850469ec5d8..1d504d384fd 100644 --- a/Koha/SearchEngine/Zebra/Search.pm +++ b/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 diff --git a/Koha/SearchField.pm b/Koha/SearchField.pm index e6c80c79cfc..32fa4054304 100644 --- a/Koha/SearchField.pm +++ b/Koha/SearchField.pm @@ -17,7 +17,6 @@ package Koha::SearchField; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SearchFields.pm b/Koha/SearchFields.pm index 29a8033e70f..deef07a79c0 100644 --- a/Koha/SearchFields.pm +++ b/Koha/SearchFields.pm @@ -17,7 +17,6 @@ package Koha::SearchFields; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SearchMarcMap.pm b/Koha/SearchMarcMap.pm index bf86b781e5e..6f28511c8db 100644 --- a/Koha/SearchMarcMap.pm +++ b/Koha/SearchMarcMap.pm @@ -17,7 +17,6 @@ package Koha::SearchMarcMap; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SearchMarcMaps.pm b/Koha/SearchMarcMaps.pm index 338a51ddb92..d4fb9ce0be1 100644 --- a/Koha/SearchMarcMaps.pm +++ b/Koha/SearchMarcMaps.pm @@ -17,7 +17,6 @@ package Koha::SearchMarcMaps; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Serial.pm b/Koha/Serial.pm index 182edc75f47..052290ed465 100644 --- a/Koha/Serial.pm +++ b/Koha/Serial.pm @@ -19,7 +19,6 @@ package Koha::Serial; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Serial/Item.pm b/Koha/Serial/Item.pm index 3d0b1247078..a68a7299940 100644 --- a/Koha/Serial/Item.pm +++ b/Koha/Serial/Item.pm @@ -19,7 +19,6 @@ package Koha::Serial::Item; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Serial/Items.pm b/Koha/Serial/Items.pm index 7ddaed012bb..5cc563e9757 100644 --- a/Koha/Serial/Items.pm +++ b/Koha/Serial/Items.pm @@ -19,7 +19,6 @@ package Koha::Serial::Items; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Serials.pm b/Koha/Serials.pm index 8cd8c015a93..ad58509d245 100644 --- a/Koha/Serials.pm +++ b/Koha/Serials.pm @@ -19,7 +19,6 @@ package Koha::Serials; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/SharedContent.pm b/Koha/SharedContent.pm index 7082fe03a34..0c5e406caf6 100644 --- a/Koha/SharedContent.pm +++ b/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; diff --git a/Koha/SimpleMARC.pm b/Koha/SimpleMARC.pm index 995e3921237..a501a9441f3 100644 --- a/Koha/SimpleMARC.pm +++ b/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 diff --git a/Koha/Sitemapper/Writer.pm b/Koha/Sitemapper/Writer.pm index 63f147aff8d..a397d62ee05 100644 --- a/Koha/Sitemapper/Writer.pm +++ b/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; diff --git a/Koha/Statistic.pm b/Koha/Statistic.pm index d6fd61ff931..397e440cdb1 100644 --- a/Koha/Statistic.pm +++ b/Koha/Statistic.pm @@ -17,7 +17,6 @@ package Koha::Statistic; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Items; diff --git a/Koha/Statistics.pm b/Koha/Statistics.pm index ecbceebf326..4b3a4ebf391 100644 --- a/Koha/Statistics.pm +++ b/Koha/Statistics.pm @@ -17,7 +17,6 @@ package Koha::Statistics; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/StockRotationItem.pm b/Koha/StockRotationItem.pm index 9ee92c10e61..58f0a6c25b6 100644 --- a/Koha/StockRotationItem.pm +++ b/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); diff --git a/Koha/Subscription.pm b/Koha/Subscription.pm index 07ab1681770..45d1c09fa0d 100644 --- a/Koha/Subscription.pm +++ b/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); diff --git a/Koha/Subscription/Frequencies.pm b/Koha/Subscription/Frequencies.pm index 4952625613b..9b60f21087e 100644 --- a/Koha/Subscription/Frequencies.pm +++ b/Koha/Subscription/Frequencies.pm @@ -17,7 +17,6 @@ package Koha::Subscription::Frequencies; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Subscription/Frequency.pm b/Koha/Subscription/Frequency.pm index 475e744f174..abb47c38e92 100644 --- a/Koha/Subscription/Frequency.pm +++ b/Koha/Subscription/Frequency.pm @@ -17,7 +17,6 @@ package Koha::Subscription::Frequency; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Subscription/Histories.pm b/Koha/Subscription/Histories.pm index 460aedaaf56..3815cd2d87e 100644 --- a/Koha/Subscription/Histories.pm +++ b/Koha/Subscription/Histories.pm @@ -19,7 +19,6 @@ package Koha::Subscription::Histories; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Subscription/History.pm b/Koha/Subscription/History.pm index 4d309e2cb58..e65e93595e5 100644 --- a/Koha/Subscription/History.pm +++ b/Koha/Subscription/History.pm @@ -19,7 +19,6 @@ package Koha::Subscription::History; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Subscription/Routinglist.pm b/Koha/Subscription/Routinglist.pm index ede95b976a3..10cf094da58 100644 --- a/Koha/Subscription/Routinglist.pm +++ b/Koha/Subscription/Routinglist.pm @@ -18,7 +18,6 @@ package Koha::Subscription::Routinglist; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Subscriptions; diff --git a/Koha/Subscription/Routinglists.pm b/Koha/Subscription/Routinglists.pm index 950d608144f..7678a9eafcf 100644 --- a/Koha/Subscription/Routinglists.pm +++ b/Koha/Subscription/Routinglists.pm @@ -18,7 +18,6 @@ package Koha::Subscription::Routinglists; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Subscription::Routinglist; diff --git a/Koha/Subscriptions.pm b/Koha/Subscriptions.pm index 86ee3308440..9636e9f30bb 100644 --- a/Koha/Subscriptions.pm +++ b/Koha/Subscriptions.pm @@ -19,7 +19,6 @@ package Koha::Subscriptions; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Suggestion.pm b/Koha/Suggestion.pm index f9f8c2a4908..5542963d45b 100644 --- a/Koha/Suggestion.pm +++ b/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); diff --git a/Koha/SuggestionEngine.pm b/Koha/SuggestionEngine.pm index ee1b2cc8695..f10f914399e 100644 --- a/Koha/SuggestionEngine.pm +++ b/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); diff --git a/Koha/SuggestionEngine/Plugin/AuthorityFile.pm b/Koha/SuggestionEngine/Plugin/AuthorityFile.pm index cfb34da7aa5..cb538728510 100644 --- a/Koha/SuggestionEngine/Plugin/AuthorityFile.pm +++ b/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); diff --git a/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm b/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm index cb052677208..0c4656e77e8 100644 --- a/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm +++ b/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); diff --git a/Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm b/Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm index 5356276922d..38d9df2b797 100644 --- a/Koha/SuggestionEngine/Plugin/LibrisSpellcheck.pm +++ b/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); diff --git a/Koha/SuggestionEngine/Plugin/Null.pm b/Koha/SuggestionEngine/Plugin/Null.pm index e0603504d38..fc7463ef382 100644 --- a/Koha/SuggestionEngine/Plugin/Null.pm +++ b/Koha/SuggestionEngine/Plugin/Null.pm @@ -33,7 +33,6 @@ SuggestionEngine. use strict; use warnings; -use Carp; use base qw(Koha::SuggestionEngine::Base); diff --git a/Koha/Suggestions.pm b/Koha/Suggestions.pm index 39f4a525fab..03262bb5f1b 100644 --- a/Koha/Suggestions.pm +++ b/Koha/Suggestions.pm @@ -19,7 +19,6 @@ package Koha::Suggestions; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Tag.pm b/Koha/Tag.pm index 1597d7bea2e..089aa4f61d6 100644 --- a/Koha/Tag.pm +++ b/Koha/Tag.pm @@ -17,7 +17,6 @@ package Koha::Tag; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Tags.pm b/Koha/Tags.pm index 08568e1f867..a9a2bba8cd2 100644 --- a/Koha/Tags.pm +++ b/Koha/Tags.pm @@ -17,7 +17,6 @@ package Koha::Tags; use Modern::Perl; -use Carp; use Koha::Tag; diff --git a/Koha/Tags/Approval.pm b/Koha/Tags/Approval.pm index bb0c4df8f2e..ee7153c2ca9 100644 --- a/Koha/Tags/Approval.pm +++ b/Koha/Tags/Approval.pm @@ -17,7 +17,6 @@ package Koha::Tags::Approval; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Tags/Approvals.pm b/Koha/Tags/Approvals.pm index 43400f2f0cb..f7e72ae3528 100644 --- a/Koha/Tags/Approvals.pm +++ b/Koha/Tags/Approvals.pm @@ -17,7 +17,6 @@ package Koha::Tags::Approvals; use Modern::Perl; -use Carp; use Koha::Tags::Approval; diff --git a/Koha/Tags/Index.pm b/Koha/Tags/Index.pm index 66f60744467..0b388acfb6e 100644 --- a/Koha/Tags/Index.pm +++ b/Koha/Tags/Index.pm @@ -17,7 +17,6 @@ package Koha::Tags::Index; use Modern::Perl; -use Carp; use base qw(Koha::Object); diff --git a/Koha/Tags/Indexes.pm b/Koha/Tags/Indexes.pm index 56506a24de7..2ec40bcd44c 100644 --- a/Koha/Tags/Indexes.pm +++ b/Koha/Tags/Indexes.pm @@ -17,7 +17,6 @@ package Koha::Tags::Indexes; use Modern::Perl; -use Carp; use Koha::Tags::Index; diff --git a/Koha/Template/Plugin/Asset.pm b/Koha/Template/Plugin/Asset.pm index 08748b46e35..0afe209805f 100644 --- a/Koha/Template/Plugin/Asset.pm +++ b/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; diff --git a/Koha/Template/Plugin/AudioAlerts.pm b/Koha/Template/Plugin/AudioAlerts.pm index a8877b63adc..a666f20766e 100644 --- a/Koha/Template/Plugin/AudioAlerts.pm +++ b/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 ); diff --git a/Koha/Template/Plugin/AuthorisedValues.pm b/Koha/Template/Plugin/AuthorisedValues.pm index 31d3748f51a..5cb91b83a3c 100644 --- a/Koha/Template/Plugin/AuthorisedValues.pm +++ b/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 { diff --git a/Koha/Template/Plugin/Categories.pm b/Koha/Template/Plugin/Categories.pm index 59d358802ec..db7b2fd0e27 100644 --- a/Koha/Template/Plugin/Categories.pm +++ b/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 { diff --git a/Koha/Template/Plugin/I18N.pm b/Koha/Template/Plugin/I18N.pm index 919d3bc4677..43e2ef3c079 100644 --- a/Koha/Template/Plugin/I18N.pm +++ b/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 diff --git a/Koha/Template/Plugin/KohaDates.pm b/Koha/Template/Plugin/KohaDates.pm index 042268fc97c..783833f7df9 100644 --- a/Koha/Template/Plugin/KohaDates.pm +++ b/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; diff --git a/Koha/Template/Plugin/KohaPlugins.pm b/Koha/Template/Plugin/KohaPlugins.pm index b75d36c437e..d313f731266 100644 --- a/Koha/Template/Plugin/KohaPlugins.pm +++ b/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; diff --git a/Koha/Template/Plugin/To.pm b/Koha/Template/Plugin/To.pm index 67902e6ac00..dccd8e6cfe3 100644 --- a/Koha/Template/Plugin/To.pm +++ b/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 { diff --git a/Koha/Token.pm b/Koha/Token.pm index a3f226d74c5..3f016be86d5 100644 --- a/Koha/Token.pm +++ b/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; diff --git a/Koha/UploadedFiles.pm b/Koha/UploadedFiles.pm index 2f44e974c84..c453c6f9778 100644 --- a/Koha/UploadedFiles.pm +++ b/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); diff --git a/Koha/Uploader.pm b/Koha/Uploader.pm index 4cd6aafb6f7..081bc3f0788 100644 --- a/Koha/Uploader.pm +++ b/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; diff --git a/Koha/Util/FrameworkPlugin.pm b/Koha/Util/FrameworkPlugin.pm index 9b29287c760..d3fcbb9ac81 100644 --- a/Koha/Util/FrameworkPlugin.pm +++ b/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 ); } diff --git a/Koha/Util/MARC.pm b/Koha/Util/MARC.pm index 56f0a984511..3648888b30a 100644 --- a/Koha/Util/MARC.pm +++ b/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 diff --git a/Koha/Util/OpenDocument.pm b/Koha/Util/OpenDocument.pm index 937c9bc60e2..f86c44452d6 100644 --- a/Koha/Util/OpenDocument.pm +++ b/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 ); diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm index c27c695ada6..afecb2b0524 100644 --- a/Koha/Virtualshelf.pm +++ b/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; diff --git a/Koha/Virtualshelfcontent.pm b/Koha/Virtualshelfcontent.pm index f1fd87f39d2..0a7eb5b5ff4 100644 --- a/Koha/Virtualshelfcontent.pm +++ b/Koha/Virtualshelfcontent.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelfcontent; use Modern::Perl; -use Carp; use Koha::Database; use Koha::Exceptions; diff --git a/Koha/Virtualshelfcontents.pm b/Koha/Virtualshelfcontents.pm index 8da9bce454f..23776f395ec 100644 --- a/Koha/Virtualshelfcontents.pm +++ b/Koha/Virtualshelfcontents.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelfcontents; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Virtualshelfshare.pm b/Koha/Virtualshelfshare.pm index a2e919b7b63..5f61e27a84a 100644 --- a/Koha/Virtualshelfshare.pm +++ b/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); diff --git a/Koha/Virtualshelfshares.pm b/Koha/Virtualshelfshares.pm index 4c5eda9dcd9..de709ff49c1 100644 --- a/Koha/Virtualshelfshares.pm +++ b/Koha/Virtualshelfshares.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelfshares; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Virtualshelves.pm b/Koha/Virtualshelves.pm index 3dde3c35da4..25a3b01c508 100644 --- a/Koha/Virtualshelves.pm +++ b/Koha/Virtualshelves.pm @@ -17,7 +17,6 @@ package Koha::Virtualshelves; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/XSLT/Security.pm b/Koha/XSLT/Security.pm index eb56273ac19..09b5b58e080 100644 --- a/Koha/XSLT/Security.pm +++ b/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; diff --git a/Koha/Z3950Responder/Session.pm b/Koha/Z3950Responder/Session.pm index 006bfaf2acf..6f663b5f95c 100644 --- a/Koha/Z3950Responder/Session.pm +++ b/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; diff --git a/Koha/Z3950Server.pm b/Koha/Z3950Server.pm index a4228caa50c..21dc0224fa9 100644 --- a/Koha/Z3950Server.pm +++ b/Koha/Z3950Server.pm @@ -17,7 +17,6 @@ package Koha::Z3950Server; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/Z3950Servers.pm b/Koha/Z3950Servers.pm index 1aea08e988f..96bf35245f5 100644 --- a/Koha/Z3950Servers.pm +++ b/Koha/Z3950Servers.pm @@ -17,7 +17,6 @@ package Koha::Z3950Servers; use Modern::Perl; -use Carp; use Koha::Database; diff --git a/Koha/pdfformat/layout2pages.pm b/Koha/pdfformat/layout2pages.pm index 28f35a0e141..b0d4affbdc9 100644 --- a/Koha/pdfformat/layout2pages.pm +++ b/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 { diff --git a/Koha/pdfformat/layout2pagesde.pm b/Koha/pdfformat/layout2pagesde.pm index d7d69126de4..8d519058982 100644 --- a/Koha/pdfformat/layout2pagesde.pm +++ b/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); } diff --git a/Koha/pdfformat/layout3pages.pm b/Koha/pdfformat/layout3pages.pm index 9c2456be553..fb0d557b185 100644 --- a/Koha/pdfformat/layout3pages.pm +++ b/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 { diff --git a/Koha/pdfformat/layout3pagesfr.pm b/Koha/pdfformat/layout3pagesfr.pm index eb3d88e84af..1003583b6d9 100644 --- a/Koha/pdfformat/layout3pagesfr.pm +++ b/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; diff --git a/about.pl b/about.pl index 3320b36b812..be253d23968 100755 --- a/about.pl +++ b/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; diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index 6e46a86f0f8..3010c6a3a33 100755 --- a/acqui/acqui-home.pl +++ b/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; diff --git a/acqui/add_user_search.pl b/acqui/add_user_search.pl index ea7b2ae9d7e..1246b0149d2 100755 --- a/acqui/add_user_search.pl +++ b/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; diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 7a77cfbcdf9..c0e68dade30 100755 --- a/acqui/addorder.pl +++ b/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; diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index c445fb8064e..43abac8207d 100755 --- a/acqui/addorderiso2709.pl +++ b/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; diff --git a/acqui/ajax-getauthvaluedropbox.pl b/acqui/ajax-getauthvaluedropbox.pl index 41c0a8db413..6d7034b8232 100755 --- a/acqui/ajax-getauthvaluedropbox.pl +++ b/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(); diff --git a/acqui/basket.pl b/acqui/basket.pl index 09545ee3cc4..fbf730c3dd1 100755 --- a/acqui/basket.pl +++ b/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; diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 24a7fc8b510..2d4241e0253 100755 --- a/acqui/basketgroup.pl +++ b/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; diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl index 6e76177cdb6..a7cd098b64e 100755 --- a/acqui/basketheader.pl +++ b/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; diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl index 8528a00a34c..d3d09dd56d7 100755 --- a/acqui/booksellers.pl +++ b/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; diff --git a/acqui/cancelorder.pl b/acqui/cancelorder.pl index cfa9ec960c9..48e5b414232 100755 --- a/acqui/cancelorder.pl +++ b/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; diff --git a/acqui/check_budget_total.pl b/acqui/check_budget_total.pl index be4e55350c1..46379fa0053 100755 --- a/acqui/check_budget_total.pl +++ b/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 diff --git a/acqui/check_uniqueness.pl b/acqui/check_uniqueness.pl index 37c4a22204e..b665b34c3a4 100755 --- a/acqui/check_uniqueness.pl +++ b/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[]'); diff --git a/acqui/duplicate_orders.pl b/acqui/duplicate_orders.pl index 7bbefea2ead..1964b41418c 100755 --- a/acqui/duplicate_orders.pl +++ b/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'); diff --git a/acqui/edi_ean.pl b/acqui/edi_ean.pl index 1e056557c9b..e95dbdfe8a5 100755 --- a/acqui/edi_ean.pl +++ b/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(); diff --git a/acqui/edifactmsgs.pl b/acqui/edifactmsgs.pl index 8e603bb9fdc..179b23423ff 100755 --- a/acqui/edifactmsgs.pl +++ b/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( diff --git a/acqui/edimsg.pl b/acqui/edimsg.pl index 46206ea5f3c..8ac9b8039ef 100755 --- a/acqui/edimsg.pl +++ b/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( diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 961e3d566f0..95759c79177 100755 --- a/acqui/finishreceive.pl +++ b/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'}; diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index e652fb92254..cbb371d4df7 100755 --- a/acqui/histsearch.pl +++ b/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; diff --git a/acqui/invoice-files.pl b/acqui/invoice-files.pl index a470c9f53ac..d4e43cfc836 100755 --- a/acqui/invoice-files.pl +++ b/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; diff --git a/acqui/invoice.pl b/acqui/invoice.pl index dfc4ab4d53e..eaf804d51ec 100755 --- a/acqui/invoice.pl +++ b/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; diff --git a/acqui/invoices.pl b/acqui/invoices.pl index 42e6328cca1..b0e1db2befd 100755 --- a/acqui/invoices.pl +++ b/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; diff --git a/acqui/lateorders-export.pl b/acqui/lateorders-export.pl index 57a080dbd31..a8717774351 100755 --- a/acqui/lateorders-export.pl +++ b/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; diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index 67354b2a144..5999ab0a265 100755 --- a/acqui/lateorders.pl +++ b/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; diff --git a/acqui/modordernotes.pl b/acqui/modordernotes.pl index f529d4b782e..258fb63c6a2 100755 --- a/acqui/modordernotes.pl +++ b/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; diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 0949fe0a343..22c7c3c04f4 100755 --- a/acqui/neworderempty.pl +++ b/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; diff --git a/acqui/newordersubscription.pl b/acqui/newordersubscription.pl index 7d3e8ba40d7..e8d776598bf 100755 --- a/acqui/newordersubscription.pl +++ b/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; diff --git a/acqui/newordersuggestion.pl b/acqui/newordersuggestion.pl index f43e201c069..0ee10365cbe 100755 --- a/acqui/newordersuggestion.pl +++ b/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; diff --git a/acqui/ordered.pl b/acqui/ordered.pl index 0f4e8c6519e..84b49550c13 100755 --- a/acqui/ordered.pl +++ b/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; diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 177b17023da..f684a8ed7a0 100755 --- a/acqui/orderreceive.pl +++ b/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; diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 90ccbe00061..d00d9bdb1e5 100755 --- a/acqui/parcel.pl +++ b/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; diff --git a/acqui/parcels.pl b/acqui/parcels.pl index e5d4330a312..cd6e2562b10 100755 --- a/acqui/parcels.pl +++ b/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 ); diff --git a/acqui/showorder.pl b/acqui/showorder.pl index 89255c94e71..da7cce55b16 100755 --- a/acqui/showorder.pl +++ b/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; diff --git a/acqui/spent.pl b/acqui/spent.pl index b865648c55d..b8269d08df3 100755 --- a/acqui/spent.pl +++ b/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; diff --git a/acqui/supplier.pl b/acqui/supplier.pl index 63d0b33af9f..6766a1adef6 100755 --- a/acqui/supplier.pl +++ b/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; diff --git a/acqui/transferorder.pl b/acqui/transferorder.pl index 433821b5874..72f9087f82b 100755 --- a/acqui/transferorder.pl +++ b/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; diff --git a/acqui/uncertainprice.pl b/acqui/uncertainprice.pl index 2ee68afdc50..770f8fc22f5 100755 --- a/acqui/uncertainprice.pl +++ b/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; diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl index 60c65e49674..b195c88fb6b 100755 --- a/acqui/updatesupplier.pl +++ b/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; diff --git a/acqui/z3950_search.pl b/acqui/z3950_search.pl index 10399d57551..d596cbf227c 100755 --- a/acqui/z3950_search.pl +++ b/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; diff --git a/admin/add_user_search.pl b/admin/add_user_search.pl index 027eb15e683..032301a6d7f 100755 --- a/admin/add_user_search.pl +++ b/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; diff --git a/admin/additional-fields.pl b/admin/additional-fields.pl index 082854a3d45..78dd1a8fc49 100755 --- a/admin/additional-fields.pl +++ b/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; diff --git a/admin/admin-home.pl b/admin/admin-home.pl index 9a076b05123..73f2cc8edf0 100755 --- a/admin/admin-home.pl +++ b/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; diff --git a/admin/adveditorshortcuts.pl b/admin/adveditorshortcuts.pl index 4b78a8676fb..0fbe51c1602 100755 --- a/admin/adveditorshortcuts.pl +++ b/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; diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl index 2d4e7c43a9a..b5932725b51 100755 --- a/admin/aqbudgetperiods.pl +++ b/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, diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl index 0cf65271109..4ed48d47d1e 100755 --- a/admin/aqbudgets.pl +++ b/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; diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl index 891608732ec..83e99d7d0c6 100755 --- a/admin/aqcontract.pl +++ b/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; diff --git a/admin/aqplan.pl b/admin/aqplan.pl index a539b20e720..64b6cd05aba 100755 --- a/admin/aqplan.pl +++ b/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; diff --git a/admin/audio_alerts.pl b/admin/audio_alerts.pl index 4f8de64cede..ed3a9a5e09b 100755 --- a/admin/audio_alerts.pl +++ b/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; diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl index fcb419eed52..2fbe31e22b5 100755 --- a/admin/auth_subfields_structure.pl +++ b/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; diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl index 8a9ab47a2a4..1c952d58a58 100755 --- a/admin/auth_tag_structure.pl +++ b/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; diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index cb5988021d7..f772a84be74 100755 --- a/admin/authorised_values.pl +++ b/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; diff --git a/admin/authtypes.pl b/admin/authtypes.pl index 3b2f86453f3..3fea873e0d9 100755 --- a/admin/authtypes.pl +++ b/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; diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl index 413bb2e225b..9a474857b6b 100755 --- a/admin/background_jobs.pl +++ b/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; diff --git a/admin/biblio_framework.pl b/admin/biblio_framework.pl index 0d8a6a4b0b3..32f2ac11eb8 100755 --- a/admin/biblio_framework.pl +++ b/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; diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl index 455c04ad273..5a2a688c70a 100755 --- a/admin/branch_transfer_limits.pl +++ b/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; diff --git a/admin/branches.pl b/admin/branches.pl index 282c547afe5..b821f2008a8 100755 --- a/admin/branches.pl +++ b/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; diff --git a/admin/cash_registers.pl b/admin/cash_registers.pl index ae39c119864..db55b2aadc7 100755 --- a/admin/cash_registers.pl +++ b/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(); diff --git a/admin/categories.pl b/admin/categories.pl index d8d8513b91c..368960f9cd9 100755 --- a/admin/categories.pl +++ b/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; diff --git a/admin/check_budget_parent.pl b/admin/check_budget_parent.pl index 1c98bd2095c..2274679f3b0 100755 --- a/admin/check_budget_parent.pl +++ b/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 diff --git a/admin/check_parent_total.pl b/admin/check_parent_total.pl index fbd79b2299f..649f0d60001 100755 --- a/admin/check_parent_total.pl +++ b/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 diff --git a/admin/checkmarc.pl b/admin/checkmarc.pl index 126e90fdfff..3dcda21432c 100755 --- a/admin/checkmarc.pl +++ b/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; diff --git a/admin/cities.pl b/admin/cities.pl index c7b03b0271e..f16c9d7a50f 100755 --- a/admin/cities.pl +++ b/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; diff --git a/admin/classsources.pl b/admin/classsources.pl index cbaf4499268..d8b9733f261 100755 --- a/admin/classsources.pl +++ b/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; diff --git a/admin/clone-rules.pl b/admin/clone-rules.pl index d6acf898b2b..9dc78d80940 100755 --- a/admin/clone-rules.pl +++ b/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; diff --git a/admin/columns_settings.pl b/admin/columns_settings.pl index 3d9d68e1406..55d312d4f96 100755 --- a/admin/columns_settings.pl +++ b/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; diff --git a/admin/credit_types.pl b/admin/credit_types.pl index afbe72a82e3..27f6edf2ad6 100755 --- a/admin/credit_types.pl +++ b/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; diff --git a/admin/currency.pl b/admin/currency.pl index d3dfab5e458..28dc2d26735 100755 --- a/admin/currency.pl +++ b/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; diff --git a/admin/debit_types.pl b/admin/debit_types.pl index 887e1e87282..40210479a1f 100755 --- a/admin/debit_types.pl +++ b/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; diff --git a/admin/desks.pl b/admin/desks.pl index e4019020842..bc087a3c9de 100755 --- a/admin/desks.pl +++ b/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; diff --git a/admin/didyoumean.pl b/admin/didyoumean.pl index 9cafc13f770..b584c5b2998 100755 --- a/admin/didyoumean.pl +++ b/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; diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl index 288fec519c2..293f7ef6662 100755 --- a/admin/edi_accounts.pl +++ b/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; diff --git a/admin/edi_ean_accounts.pl b/admin/edi_ean_accounts.pl index a7edcf25f20..87ebe458c71 100755 --- a/admin/edi_ean_accounts.pl +++ b/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(); diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl index bd5ee8331b0..735915d49fd 100755 --- a/admin/import_export_framework.pl +++ b/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; diff --git a/admin/item_circulation_alerts.pl b/admin/item_circulation_alerts.pl index ae6692d058d..67b71a32e2f 100755 --- a/admin/item_circulation_alerts.pl +++ b/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; diff --git a/admin/items_search_field.pl b/admin/items_search_field.pl index ab48babd865..569dce65bbc 100755 --- a/admin/items_search_field.pl +++ b/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); diff --git a/admin/items_search_fields.pl b/admin/items_search_fields.pl index ac2548642b2..0e62eb67c66 100755 --- a/admin/items_search_fields.pl +++ b/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); diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index 2370de93e19..8652c3de9f2 100755 --- a/admin/itemtypes.pl +++ b/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; diff --git a/admin/koha2marclinks.pl b/admin/koha2marclinks.pl index 842364dadba..e731cbebe2a 100755 --- a/admin/koha2marclinks.pl +++ b/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; diff --git a/admin/library_groups.pl b/admin/library_groups.pl index cf561c863bb..5284a881f48 100755 --- a/admin/library_groups.pl +++ b/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; diff --git a/admin/localization.pl b/admin/localization.pl index 3c296c6fc7c..58205d8df7c 100755 --- a/admin/localization.pl +++ b/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; diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 7ee7e269b2f..636c3add4e2 100755 --- a/admin/marc_subfields_structure.pl +++ b/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; diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index 573abbca7c0..7ce19f99acd 100755 --- a/admin/marctagstructure.pl +++ b/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; diff --git a/admin/matching-rules.pl b/admin/matching-rules.pl index 5241b2bab5d..3cdbbb7b6f3 100755 --- a/admin/matching-rules.pl +++ b/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"; diff --git a/admin/oai_set_mappings.pl b/admin/oai_set_mappings.pl index e8b8b7eafa3..02103960f8f 100755 --- a/admin/oai_set_mappings.pl +++ b/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( { diff --git a/admin/oai_sets.pl b/admin/oai_sets.pl index 2d5aa50883b..015d7136049 100755 --- a/admin/oai_sets.pl +++ b/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( { diff --git a/admin/overdrive.pl b/admin/overdrive.pl index ef12d60ed8d..3bff6dae746 100755 --- a/admin/overdrive.pl +++ b/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; diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl index f0c1654cc33..2cf2bf6f3be 100755 --- a/admin/patron-attr-types.pl +++ b/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; diff --git a/admin/preferences.pl b/admin/preferences.pl index f3879d7cb93..49d06ad996e 100755 --- a/admin/preferences.pl +++ b/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; # diff --git a/admin/searchengine/elasticsearch/mappings.pl b/admin/searchengine/elasticsearch/mappings.pl index 4f719208231..1058e941e5f 100755 --- a/admin/searchengine/elasticsearch/mappings.pl +++ b/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; diff --git a/admin/share_content.pl b/admin/share_content.pl index b4c7e0bc6df..89dd4e0cdb7 100755 --- a/admin/share_content.pl +++ b/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; diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 5c7cc22b351..7da7497d3a7 100755 --- a/admin/smart-rules.pl +++ b/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; diff --git a/admin/sms_providers.pl b/admin/sms_providers.pl index ea02f152bb9..a259b8627cd 100755 --- a/admin/sms_providers.pl +++ b/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; diff --git a/admin/smtp_servers.pl b/admin/smtp_servers.pl index 19458a23a42..8c53bfc4be0 100755 --- a/admin/smtp_servers.pl +++ b/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; diff --git a/admin/sru_modmapping.pl b/admin/sru_modmapping.pl index 298a4f57897..67023772e39 100755 --- a/admin/sru_modmapping.pl +++ b/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 diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index e2e690c6f02..1eb54552b12 100755 --- a/admin/systempreferences.pl +++ b/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) diff --git a/admin/transfer_limits.pl b/admin/transfer_limits.pl index 8c67bdaab2e..dfa7f6309cc 100755 --- a/admin/transfer_limits.pl +++ b/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; diff --git a/admin/transport-cost-matrix.pl b/admin/transport-cost-matrix.pl index 935be87ea8a..29452ca581f 100755 --- a/admin/transport-cost-matrix.pl +++ b/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; diff --git a/admin/usage_statistics.pl b/admin/usage_statistics.pl index 635704fab3e..582e92aa1eb 100755 --- a/admin/usage_statistics.pl +++ b/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; diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl index 54b85d97152..d7dd4161c5b 100755 --- a/admin/z3950servers.pl +++ b/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; diff --git a/api/v1/app.pl b/api/v1/app.pl index 93f57f207f1..f841c6088b8 100755 --- a/api/v1/app.pl +++ b/api/v1/app.pl @@ -17,5 +17,5 @@ use Modern::Perl; -require Mojolicious::Commands; +use Mojolicious::Commands; Mojolicious::Commands->start_app('Koha::REST::V1'); diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl index ed6774f5999..69277656426 100755 --- a/authorities/auth_finder.pl +++ b/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; diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl index 691528215d3..d46f68d79a6 100755 --- a/authorities/authorities-home.pl +++ b/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; diff --git a/authorities/authorities.pl b/authorities/authorities.pl index 4e0ecb555f7..33c37aaf4fb 100755 --- a/authorities/authorities.pl +++ b/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); diff --git a/authorities/blinddetail-biblio-search.pl b/authorities/blinddetail-biblio-search.pl index 478a1bf1fc7..1dae908f35f 100755 --- a/authorities/blinddetail-biblio-search.pl +++ b/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; diff --git a/authorities/detail-biblio-search.pl b/authorities/detail-biblio-search.pl index 66bf8ce2fee..0eb510ad9c2 100755 --- a/authorities/detail-biblio-search.pl +++ b/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; diff --git a/authorities/detail.pl b/authorities/detail.pl index be86a811d49..1fefaa9547f 100755 --- a/authorities/detail.pl +++ b/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; diff --git a/authorities/export.pl b/authorities/export.pl index b55ee7ddabe..0703da840b6 100755 --- a/authorities/export.pl +++ b/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; diff --git a/authorities/merge.pl b/authorities/merge.pl index 3b5f6c0fcee..9b29f06ee6a 100755 --- a/authorities/merge.pl +++ b/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; diff --git a/authorities/merge_ajax.pl b/authorities/merge_ajax.pl index 6ed427891c2..2bd17d00641 100755 --- a/authorities/merge_ajax.pl +++ b/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' }); diff --git a/authorities/ysearch.pl b/authorities/ysearch.pl index 92de7b1807b..fc3d51fa858 100755 --- a/authorities/ysearch.pl +++ b/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; diff --git a/basket/basket.pl b/basket/basket.pl index 44727d2364d..30f73b8783e 100755 --- a/basket/basket.pl +++ b/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; diff --git a/basket/downloadcart.pl b/basket/downloadcart.pl index f8478770c2d..c1e80bf40d6 100755 --- a/basket/downloadcart.pl +++ b/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; diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 9e273b1f45b..1ea56fce6a9 100755 --- a/basket/sendbasket.pl +++ b/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; diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index d26780a8e2b..969aca17a02 100755 --- a/catalogue/ISBDdetail.pl +++ b/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; diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index e275077ac2c..7ddbbd40dde 100755 --- a/catalogue/MARCdetail.pl +++ b/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 ); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index d4ab19edba0..b06c90a8663 100755 --- a/catalogue/detail.pl +++ b/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; diff --git a/catalogue/export.pl b/catalogue/export.pl index cb6f2d8129c..3785116581c 100755 --- a/catalogue/export.pl +++ b/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 ); diff --git a/catalogue/getitem-ajax.pl b/catalogue/getitem-ajax.pl index 6180874555f..9dad680e0c5 100755 --- a/catalogue/getitem-ajax.pl +++ b/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; diff --git a/catalogue/imageviewer.pl b/catalogue/imageviewer.pl index 9cc96c11d64..e9c43a3935e 100755 --- a/catalogue/imageviewer.pl +++ b/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; diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl index e81ec56de50..8d17dc933af 100755 --- a/catalogue/issuehistory.pl +++ b/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; diff --git a/catalogue/item-export.pl b/catalogue/item-export.pl index fbc69bf71a7..0867376d302 100755 --- a/catalogue/item-export.pl +++ b/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; diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index 0329f4b1d8e..9de6fc601f2 100755 --- a/catalogue/itemsearch.pl +++ b/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; diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl index 643d091dd09..a8f33a674f1 100755 --- a/catalogue/labeledMARCdetail.pl +++ b/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; diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 94a7eab12f5..38eab6aafaa 100755 --- a/catalogue/moredetail.pl +++ b/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; diff --git a/catalogue/search-history.pl b/catalogue/search-history.pl index 092be2e89f5..42bef7cfd46 100755 --- a/catalogue/search-history.pl +++ b/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; diff --git a/catalogue/search.pl b/catalogue/search.pl index 8bd70fc8935..632d9d2e99e 100755 --- a/catalogue/search.pl +++ b/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; diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl index 7633b5f6bd9..8292bfe746c 100755 --- a/catalogue/showmarc.pl +++ b/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( diff --git a/catalogue/stockrotation.pl b/catalogue/stockrotation.pl index 015b1235dcf..27813c02e83 100755 --- a/catalogue/stockrotation.pl +++ b/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; diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl index 9ff9f9b2d52..6d9022ff871 100755 --- a/catalogue/updateitem.pl +++ b/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; diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 7eba09f55dd..138fceab445 100755 --- a/cataloguing/addbiblio.pl +++ b/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'); diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl index 53313bb5f77..b9f3d6e719c 100755 --- a/cataloguing/addbooks.pl +++ b/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; diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index b1e03573988..faa5ab75bc5 100755 --- a/cataloguing/additem.pl +++ b/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; diff --git a/cataloguing/editor.pl b/cataloguing/editor.pl index cfef40490a0..c2864a31fdc 100755 --- a/cataloguing/editor.pl +++ b/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; diff --git a/cataloguing/linkitem.pl b/cataloguing/linkitem.pl index aaa4f1d14a2..e6f89762c7d 100755 --- a/cataloguing/linkitem.pl +++ b/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; diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index 7b1f81635cf..7ed6ca125e2 100755 --- a/cataloguing/merge.pl +++ b/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; diff --git a/cataloguing/merge_ajax.pl b/cataloguing/merge_ajax.pl index aef7dcbfb90..6a76a45fb9f 100755 --- a/cataloguing/merge_ajax.pl +++ b/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( diff --git a/cataloguing/moveitem.pl b/cataloguing/moveitem.pl index c0d46413a38..39e1dada8f9 100755 --- a/cataloguing/moveitem.pl +++ b/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; diff --git a/cataloguing/value_builder/EXAMPLE.pl b/cataloguing/value_builder/EXAMPLE.pl index 2e13d6ad862..691e69f8e2b 100755 --- a/cataloguing/value_builder/EXAMPLE.pl +++ b/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 diff --git a/cataloguing/value_builder/barcode.pl b/cataloguing/value_builder/barcode.pl index 6a7b6222bed..da1ec86ac98 100755 --- a/cataloguing/value_builder/barcode.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/barcode_manual.pl b/cataloguing/value_builder/barcode_manual.pl index 907ce3d482d..a3840bd436e 100755 --- a/cataloguing/value_builder/barcode_manual.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/callnumber-KU.pl b/cataloguing/value_builder/callnumber-KU.pl index 09f733fc6fd..37b7e16d006 100755 --- a/cataloguing/value_builder/callnumber-KU.pl +++ b/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 diff --git a/cataloguing/value_builder/callnumber.pl b/cataloguing/value_builder/callnumber.pl index fd3b068e288..629f1c41c71 100755 --- a/cataloguing/value_builder/callnumber.pl +++ b/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 diff --git a/cataloguing/value_builder/cn_browser.pl b/cataloguing/value_builder/cn_browser.pl index 2acdcc782a6..b4e54edd0e8 100755 --- a/cataloguing/value_builder/cn_browser.pl +++ b/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; diff --git a/cataloguing/value_builder/dateaccessioned.pl b/cataloguing/value_builder/dateaccessioned.pl index c88f65cc846..1ce91e55f6c 100755 --- a/cataloguing/value_builder/dateaccessioned.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/macles.pl b/cataloguing/value_builder/macles.pl index ea769fa8e3d..8579dc04d52 100755 --- a/cataloguing/value_builder/macles.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl index 4ff1c9a5380..b4f28521f96 100755 --- a/cataloguing/value_builder/marc21_field_006.pl +++ b/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; diff --git a/cataloguing/value_builder/marc21_field_007.pl b/cataloguing/value_builder/marc21_field_007.pl index ee7a91a699d..093653d1bfb 100755 --- a/cataloguing/value_builder/marc21_field_007.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl index 78961f4ceda..9f87ae393b7 100755 --- a/cataloguing/value_builder/marc21_field_008.pl +++ b/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|; diff --git a/cataloguing/value_builder/marc21_field_008_authorities.pl b/cataloguing/value_builder/marc21_field_008_authorities.pl index 414d9ff688b..e7a7f168d88 100755 --- a/cataloguing/value_builder/marc21_field_008_authorities.pl +++ b/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'; diff --git a/cataloguing/value_builder/marc21_field_008_classifications.pl b/cataloguing/value_builder/marc21_field_008_classifications.pl index 9a195845427..c5979f8f7e4 100755 --- a/cataloguing/value_builder/marc21_field_008_classifications.pl +++ b/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'; diff --git a/cataloguing/value_builder/marc21_leader.pl b/cataloguing/value_builder/marc21_leader.pl index 659bb9aeee4..85f73463296 100755 --- a/cataloguing/value_builder/marc21_leader.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/marc21_leader_authorities.pl b/cataloguing/value_builder/marc21_leader_authorities.pl index 5bd0348e4dd..04a55ea28bf 100755 --- a/cataloguing/value_builder/marc21_leader_authorities.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl index adc520ee2bd..5bff56495d5 100755 --- a/cataloguing/value_builder/marc21_linking_section.pl +++ b/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; diff --git a/cataloguing/value_builder/normarc_field_007.pl b/cataloguing/value_builder/normarc_field_007.pl index e2e5bc60def..f01b45f9fd1 100755 --- a/cataloguing/value_builder/normarc_field_007.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/normarc_field_008.pl b/cataloguing/value_builder/normarc_field_008.pl index de487bd7432..fc1a9417fa1 100755 --- a/cataloguing/value_builder/normarc_field_008.pl +++ b/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); diff --git a/cataloguing/value_builder/normarc_leader.pl b/cataloguing/value_builder/normarc_leader.pl index 8314d637ea8..15ae94a62d2 100755 --- a/cataloguing/value_builder/normarc_leader.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/stocknumberAV.pl b/cataloguing/value_builder/stocknumberAV.pl index 850fbe849dc..793cf1066a3 100755 --- a/cataloguing/value_builder/stocknumberAV.pl +++ b/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 diff --git a/cataloguing/value_builder/stocknumberam123.pl b/cataloguing/value_builder/stocknumberam123.pl index be36fe20729..e1f54ad6603 100755 --- a/cataloguing/value_builder/stocknumberam123.pl +++ b/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 diff --git a/cataloguing/value_builder/unimarc_field_010.pl b/cataloguing/value_builder/unimarc_field_010.pl index 73b7ff7fe98..56a5c5c3ceb 100755 --- a/cataloguing/value_builder/unimarc_field_010.pl +++ b/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 { diff --git a/cataloguing/value_builder/unimarc_field_100.pl b/cataloguing/value_builder/unimarc_field_100.pl index e5d746a6caf..ef2e08bb9b4 100755 --- a/cataloguing/value_builder/unimarc_field_100.pl +++ b/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 { diff --git a/cataloguing/value_builder/unimarc_field_100_authorities.pl b/cataloguing/value_builder/unimarc_field_100_authorities.pl index 4a0e588e52d..ff7aa576f32 100755 --- a/cataloguing/value_builder/unimarc_field_100_authorities.pl +++ b/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 { diff --git a/cataloguing/value_builder/unimarc_field_105.pl b/cataloguing/value_builder/unimarc_field_105.pl index 9e80cd06d52..e239de664e8 100755 --- a/cataloguing/value_builder/unimarc_field_105.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_106.pl b/cataloguing/value_builder/unimarc_field_106.pl index de4fb67b44c..488b6ba8891 100755 --- a/cataloguing/value_builder/unimarc_field_106.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_110.pl b/cataloguing/value_builder/unimarc_field_110.pl index 4e7287c2504..79b173aca75 100755 --- a/cataloguing/value_builder/unimarc_field_110.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_115a.pl b/cataloguing/value_builder/unimarc_field_115a.pl index e052a1b8208..c741a8fa44c 100755 --- a/cataloguing/value_builder/unimarc_field_115a.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_115b.pl b/cataloguing/value_builder/unimarc_field_115b.pl index de5e68449a9..55adaf2ca19 100755 --- a/cataloguing/value_builder/unimarc_field_115b.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_116.pl b/cataloguing/value_builder/unimarc_field_116.pl index ef6e5034ee3..858ab48d8a5 100755 --- a/cataloguing/value_builder/unimarc_field_116.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_117.pl b/cataloguing/value_builder/unimarc_field_117.pl index 3e5c01f10e2..4d4223c5c2f 100755 --- a/cataloguing/value_builder/unimarc_field_117.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_120.pl b/cataloguing/value_builder/unimarc_field_120.pl index 0c8157adbfb..1450a5e35be 100755 --- a/cataloguing/value_builder/unimarc_field_120.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_121a.pl b/cataloguing/value_builder/unimarc_field_121a.pl index 39a6b846113..0da0894d429 100755 --- a/cataloguing/value_builder/unimarc_field_121a.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_121b.pl b/cataloguing/value_builder/unimarc_field_121b.pl index 7c3b6845ba6..bc5bf1ec951 100755 --- a/cataloguing/value_builder/unimarc_field_121b.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_122.pl b/cataloguing/value_builder/unimarc_field_122.pl index d98b48824ac..0b326c443c6 100755 --- a/cataloguing/value_builder/unimarc_field_122.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123a.pl b/cataloguing/value_builder/unimarc_field_123a.pl index f55b44e8b91..cf74e41029d 100755 --- a/cataloguing/value_builder/unimarc_field_123a.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123d.pl b/cataloguing/value_builder/unimarc_field_123d.pl index c73698f1a69..9fb25ffb2ea 100755 --- a/cataloguing/value_builder/unimarc_field_123d.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123e.pl b/cataloguing/value_builder/unimarc_field_123e.pl index c73698f1a69..9fb25ffb2ea 100755 --- a/cataloguing/value_builder/unimarc_field_123e.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123f.pl b/cataloguing/value_builder/unimarc_field_123f.pl index 5e95c6be91d..660d601df6f 100755 --- a/cataloguing/value_builder/unimarc_field_123f.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123g.pl b/cataloguing/value_builder/unimarc_field_123g.pl index c73698f1a69..9fb25ffb2ea 100755 --- a/cataloguing/value_builder/unimarc_field_123g.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123i.pl b/cataloguing/value_builder/unimarc_field_123i.pl index 3ad3e93fd53..51d6477673c 100755 --- a/cataloguing/value_builder/unimarc_field_123i.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_123j.pl b/cataloguing/value_builder/unimarc_field_123j.pl index e8379e81a86..7ca7f07d3ab 100755 --- a/cataloguing/value_builder/unimarc_field_123j.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124.pl b/cataloguing/value_builder/unimarc_field_124.pl index 7ec1b474bf1..cfcb8d7c7fe 100755 --- a/cataloguing/value_builder/unimarc_field_124.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124a.pl b/cataloguing/value_builder/unimarc_field_124a.pl index 1b4ac5abd6c..9d14d7a9fd2 100755 --- a/cataloguing/value_builder/unimarc_field_124a.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124b.pl b/cataloguing/value_builder/unimarc_field_124b.pl index 51424f111ce..e004bddfd89 100755 --- a/cataloguing/value_builder/unimarc_field_124b.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124c.pl b/cataloguing/value_builder/unimarc_field_124c.pl index b9df679e925..19f8a130ab5 100755 --- a/cataloguing/value_builder/unimarc_field_124c.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124d.pl b/cataloguing/value_builder/unimarc_field_124d.pl index 35cbcbef802..a100375532b 100755 --- a/cataloguing/value_builder/unimarc_field_124d.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124e.pl b/cataloguing/value_builder/unimarc_field_124e.pl index 76e0e8314b8..73226113aea 100755 --- a/cataloguing/value_builder/unimarc_field_124e.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124f.pl b/cataloguing/value_builder/unimarc_field_124f.pl index 732b825bda8..8a0836a7a55 100755 --- a/cataloguing/value_builder/unimarc_field_124f.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_124g.pl b/cataloguing/value_builder/unimarc_field_124g.pl index 1262cdf0331..3f40b1e9e9e 100755 --- a/cataloguing/value_builder/unimarc_field_124g.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_125.pl b/cataloguing/value_builder/unimarc_field_125.pl index 958c6600a6b..4eb86d9cbf3 100755 --- a/cataloguing/value_builder/unimarc_field_125.pl +++ b/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 diff --git a/cataloguing/value_builder/unimarc_field_125a.pl b/cataloguing/value_builder/unimarc_field_125a.pl index 9c6473534aa..947050f38d8 100755 --- a/cataloguing/value_builder/unimarc_field_125a.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_125b.pl b/cataloguing/value_builder/unimarc_field_125b.pl index 8c19929bcce..d5569498355 100755 --- a/cataloguing/value_builder/unimarc_field_125b.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_126.pl b/cataloguing/value_builder/unimarc_field_126.pl index 7ec1b474bf1..cfcb8d7c7fe 100755 --- a/cataloguing/value_builder/unimarc_field_126.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_126a.pl b/cataloguing/value_builder/unimarc_field_126a.pl index 38c8827e67f..f5ed0f7f03b 100755 --- a/cataloguing/value_builder/unimarc_field_126a.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_126b.pl b/cataloguing/value_builder/unimarc_field_126b.pl index b9c8709a5ad..1c261bcc807 100755 --- a/cataloguing/value_builder/unimarc_field_126b.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_127.pl b/cataloguing/value_builder/unimarc_field_127.pl index 329db611d02..9845a547edc 100755 --- a/cataloguing/value_builder/unimarc_field_127.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_128a.pl b/cataloguing/value_builder/unimarc_field_128a.pl index f1d30988cb5..4b6ad8e90ad 100755 --- a/cataloguing/value_builder/unimarc_field_128a.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_128b.pl b/cataloguing/value_builder/unimarc_field_128b.pl index c237733060b..1c860bf3b91 100755 --- a/cataloguing/value_builder/unimarc_field_128b.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_128c.pl b/cataloguing/value_builder/unimarc_field_128c.pl index 5a876ce7ae5..56ce4a1d688 100755 --- a/cataloguing/value_builder/unimarc_field_128c.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_130.pl b/cataloguing/value_builder/unimarc_field_130.pl index a0cb7ec9305..19db6d63217 100755 --- a/cataloguing/value_builder/unimarc_field_130.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_135a.pl b/cataloguing/value_builder/unimarc_field_135a.pl index 3a95a5f3676..050f8ec8209 100755 --- a/cataloguing/value_builder/unimarc_field_135a.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_140.pl b/cataloguing/value_builder/unimarc_field_140.pl index 492ce14a1c7..467ecb412a1 100755 --- a/cataloguing/value_builder/unimarc_field_140.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_141.pl b/cataloguing/value_builder/unimarc_field_141.pl index 45643926be3..907f3e39af4 100755 --- a/cataloguing/value_builder/unimarc_field_141.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_210c.pl b/cataloguing/value_builder/unimarc_field_210c.pl index 7bda1f3e2cd..4ffc85f6030 100755 --- a/cataloguing/value_builder/unimarc_field_210c.pl +++ b/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 diff --git a/cataloguing/value_builder/unimarc_field_210c_bis.pl b/cataloguing/value_builder/unimarc_field_210c_bis.pl index dcfefc4cf3e..5204ddd6623 100755 --- a/cataloguing/value_builder/unimarc_field_210c_bis.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_225a.pl b/cataloguing/value_builder/unimarc_field_225a.pl index 8a3a989709c..761302cd23e 100755 --- a/cataloguing/value_builder/unimarc_field_225a.pl +++ b/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 diff --git a/cataloguing/value_builder/unimarc_field_225a_bis.pl b/cataloguing/value_builder/unimarc_field_225a_bis.pl index 15990d031c0..5bfedad414c 100755 --- a/cataloguing/value_builder/unimarc_field_225a_bis.pl +++ b/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 ) = @_; diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index 9c2f0246003..832305929af 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/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; diff --git a/cataloguing/value_builder/unimarc_field_686a.pl b/cataloguing/value_builder/unimarc_field_686a.pl index 778d0a91d7e..38a1e48513e 100755 --- a/cataloguing/value_builder/unimarc_field_686a.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_field_700-4.pl b/cataloguing/value_builder/unimarc_field_700-4.pl index c6388ec9b5b..895db7a1d28 100755 --- a/cataloguing/value_builder/unimarc_field_700-4.pl +++ b/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) = @_; diff --git a/cataloguing/value_builder/unimarc_leader.pl b/cataloguing/value_builder/unimarc_leader.pl index cae62d01f49..44d8c9319c2 100755 --- a/cataloguing/value_builder/unimarc_leader.pl +++ b/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 ) = @_; diff --git a/cataloguing/ysearch.pl b/cataloguing/ysearch.pl index 1683da4835a..87a9aaa0391 100755 --- a/cataloguing/ysearch.pl +++ b/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'); diff --git a/cataloguing/z3950_auth_search.pl b/cataloguing/z3950_auth_search.pl index e97c47d91fb..da93dac37f2 100755 --- a/cataloguing/z3950_auth_search.pl +++ b/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; diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl index f5f04246d6d..8acc92c25d0 100755 --- a/cataloguing/z3950_search.pl +++ b/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'); diff --git a/circ/add_message.pl b/circ/add_message.pl index 1c9630a1dbe..ee90af35227 100755 --- a/circ/add_message.pl +++ b/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; diff --git a/circ/article-request-slip.pl b/circ/article-request-slip.pl index 2175561edba..18d03bb5f0d 100755 --- a/circ/article-request-slip.pl +++ b/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; diff --git a/circ/article-requests.pl b/circ/article-requests.pl index 3e856bcafa1..3e918dd4c6e 100755 --- a/circ/article-requests.pl +++ b/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; diff --git a/circ/bookcount.pl b/circ/bookcount.pl index 9a6af8110e8..eaca8c4d040 100755 --- a/circ/bookcount.pl +++ b/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; diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl index 422b32cda60..0bea167690b 100755 --- a/circ/branchoverdues.pl +++ b/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 diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index 9a652750de9..4e23ae6d7dc 100755 --- a/circ/branchtransfers.pl +++ b/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; diff --git a/circ/checkout-notes.pl b/circ/checkout-notes.pl index 61ce7cc3531..e94bea06c9f 100755 --- a/circ/checkout-notes.pl +++ b/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; diff --git a/circ/circulation-home.pl b/circ/circulation-home.pl index f68535d1f19..239051d8503 100755 --- a/circ/circulation-home.pl +++ b/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; diff --git a/circ/circulation.pl b/circ/circulation.pl index 4fd72616c42..7988782577f 100755 --- a/circ/circulation.pl +++ b/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 diff --git a/circ/del_message.pl b/circ/del_message.pl index 2ce34642cd9..778c4582268 100755 --- a/circ/del_message.pl +++ b/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; diff --git a/circ/hold-transfer-slip.pl b/circ/hold-transfer-slip.pl index 5d21f3d23ab..61aef56c4cd 100755 --- a/circ/hold-transfer-slip.pl +++ b/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"); diff --git a/circ/offline-mf.pl b/circ/offline-mf.pl index 01b1d7c1866..19eb644f9e9 100755 --- a/circ/offline-mf.pl +++ b/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( diff --git a/circ/offline.pl b/circ/offline.pl index d1500d62009..3843cb7243c 100755 --- a/circ/offline.pl +++ b/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; diff --git a/circ/on-site_checkouts.pl b/circ/on-site_checkouts.pl index c581e8ef9a7..41e9a877bdd 100755 --- a/circ/on-site_checkouts.pl +++ b/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; diff --git a/circ/overdue.pl b/circ/overdue.pl index c402588d19b..b8ed200b527 100755 --- a/circ/overdue.pl +++ b/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; diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 9310f26bbfe..0b2fea21955 100755 --- a/circ/pendingreserves.pl +++ b/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; diff --git a/circ/renew.pl b/circ/renew.pl index acce7770af6..383155416c4 100755 --- a/circ/renew.pl +++ b/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; diff --git a/circ/request-article.pl b/circ/request-article.pl index fdbd74a5254..678c4c96941 100755 --- a/circ/request-article.pl +++ b/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; diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl index 812f9e4e344..7311d1e8c94 100755 --- a/circ/reserveratios.pl +++ b/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; diff --git a/circ/returns.pl b/circ/returns.pl index e456e531f2c..914d5de35c2 100755 --- a/circ/returns.pl +++ b/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; diff --git a/circ/set-library.pl b/circ/set-library.pl index b10ccc0a0e6..b03759be628 100755 --- a/circ/set-library.pl +++ b/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; diff --git a/circ/transfer-slip.pl b/circ/transfer-slip.pl index b0b6ba437ec..1bd013d8546 100755 --- a/circ/transfer-slip.pl +++ b/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"); diff --git a/circ/transfers_to_send.pl b/circ/transfers_to_send.pl index 07679ddce90..fad59fd3bcb 100755 --- a/circ/transfers_to_send.pl +++ b/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'); diff --git a/circ/transferstoreceive.pl b/circ/transferstoreceive.pl index ffa89b2de9b..d0545b20e98 100755 --- a/circ/transferstoreceive.pl +++ b/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; diff --git a/circ/view_holdsqueue.pl b/circ/view_holdsqueue.pl index be638753536..81b900ba2a3 100755 --- a/circ/view_holdsqueue.pl +++ b/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; diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 4f654a12ede..c9d4e84e822 100755 --- a/circ/waitingreserves.pl +++ b/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; diff --git a/circ/ysearch.pl b/circ/ysearch.pl index a52568640ec..75f6f1dc61a 100755 --- a/circ/ysearch.pl +++ b/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 ); diff --git a/clubs/club-enrollments.pl b/clubs/club-enrollments.pl index 6163c70894a..3eac228bb7a 100755 --- a/clubs/club-enrollments.pl +++ b/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; diff --git a/clubs/clubs-add-modify.pl b/clubs/clubs-add-modify.pl index 058d8222ba5..4a41f5c77a1 100755 --- a/clubs/clubs-add-modify.pl +++ b/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; diff --git a/clubs/clubs.pl b/clubs/clubs.pl index d2d5a963727..bb4dee6dccd 100755 --- a/clubs/clubs.pl +++ b/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; diff --git a/clubs/patron-clubs-tab.pl b/clubs/patron-clubs-tab.pl index 1fc47b4dcbd..1a12083e655 100755 --- a/clubs/patron-clubs-tab.pl +++ b/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; diff --git a/clubs/patron-enroll.pl b/clubs/patron-enroll.pl index 3642996b5cb..367b3c0f4b7 100755 --- a/clubs/patron-enroll.pl +++ b/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; diff --git a/clubs/templates-add-modify.pl b/clubs/templates-add-modify.pl index 7e22af14ce2..f32a6d107df 100755 --- a/clubs/templates-add-modify.pl +++ b/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; diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index 02999c2e0be..10b74a40cce 100755 --- a/course_reserves/add_items.pl +++ b/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; diff --git a/course_reserves/batch_add_items.pl b/course_reserves/batch_add_items.pl index 8343da2b7de..1f66ee82e58 100755 --- a/course_reserves/batch_add_items.pl +++ b/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; diff --git a/course_reserves/batch_rm_items.pl b/course_reserves/batch_rm_items.pl index bd78bc41c91..de0a49d3b05 100755 --- a/course_reserves/batch_rm_items.pl +++ b/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; diff --git a/course_reserves/course-details.pl b/course_reserves/course-details.pl index 35b2bc76959..e5c7efe5b29 100755 --- a/course_reserves/course-details.pl +++ b/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; diff --git a/course_reserves/course-reserves.pl b/course_reserves/course-reserves.pl index 1ecda7ad9e1..6dafac9e99c 100755 --- a/course_reserves/course-reserves.pl +++ b/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; diff --git a/course_reserves/course.pl b/course_reserves/course.pl index c5fb37baa34..8d66bdcbd5d 100755 --- a/course_reserves/course.pl +++ b/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; diff --git a/course_reserves/mod_course.pl b/course_reserves/mod_course.pl index 060b2a129fc..3abcb9731fa 100755 --- a/course_reserves/mod_course.pl +++ b/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( diff --git a/docs/CAS/CASProxy/examples/proxy_cas_callback.pl b/docs/CAS/CASProxy/examples/proxy_cas_callback.pl index 9c6214795bf..75df85ffd65 100755 --- a/docs/CAS/CASProxy/examples/proxy_cas_callback.pl +++ b/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); diff --git a/docs/CAS/CASProxy/examples/proxy_cas_data.pl b/docs/CAS/CASProxy/examples/proxy_cas_data.pl index 6346b5ec543..ed2e357acff 100755 --- a/docs/CAS/CASProxy/examples/proxy_cas_data.pl +++ b/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); diff --git a/errors/400.pl b/errors/400.pl index f2bf9d5ee0b..e3cfc5e0bb3 100755 --- a/errors/400.pl +++ b/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'); diff --git a/errors/401.pl b/errors/401.pl index e16ca381596..5cc3ac432dc 100755 --- a/errors/401.pl +++ b/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'); diff --git a/errors/402.pl b/errors/402.pl index a6d40ff05cc..0ffe905ef69 100755 --- a/errors/402.pl +++ b/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'); diff --git a/errors/403.pl b/errors/403.pl index d3187a6f3a9..1a45904f9dc 100755 --- a/errors/403.pl +++ b/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'); diff --git a/errors/404.pl b/errors/404.pl index e2f0079f187..a784979154f 100755 --- a/errors/404.pl +++ b/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'); diff --git a/errors/500.pl b/errors/500.pl index 4f80a5089c2..df8940abc9a 100755 --- a/errors/500.pl +++ b/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'); diff --git a/help.pl b/help.pl index 4dd3ac3c122..92162539554 100755 --- a/help.pl +++ b/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; diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index dfc27efcba2..fef5e550c75 100755 --- a/ill/ill-requests.pl +++ b/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; diff --git a/installer/data/mysql/backfill_statistics.pl b/installer/data/mysql/backfill_statistics.pl index e289e571e1e..8c573cbc548 100755 --- a/installer/data/mysql/backfill_statistics.pl +++ b/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; diff --git a/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl b/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl index b3e4b06f372..b1fbdf6128e 100755 --- a/installer/data/mysql/fix_unclosed_nonaccruing_fines_bug17135.pl +++ b/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); diff --git a/installer/data/mysql/update22to30.pl b/installer/data/mysql/update22to30.pl index 6a8a1ecd118..c5a183dae9d 100755 --- a/installer/data/mysql/update22to30.pl +++ b/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 diff --git a/installer/html-template-to-template-toolkit.pl b/installer/html-template-to-template-toolkit.pl index 2b9084b4b23..c1ad8a4917a 100755 --- a/installer/html-template-to-template-toolkit.pl +++ b/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; diff --git a/labels/label-create-pdf.pl b/labels/label-create-pdf.pl index b76a013cdfb..f1cd47183c1 100755 --- a/labels/label-create-pdf.pl +++ b/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; diff --git a/labels/label-create-xml.pl b/labels/label-create-xml.pl index 0df58752a04..3962cfb5022 100755 --- a/labels/label-create-xml.pl +++ b/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; diff --git a/labels/label-edit-batch.pl b/labels/label-edit-batch.pl index c263bc4bab2..ac2da6392f7 100755 --- a/labels/label-edit-batch.pl +++ b/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; diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl index 8c4e57130f1..c9ca26c1626 100755 --- a/labels/label-edit-layout.pl +++ b/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; diff --git a/labels/label-edit-profile.pl b/labels/label-edit-profile.pl index 9e3fbe09e56..257bf4382d9 100755 --- a/labels/label-edit-profile.pl +++ b/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; diff --git a/labels/label-edit-range.pl b/labels/label-edit-range.pl index 509250f175e..09adba3ffec 100755 --- a/labels/label-edit-range.pl +++ b/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( diff --git a/labels/label-edit-template.pl b/labels/label-edit-template.pl index 17186c74bf6..9e6a019d092 100755 --- a/labels/label-edit-template.pl +++ b/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; diff --git a/labels/label-home.pl b/labels/label-home.pl index 4b3381c33c2..3690c506fb4 100755 --- a/labels/label-home.pl +++ b/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( diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl index 0dc0ea55ffe..161fca443b5 100755 --- a/labels/label-item-search.pl +++ b/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; diff --git a/labels/label-manage.pl b/labels/label-manage.pl index 05d57c973c6..01a7d5babe9 100755 --- a/labels/label-manage.pl +++ b/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; diff --git a/labels/label-print.pl b/labels/label-print.pl index 0d1e0bba197..f3dd120f18c 100755 --- a/labels/label-print.pl +++ b/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; diff --git a/labels/spinelabel-home.pl b/labels/spinelabel-home.pl index 3648670af20..b149f318995 100755 --- a/labels/spinelabel-home.pl +++ b/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; diff --git a/labels/spinelabel-print.pl b/labels/spinelabel-print.pl index ee9a8205194..76a6fc5e36b 100755 --- a/labels/spinelabel-print.pl +++ b/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; diff --git a/lib/CGI/Session/Serialize/yamlxs.pm b/lib/CGI/Session/Serialize/yamlxs.pm index 77d2a8d51a2..88d25e704df 100644 --- a/lib/CGI/Session/Serialize/yamlxs.pm +++ b/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" ); diff --git a/mainpage.pl b/mainpage.pl index 40003241737..0999f58199c 100755 --- a/mainpage.pl +++ b/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; diff --git a/members/accountline-details.pl b/members/accountline-details.pl index a5c37079aa2..699993db761 100755 --- a/members/accountline-details.pl +++ b/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; diff --git a/members/apikeys.pl b/members/apikeys.pl index fb9051d1c49..f6fde368e4e 100755 --- a/members/apikeys.pl +++ b/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; diff --git a/members/boraccount.pl b/members/boraccount.pl index 0cafc5f1ec5..b28e6659047 100755 --- a/members/boraccount.pl +++ b/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; diff --git a/members/cancel-charge.pl b/members/cancel-charge.pl index 4c655fa1747..2f5ff42514c 100755 --- a/members/cancel-charge.pl +++ b/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; diff --git a/members/deletemem.pl b/members/deletemem.pl index 78fd7f1dca8..02e3714c758 100755 --- a/members/deletemem.pl +++ b/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; diff --git a/members/discharge.pl b/members/discharge.pl index 7e055c6fd81..e0f4b2d8cc2 100755 --- a/members/discharge.pl +++ b/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; diff --git a/members/discharges.pl b/members/discharges.pl index de19751ee08..574f3d9d5e6 100755 --- a/members/discharges.pl +++ b/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; diff --git a/members/files.pl b/members/files.pl index 1cb9d61d293..2abfbc71dee 100755 --- a/members/files.pl +++ b/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; diff --git a/members/guarantor_search.pl b/members/guarantor_search.pl index b5d31ed0698..40142eb9131 100755 --- a/members/guarantor_search.pl +++ b/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; diff --git a/members/holdshistory.pl b/members/holdshistory.pl index c05bf43dd32..8564c09a699 100755 --- a/members/holdshistory.pl +++ b/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; diff --git a/members/housebound.pl b/members/housebound.pl index e3c06225b21..c86fad8b33c 100755 --- a/members/housebound.pl +++ b/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; diff --git a/members/ill-requests.pl b/members/ill-requests.pl index 771d1e7c70d..f2b23844c07 100755 --- a/members/ill-requests.pl +++ b/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; diff --git a/members/mancredit.pl b/members/mancredit.pl index c691bc05a36..943230b15aa 100755 --- a/members/mancredit.pl +++ b/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; diff --git a/members/maninvoice.pl b/members/maninvoice.pl index 3cf02ca7c4b..ce1826ad411 100755 --- a/members/maninvoice.pl +++ b/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; diff --git a/members/member-flags.pl b/members/member-flags.pl index e34384044c2..900a176ad51 100755 --- a/members/member-flags.pl +++ b/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; diff --git a/members/member-password.pl b/members/member-password.pl index 879909a4918..d44f29d0f77 100755 --- a/members/member-password.pl +++ b/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; diff --git a/members/member.pl b/members/member.pl index 970015b22e7..4b4578cf479 100755 --- a/members/member.pl +++ b/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; diff --git a/members/memberentry.pl b/members/memberentry.pl index cb5bbf9a3f2..5844b9c3f90 100755 --- a/members/memberentry.pl +++ b/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; diff --git a/members/members-home.pl b/members/members-home.pl index 470f0b5d4e1..55b3f3e590f 100755 --- a/members/members-home.pl +++ b/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; diff --git a/members/members-update-do.pl b/members/members-update-do.pl index f89f0e2d44d..88d021a3943 100755 --- a/members/members-update-do.pl +++ b/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; diff --git a/members/members-update.pl b/members/members-update.pl index 6be1924945d..9965d495f1d 100755 --- a/members/members-update.pl +++ b/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; diff --git a/members/merge-patrons.pl b/members/merge-patrons.pl index ca03168b001..5318ff6ff5f 100755 --- a/members/merge-patrons.pl +++ b/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; diff --git a/members/mod_debarment.pl b/members/mod_debarment.pl index 1b7d4a4e914..977cb2fddd7 100755 --- a/members/mod_debarment.pl +++ b/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; diff --git a/members/moremember.pl b/members/moremember.pl index 8586dc99478..af3d3241115 100755 --- a/members/moremember.pl +++ b/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; diff --git a/members/notices.pl b/members/notices.pl index a43a39e80d4..c729d3fb1e6 100755 --- a/members/notices.pl +++ b/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; diff --git a/members/pay.pl b/members/pay.pl index fa7c74a319a..27181164ad1 100755 --- a/members/pay.pl +++ b/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; diff --git a/members/paycollect.pl b/members/paycollect.pl index c30d8969a25..d5cbd60bfce 100755 --- a/members/paycollect.pl +++ b/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(); diff --git a/members/print_overdues.pl b/members/print_overdues.pl index dda9017eec3..ead651b630f 100755 --- a/members/print_overdues.pl +++ b/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; diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl index 2e3dff7b51e..d366cc87806 100755 --- a/members/printfeercpt.pl +++ b/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; diff --git a/members/printinvoice.pl b/members/printinvoice.pl index 97b7f58f171..1f8480ee347 100755 --- a/members/printinvoice.pl +++ b/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; diff --git a/members/printslip.pl b/members/printslip.pl index 3fcaf218138..1bb11f68bee 100755 --- a/members/printslip.pl +++ b/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"); diff --git a/members/purchase-suggestions.pl b/members/purchase-suggestions.pl index ea42f3c4720..6a9725115ec 100755 --- a/members/purchase-suggestions.pl +++ b/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; diff --git a/members/readingrec.pl b/members/readingrec.pl index e87a6a05e01..b0e2a5b9a1a 100755 --- a/members/readingrec.pl +++ b/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; diff --git a/members/routing-lists.pl b/members/routing-lists.pl index dee5845a0dd..81ad7980ab0 100755 --- a/members/routing-lists.pl +++ b/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; diff --git a/members/setstatus.pl b/members/setstatus.pl index 66ae8b586c6..83ef1590be5 100755 --- a/members/setstatus.pl +++ b/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; diff --git a/members/statistics.pl b/members/statistics.pl index ee3f7874a24..e407eaf025b 100755 --- a/members/statistics.pl +++ b/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; diff --git a/members/summary-print.pl b/members/summary-print.pl index ab052ca2b32..6c6ed923ec3 100755 --- a/members/summary-print.pl +++ b/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; diff --git a/members/update-child.pl b/members/update-child.pl index d2f9c49e3ad..f6f3e0ce741 100755 --- a/members/update-child.pl +++ b/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; diff --git a/misc/add_date_fields_to_marc_records.pl b/misc/add_date_fields_to_marc_records.pl index b7ab77c2cb6..f619f521c44 100755 --- a/misc/add_date_fields_to_marc_records.pl +++ b/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; diff --git a/misc/admin/set_password.pl b/misc/admin/set_password.pl index 09151435038..2c91c969057 100755 --- a/misc/admin/set_password.pl +++ b/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; diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl index 5d409cdf1b7..79872898954 100755 --- a/misc/background_jobs_worker.pl +++ b/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; diff --git a/misc/batchCompareMARCvsFrameworks.pl b/misc/batchCompareMARCvsFrameworks.pl index af8a66796ef..ca5c8617aca 100755 --- a/misc/batchCompareMARCvsFrameworks.pl +++ b/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); diff --git a/misc/batchDeleteUnusedSubfields.pl b/misc/batchDeleteUnusedSubfields.pl index a80d4fdd6f4..1cfaf3c473d 100755 --- a/misc/batchDeleteUnusedSubfields.pl +++ b/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( diff --git a/misc/batchImportMARCWithBiblionumbers.pl b/misc/batchImportMARCWithBiblionumbers.pl index f8a12b5c5cf..b96e0122aa1 100755 --- a/misc/batchImportMARCWithBiblionumbers.pl +++ b/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 = ''; diff --git a/misc/batchRebuildBiblioTables.pl b/misc/batchRebuildBiblioTables.pl index edc7c16d336..ce4782f844e 100755 --- a/misc/batchRebuildBiblioTables.pl +++ b/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( diff --git a/misc/batchRebuildItemsTables.pl b/misc/batchRebuildItemsTables.pl index 58630cbded0..13f0c4117e4 100755 --- a/misc/batchRebuildItemsTables.pl +++ b/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 diff --git a/misc/batchRepairMissingBiblionumbers.pl b/misc/batchRepairMissingBiblionumbers.pl index 69e15a6c15f..32e9913fd6b 100755 --- a/misc/batchRepairMissingBiblionumbers.pl +++ b/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; diff --git a/misc/batchdeletebiblios.pl b/misc/batchdeletebiblios.pl index 3ae5cd96830..0abe2b41063 100755 --- a/misc/batchdeletebiblios.pl +++ b/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( diff --git a/misc/bin/connexion_import_daemon.pl b/misc/bin/connexion_import_daemon.pl index 9d430ffc967..722e2bfa13f 100755 --- a/misc/bin/connexion_import_daemon.pl +++ b/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; diff --git a/misc/check_sysprefs.pl b/misc/check_sysprefs.pl index 942d8f27c46..aed792c9adb 100755 --- a/misc/check_sysprefs.pl +++ b/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; diff --git a/misc/commit_file.pl b/misc/commit_file.pl index 639f7dfb42f..2a243439d0a 100755 --- a/misc/commit_file.pl +++ b/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; diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index f1df975c263..c1d6ac6672a 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/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; diff --git a/misc/cronjobs/archive_purchase_suggestions.pl b/misc/cronjobs/archive_purchase_suggestions.pl index bd16600d03c..a7c3e8879c3 100755 --- a/misc/cronjobs/archive_purchase_suggestions.pl +++ b/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( diff --git a/misc/cronjobs/automatic_checkin.pl b/misc/cronjobs/automatic_checkin.pl index 4eff2d5083f..2960b4a83dd 100755 --- a/misc/cronjobs/automatic_checkin.pl +++ b/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(); diff --git a/misc/cronjobs/automatic_item_modification_by_age.pl b/misc/cronjobs/automatic_item_modification_by_age.pl index e944ac8c11f..a4e5538430a 100755 --- a/misc/cronjobs/automatic_item_modification_by_age.pl +++ b/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 ); diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl index 7b4158b969e..cb45e68cbd4 100755 --- a/misc/cronjobs/automatic_renewals.pl +++ b/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; diff --git a/misc/cronjobs/batch_anonymise.pl b/misc/cronjobs/batch_anonymise.pl index ea63dfa01d0..6e05d36ce98 100755 --- a/misc/cronjobs/batch_anonymise.pl +++ b/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 ) = ( '', '' ); diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl index 18971114960..94a63016205 100755 --- a/misc/cronjobs/cleanup_database.pl +++ b/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; diff --git a/misc/cronjobs/cloud-kw.pl b/misc/cronjobs/cloud-kw.pl index 3dadf998a73..d6e64be9022 100755 --- a/misc/cronjobs/cloud-kw.pl +++ b/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 = {}; diff --git a/misc/cronjobs/create_koc_db.pl b/misc/cronjobs/create_koc_db.pl index 3d92fe5aa3b..a9704d7a15b 100755 --- a/misc/cronjobs/create_koc_db.pl +++ b/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; diff --git a/misc/cronjobs/delete_items.pl b/misc/cronjobs/delete_items.pl index df5d23aa661..93a00c6c1f7 100755 --- a/misc/cronjobs/delete_items.pl +++ b/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(); diff --git a/misc/cronjobs/delete_patrons.pl b/misc/cronjobs/delete_patrons.pl index d0847c8b621..37a15299755 100755 --- a/misc/cronjobs/delete_patrons.pl +++ b/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 ); diff --git a/misc/cronjobs/delete_records_via_leader.pl b/misc/cronjobs/delete_records_via_leader.pl index 0287e43f577..8456f42c046 100755 --- a/misc/cronjobs/delete_records_via_leader.pl +++ b/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; diff --git a/misc/cronjobs/edi_cron.pl b/misc/cronjobs/edi_cron.pl index ff6ef95bcc9..90f9fed6811 100755 --- a/misc/cronjobs/edi_cron.pl +++ b/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'); diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl index afc6b4d5566..3edf6ed736d 100755 --- a/misc/cronjobs/fines.pl +++ b/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; diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index 8c369e8c316..a777acbbcfd 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/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 ( diff --git a/misc/cronjobs/holds/auto_unsuspend_holds.pl b/misc/cronjobs/holds/auto_unsuspend_holds.pl index eb4fd874a7f..fdaa350159f 100755 --- a/misc/cronjobs/holds/auto_unsuspend_holds.pl +++ b/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(); diff --git a/misc/cronjobs/holds/build_holds_queue.pl b/misc/cronjobs/holds/build_holds_queue.pl index ab138f91833..6e1437dcd36 100755 --- a/misc/cronjobs/holds/build_holds_queue.pl +++ b/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(); diff --git a/misc/cronjobs/holds/cancel_expired_holds.pl b/misc/cronjobs/holds/cancel_expired_holds.pl index 4932bbf3469..0af02558e3f 100755 --- a/misc/cronjobs/holds/cancel_expired_holds.pl +++ b/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 diff --git a/misc/cronjobs/holds/cancel_unfilled_holds.pl b/misc/cronjobs/holds/cancel_unfilled_holds.pl index ba6a40098a0..10952695b5e 100755 --- a/misc/cronjobs/holds/cancel_unfilled_holds.pl +++ b/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(); diff --git a/misc/cronjobs/holds/holds_reminder.pl b/misc/cronjobs/holds/holds_reminder.pl index 356e3ba08f8..a255d8de6e7 100755 --- a/misc/cronjobs/holds/holds_reminder.pl +++ b/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; diff --git a/misc/cronjobs/import_webservice_batch.pl b/misc/cronjobs/import_webservice_batch.pl index aa18edce517..5925be2ea69 100755 --- a/misc/cronjobs/import_webservice_batch.pl +++ b/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); diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index c12a95d6f2d..dd12b6c1044 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/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; diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl index c140820ea5f..7a043f8e365 100755 --- a/misc/cronjobs/membership_expiry.pl +++ b/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; diff --git a/misc/cronjobs/merge_authorities.pl b/misc/cronjobs/merge_authorities.pl index 727d7d5f8c8..1645cfdda43 100755 --- a/misc/cronjobs/merge_authorities.pl +++ b/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; diff --git a/misc/cronjobs/notice_unprocessed_suggestions.pl b/misc/cronjobs/notice_unprocessed_suggestions.pl index d2870b23722..6567c35d752 100755 --- a/misc/cronjobs/notice_unprocessed_suggestions.pl +++ b/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; diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index c18997db356..a1c22116288 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/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; diff --git a/misc/cronjobs/patron_emailer.pl b/misc/cronjobs/patron_emailer.pl index 67a33dedfb0..a265b762a98 100755 --- a/misc/cronjobs/patron_emailer.pl +++ b/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(); diff --git a/misc/cronjobs/plugins_nightly.pl b/misc/cronjobs/plugins_nightly.pl index f748637e1ea..a90423e749e 100755 --- a/misc/cronjobs/plugins_nightly.pl +++ b/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; diff --git a/misc/cronjobs/process_message_queue.pl b/misc/cronjobs/process_message_queue.pl index a903f1e06d3..5ad1b2f79bd 100755 --- a/misc/cronjobs/process_message_queue.pl +++ b/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; diff --git a/misc/cronjobs/purge_suggestions.pl b/misc/cronjobs/purge_suggestions.pl index 9fdc26d566b..881ad7d4eae 100755 --- a/misc/cronjobs/purge_suggestions.pl +++ b/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 ); diff --git a/misc/cronjobs/reconcile_balances.pl b/misc/cronjobs/reconcile_balances.pl index 0202de94500..4c558360919 100755 --- a/misc/cronjobs/reconcile_balances.pl +++ b/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; diff --git a/misc/cronjobs/rss/rss.pl b/misc/cronjobs/rss/rss.pl index e703d07a799..d107411044f 100755 --- a/misc/cronjobs/rss/rss.pl +++ b/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]; diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl index 3e81e08a979..710de44f3d8 100755 --- a/misc/cronjobs/runreport.pl +++ b/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" }; } diff --git a/misc/cronjobs/serialsUpdate.pl b/misc/cronjobs/serialsUpdate.pl index 03843b9d2f3..53d60071b41 100755 --- a/misc/cronjobs/serialsUpdate.pl +++ b/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 diff --git a/misc/cronjobs/share_usage_with_koha_community.pl b/misc/cronjobs/share_usage_with_koha_community.pl index a427ca037b8..fa6d59850f4 100755 --- a/misc/cronjobs/share_usage_with_koha_community.pl +++ b/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( diff --git a/misc/cronjobs/sitemap.pl b/misc/cronjobs/sitemap.pl index fb738e08232..93abb02ed03 100755 --- a/misc/cronjobs/sitemap.pl +++ b/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; diff --git a/misc/cronjobs/staticfines.pl b/misc/cronjobs/staticfines.pl index 0966cb6134a..6d7cf733c48 100755 --- a/misc/cronjobs/staticfines.pl +++ b/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; diff --git a/misc/cronjobs/stockrotation.pl b/misc/cronjobs/stockrotation.pl index 3a30d582265..1298921f9b0 100755 --- a/misc/cronjobs/stockrotation.pl +++ b/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; diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl index f00d9d6a342..6be02264338 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl +++ b/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; diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl index 83b8a1a4421..fedc3cf888c 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ b/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; diff --git a/misc/cronjobs/update_patrons_category.pl b/misc/cronjobs/update_patrons_category.pl index fd4bc4a7ea0..542cc307c41 100755 --- a/misc/cronjobs/update_patrons_category.pl +++ b/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 diff --git a/misc/cronjobs/update_totalissues.pl b/misc/cronjobs/update_totalissues.pl index f1b621b3443..b3a6c2f503a 100755 --- a/misc/cronjobs/update_totalissues.pl +++ b/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 ); diff --git a/misc/cronjobs/writeoff_debts.pl b/misc/cronjobs/writeoff_debts.pl index ae2ee9c0de2..9b207a59e54 100755 --- a/misc/cronjobs/writeoff_debts.pl +++ b/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; diff --git a/misc/devel/add_missing_filters.pl b/misc/devel/add_missing_filters.pl index cc1b877e1e9..51e7c1da5a8 100755 --- a/misc/devel/add_missing_filters.pl +++ b/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; diff --git a/misc/devel/coverage.pl b/misc/devel/coverage.pl index 3dabae72bc9..a4d09344cc4 100755 --- a/misc/devel/coverage.pl +++ b/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; diff --git a/misc/devel/create_superlibrarian.pl b/misc/devel/create_superlibrarian.pl index 28c67b66d82..c0ab6fe6c6b 100755 --- a/misc/devel/create_superlibrarian.pl +++ b/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; diff --git a/misc/devel/get_prepared_letter.pl b/misc/devel/get_prepared_letter.pl index 45f5544d824..5ef852cb255 100755 --- a/misc/devel/get_prepared_letter.pl +++ b/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, diff --git a/misc/devel/install_plugins.pl b/misc/devel/install_plugins.pl index 0177d733b46..8e2cee9ad98 100755 --- a/misc/devel/install_plugins.pl +++ b/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; diff --git a/misc/devel/update_dbix_class_files.pl b/misc/devel/update_dbix_class_files.pl index 7e00b8f447b..747c000708b 100755 --- a/misc/devel/update_dbix_class_files.pl +++ b/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', diff --git a/misc/export_borrowers.pl b/misc/export_borrowers.pl index 27292189e9a..1a2dd7fab67 100755 --- a/misc/export_borrowers.pl +++ b/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; diff --git a/misc/export_records.pl b/misc/export_records.pl index 2a05e794dfd..32658cb8c8c 100755 --- a/misc/export_records.pl +++ b/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; diff --git a/misc/exportauth.pl b/misc/exportauth.pl index c036b17063a..d2ccebf6142 100755 --- a/misc/exportauth.pl +++ b/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 $!; diff --git a/misc/import_patrons.pl b/misc/import_patrons.pl index ee0d8a92c92..85f7983cab2 100755 --- a/misc/import_patrons.pl +++ b/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; diff --git a/misc/link_bibs_to_authorities.pl b/misc/link_bibs_to_authorities.pl index e7df4d57f67..21e4cc31bb2 100755 --- a/misc/link_bibs_to_authorities.pl +++ b/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 ); diff --git a/misc/load_testing/benchmark_circulation.pl b/misc/load_testing/benchmark_circulation.pl index 36ab41881fd..83ddea54618 100755 --- a/misc/load_testing/benchmark_circulation.pl +++ b/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; diff --git a/misc/load_testing/benchmark_staff.pl b/misc/load_testing/benchmark_staff.pl index b2596885d20..f42c4d5eafe 100755 --- a/misc/load_testing/benchmark_staff.pl +++ b/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); diff --git a/misc/load_testing/benchmark_webservices.pl b/misc/load_testing/benchmark_webservices.pl index e79067d0ea7..2ccd15bf731 100755 --- a/misc/load_testing/benchmark_webservices.pl +++ b/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; diff --git a/misc/load_yaml.pl b/misc/load_yaml.pl index 362a2512505..873e69ed2c6 100755 --- a/misc/load_yaml.pl +++ b/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; diff --git a/misc/maintenance/UNIMARC_fix_collectiontitle.pl b/misc/maintenance/UNIMARC_fix_collectiontitle.pl index 4a97c18e562..d28163a9b9d 100755 --- a/misc/maintenance/UNIMARC_fix_collectiontitle.pl +++ b/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 { diff --git a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl index 23ac37ec28f..1a4b8648225 100755 --- a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl +++ b/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; diff --git a/misc/maintenance/auth_show_hidden_data.pl b/misc/maintenance/auth_show_hidden_data.pl index 91006d17617..fdab6357686 100755 --- a/misc/maintenance/auth_show_hidden_data.pl +++ b/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; diff --git a/misc/maintenance/borrowers-force-messaging-defaults.pl b/misc/maintenance/borrowers-force-messaging-defaults.pl index 0e30596879c..9a0b1c0f085 100755 --- a/misc/maintenance/borrowers-force-messaging-defaults.pl +++ b/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 { diff --git a/misc/maintenance/check_syspref_cache.pl b/misc/maintenance/check_syspref_cache.pl index a25b977bda5..9328988baf1 100755 --- a/misc/maintenance/check_syspref_cache.pl +++ b/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; diff --git a/misc/maintenance/cmp_sysprefs.pl b/misc/maintenance/cmp_sysprefs.pl index 90b21a7c022..1a7afdf63a9 100755 --- a/misc/maintenance/cmp_sysprefs.pl +++ b/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; diff --git a/misc/maintenance/fix_accountlines_date.pl b/misc/maintenance/fix_accountlines_date.pl index 0c7a92e1788..fb9ceacf3da 100755 --- a/misc/maintenance/fix_accountlines_date.pl +++ b/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 diff --git a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl b/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl index 4a72e1a0f28..fd9d04751d6 100755 --- a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl +++ b/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 { diff --git a/misc/maintenance/fix_mysql_constraints.pl b/misc/maintenance/fix_mysql_constraints.pl index e2920e8fd40..b1784a01efb 100755 --- a/misc/maintenance/fix_mysql_constraints.pl +++ b/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; diff --git a/misc/maintenance/fix_tags_weight.pl b/misc/maintenance/fix_tags_weight.pl index a1f8085edd3..ff7e3d78350 100755 --- a/misc/maintenance/fix_tags_weight.pl +++ b/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 diff --git a/misc/maintenance/generate_MARC21Languages.pl b/misc/maintenance/generate_MARC21Languages.pl index be27b6e6354..8a70a4f4488 100755 --- a/misc/maintenance/generate_MARC21Languages.pl +++ b/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)'; diff --git a/misc/maintenance/process_record_through_filter.pl b/misc/maintenance/process_record_through_filter.pl index a9d92d33adb..8259e315660 100755 --- a/misc/maintenance/process_record_through_filter.pl +++ b/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] }); diff --git a/misc/maintenance/remove_items_from_biblioitems.pl b/misc/maintenance/remove_items_from_biblioitems.pl index d78ad696ad9..029e1e9ef06 100755 --- a/misc/maintenance/remove_items_from_biblioitems.pl +++ b/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( diff --git a/misc/maintenance/sanitize_records.pl b/misc/maintenance/sanitize_records.pl index f9084e8e3b3..2aa9f02a3f1 100755 --- a/misc/maintenance/sanitize_records.pl +++ b/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 ); diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl index 433f668040b..a23e7abdc70 100755 --- a/misc/maintenance/search_for_data_inconsistencies.pl +++ b/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 }}); diff --git a/misc/maintenance/touch_all_biblios.pl b/misc/maintenance/touch_all_biblios.pl index 8d65f21eedb..be349cfb193 100755 --- a/misc/maintenance/touch_all_biblios.pl +++ b/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 { diff --git a/misc/maintenance/touch_all_items.pl b/misc/maintenance/touch_all_items.pl index dbf16092217..087914498ed 100755 --- a/misc/maintenance/touch_all_items.pl +++ b/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 { diff --git a/misc/maintenance/update_authorities.pl b/misc/maintenance/update_authorities.pl index 6750ab1e4f8..e4bf74df067 100755 --- a/misc/maintenance/update_authorities.pl +++ b/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/; diff --git a/misc/migration_tools/22_to_30/convert_to_utf8.pl b/misc/migration_tools/22_to_30/convert_to_utf8.pl index fbbff89c604..d854b0c6d37 100755 --- a/misc/migration_tools/22_to_30/convert_to_utf8.pl +++ b/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" }; } diff --git a/misc/migration_tools/22_to_30/export_Authorities.pl b/misc/migration_tools/22_to_30/export_Authorities.pl index 479981c94ef..d4531a3ffcd 100755 --- a/misc/migration_tools/22_to_30/export_Authorities.pl +++ b/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| diff --git a/misc/migration_tools/22_to_30/export_Authorities_xml.pl b/misc/migration_tools/22_to_30/export_Authorities_xml.pl index 6c917088a7e..4145fc33b03 100755 --- a/misc/migration_tools/22_to_30/export_Authorities_xml.pl +++ b/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| diff --git a/misc/migration_tools/22_to_30/missing090field.pl b/misc/migration_tools/22_to_30/missing090field.pl index b54bf9285d1..80861b18653 100755 --- a/misc/migration_tools/22_to_30/missing090field.pl +++ b/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; diff --git a/misc/migration_tools/22_to_30/move_marc_to_authheader.pl b/misc/migration_tools/22_to_30/move_marc_to_authheader.pl index f5e4b43288e..8a5ffa9354c 100755 --- a/misc/migration_tools/22_to_30/move_marc_to_authheader.pl +++ b/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; diff --git a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl index 386831e8b9c..e4429a7d9e6 100755 --- a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl +++ b/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' ); diff --git a/misc/migration_tools/22_to_30/rebuild_leader.pl b/misc/migration_tools/22_to_30/rebuild_leader.pl index 2d402c5bb51..885ba459b21 100755 --- a/misc/migration_tools/22_to_30/rebuild_leader.pl +++ b/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; diff --git a/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl b/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl index 0988e5631d5..c9eddb5fc63 100755 --- a/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl +++ b/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; diff --git a/misc/migration_tools/buildCOUNTRY.pl b/misc/migration_tools/buildCOUNTRY.pl index af0bf216f21..9329ac0e595 100755 --- a/misc/migration_tools/buildCOUNTRY.pl +++ b/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( diff --git a/misc/migration_tools/buildEDITORS.pl b/misc/migration_tools/buildEDITORS.pl index bb11d458815..a6f1d8baa27 100755 --- a/misc/migration_tools/buildEDITORS.pl +++ b/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( diff --git a/misc/migration_tools/buildLANG.pl b/misc/migration_tools/buildLANG.pl index b1174ab8d3b..bdef6dd9d31 100755 --- a/misc/migration_tools/buildLANG.pl +++ b/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( diff --git a/misc/migration_tools/build_oai_sets.pl b/misc/migration_tools/build_oai_sets.pl index c7b73a2d7d1..00f92c8fe7d 100755 --- a/misc/migration_tools/build_oai_sets.pl +++ b/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; diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index 48e2e9d9970..b5ed5f0bed9 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/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; diff --git a/misc/migration_tools/checkNonIndexedBiblios.pl b/misc/migration_tools/checkNonIndexedBiblios.pl index d03acbfc7a4..25b58ea7e3c 100755 --- a/misc/migration_tools/checkNonIndexedBiblios.pl +++ b/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; diff --git a/misc/migration_tools/create_analytical_rel.pl b/misc/migration_tools/create_analytical_rel.pl index 2de9c23d457..dfdd10e26af 100755 --- a/misc/migration_tools/create_analytical_rel.pl +++ b/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; diff --git a/misc/migration_tools/ifla/update.pl b/misc/migration_tools/ifla/update.pl index a4e2d8d0faa..25e5ec097ac 100755 --- a/misc/migration_tools/ifla/update.pl +++ b/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; diff --git a/misc/migration_tools/import_lexile.pl b/misc/migration_tools/import_lexile.pl index 72347870a10..265b07a8eb2 100755 --- a/misc/migration_tools/import_lexile.pl +++ b/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" }; } diff --git a/misc/migration_tools/koha-svc.pl b/misc/migration_tools/koha-svc.pl index 24326c19c82..36e275d112b 100755 --- a/misc/migration_tools/koha-svc.pl +++ b/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; diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index 18da8026ada..dd7d94d9fb7 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/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; diff --git a/misc/migration_tools/remove_unused_authorities.pl b/misc/migration_tools/remove_unused_authorities.pl index 63670b6a0bf..da57f88f42c 100755 --- a/misc/migration_tools/remove_unused_authorities.pl +++ b/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; diff --git a/misc/migration_tools/switch_marc21_series_info.pl b/misc/migration_tools/switch_marc21_series_info.pl index 9d43d47cbde..f3962e56493 100755 --- a/misc/migration_tools/switch_marc21_series_info.pl +++ b/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; diff --git a/misc/migration_tools/upgradeitems.pl b/misc/migration_tools/upgradeitems.pl index cc63cd499fc..7ba79ae377d 100755 --- a/misc/migration_tools/upgradeitems.pl +++ b/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; diff --git a/misc/mod_zebraqueue.pl b/misc/mod_zebraqueue.pl index 240aad44fa5..ab1aa7b2b36 100755 --- a/misc/mod_zebraqueue.pl +++ b/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; diff --git a/misc/recreateIssueStatistics.pl b/misc/recreateIssueStatistics.pl index 8ff314e225d..859cf02a5e2 100755 --- a/misc/recreateIssueStatistics.pl +++ b/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; diff --git a/misc/sax_parser_test.pl b/misc/sax_parser_test.pl index fb56de1174f..e18cacdbb03 100755 --- a/misc/sax_parser_test.pl +++ b/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 diff --git a/misc/search_tools/export_elasticsearch_mappings.pl b/misc/search_tools/export_elasticsearch_mappings.pl index 6e2b158a79a..b8ad1de2069 100755 --- a/misc/search_tools/export_elasticsearch_mappings.pl +++ b/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; diff --git a/misc/search_tools/rebuild_elasticsearch.pl b/misc/search_tools/rebuild_elasticsearch.pl index 3b25709a76f..337ac19dd2d 100755 --- a/misc/search_tools/rebuild_elasticsearch.pl +++ b/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; diff --git a/misc/stage_file.pl b/misc/stage_file.pl index 16a74d0576f..f05be7a01d9 100755 --- a/misc/stage_file.pl +++ b/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; diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index 9636758ad8a..772c876fb32 100644 --- a/misc/translator/LangInstaller.pm +++ b/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; diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm index 0598bc209df..05cc54ea6b6 100644 --- a/misc/translator/TmplTokenizer.pm +++ b/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 ); diff --git a/misc/translator/VerboseWarnings.pm b/misc/translator/VerboseWarnings.pm index 65281ffcb17..5225f74cc94 100644 --- a/misc/translator/VerboseWarnings.pm +++ b/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 + ); +} ############################################################################### diff --git a/misc/translator/tmpl_process3.pl b/misc/translator/tmpl_process3.pl index 3c046189150..2a9643d2820 100755 --- a/misc/translator/tmpl_process3.pl +++ b/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 ); diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index e04c5298634..fcfe1bdd764 100755 --- a/misc/translator/xgettext.pl +++ b/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; diff --git a/misc/z3950_responder.pl b/misc/z3950_responder.pl index 48609ddce84..de61cd19e61 100755 --- a/misc/z3950_responder.pl +++ b/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; diff --git a/offline_circ/download.pl b/offline_circ/download.pl index 838e63ee08d..87388bf46fa 100755 --- a/offline_circ/download.pl +++ b/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; diff --git a/offline_circ/enqueue_koc.pl b/offline_circ/enqueue_koc.pl index a6e3b0871d4..1162d706454 100755 --- a/offline_circ/enqueue_koc.pl +++ b/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'; diff --git a/offline_circ/list.pl b/offline_circ/list.pl index f5146444c4a..252dc8594b8 100755 --- a/offline_circ/list.pl +++ b/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; diff --git a/offline_circ/process.pl b/offline_circ/process.pl index 39963e67eeb..09520a1caee 100755 --- a/offline_circ/process.pl +++ b/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; diff --git a/offline_circ/process_koc.pl b/offline_circ/process_koc.pl index ba61c775344..7eaa73b905b 100755 --- a/offline_circ/process_koc.pl +++ b/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; diff --git a/offline_circ/service.pl b/offline_circ/service.pl index bbae44bb74e..00ae314c0fd 100755 --- a/offline_circ/service.pl +++ b/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; diff --git a/opac/clubs/clubs-tab.pl b/opac/clubs/clubs-tab.pl index 312f9b10f40..a3243d4d52a 100755 --- a/opac/clubs/clubs-tab.pl +++ b/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; diff --git a/opac/clubs/enroll.pl b/opac/clubs/enroll.pl index f486c7dfd28..a71990196fd 100755 --- a/opac/clubs/enroll.pl +++ b/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; diff --git a/opac/errors/400.pl b/opac/errors/400.pl index 83954c70529..eb6609a8ae8 100755 --- a/opac/errors/400.pl +++ b/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'); diff --git a/opac/errors/401.pl b/opac/errors/401.pl index 4d3b5f81bbc..91fbc2dccc7 100755 --- a/opac/errors/401.pl +++ b/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'); diff --git a/opac/errors/402.pl b/opac/errors/402.pl index 50989b42535..682f39c7a5f 100755 --- a/opac/errors/402.pl +++ b/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'); diff --git a/opac/errors/403.pl b/opac/errors/403.pl index 735c1c9d08e..0e38cdf8365 100755 --- a/opac/errors/403.pl +++ b/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'); diff --git a/opac/errors/404.pl b/opac/errors/404.pl index ca5524d6e24..1814e9da908 100755 --- a/opac/errors/404.pl +++ b/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'); diff --git a/opac/errors/500.pl b/opac/errors/500.pl index 2d6c30d76f6..6918c1e62a9 100755 --- a/opac/errors/500.pl +++ b/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'); diff --git a/opac/external/overdrive/auth.pl b/opac/external/overdrive/auth.pl index f534c24885c..d70f5746816 100755 --- a/opac/external/overdrive/auth.pl +++ b/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; diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl index 86cd92f4320..8613ac12675 100755 --- a/opac/ilsdi.pl +++ b/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; diff --git a/opac/maintenance.pl b/opac/maintenance.pl index 7ec3ec80932..c7924921c3d 100755 --- a/opac/maintenance.pl +++ b/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; diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 9f3bb869e24..567caf4118b 100755 --- a/opac/opac-ISBDdetail.pl +++ b/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; diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 0dac97d4b48..69578be6aa4 100755 --- a/opac/opac-MARCdetail.pl +++ b/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(); diff --git a/opac/opac-account-pay-return.pl b/opac/opac-account-pay-return.pl index 841f84fbde9..bdfbcfcb1a6 100755 --- a/opac/opac-account-pay-return.pl +++ b/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; diff --git a/opac/opac-account-pay.pl b/opac/opac-account-pay.pl index c12eae0220e..30be841dfcb 100755 --- a/opac/opac-account-pay.pl +++ b/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; diff --git a/opac/opac-account.pl b/opac/opac-account.pl index c675c2fc920..1de5617fd61 100755 --- a/opac/opac-account.pl +++ b/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; diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl index 3563dfc300d..176a1c4fd2d 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/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; diff --git a/opac/opac-alert-subscribe.pl b/opac/opac-alert-subscribe.pl index e9fb79697eb..c35b341e375 100755 --- a/opac/opac-alert-subscribe.pl +++ b/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; diff --git a/opac/opac-article-request-cancel.pl b/opac/opac-article-request-cancel.pl index 1372b4e8188..e926a5f5066 100755 --- a/opac/opac-article-request-cancel.pl +++ b/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; diff --git a/opac/opac-authorities-home.pl b/opac/opac-authorities-home.pl index 030820772a2..eb795f4ed3c 100755 --- a/opac/opac-authorities-home.pl +++ b/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; diff --git a/opac/opac-authoritiesdetail.pl b/opac/opac-authoritiesdetail.pl index 432e2982d49..1accfa9c7fa 100755 --- a/opac/opac-authoritiesdetail.pl +++ b/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; diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 2de55f4be64..ef4a25700f3 100755 --- a/opac/opac-basket.pl +++ b/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; diff --git a/opac/opac-blocked.pl b/opac/opac-blocked.pl index 2876823c46e..6fc1a04aa11 100755 --- a/opac/opac-blocked.pl +++ b/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; diff --git a/opac/opac-browse.pl b/opac/opac-browse.pl index 84df8c83ed7..bde1e716aad 100755 --- a/opac/opac-browse.pl +++ b/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; diff --git a/opac/opac-browser.pl b/opac/opac-browser.pl index 3524d039f98..aad5940f5c9 100755 --- a/opac/opac-browser.pl +++ b/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; diff --git a/opac/opac-course-details.pl b/opac/opac-course-details.pl index 40c9d43bcd0..415cade52f9 100755 --- a/opac/opac-course-details.pl +++ b/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; diff --git a/opac/opac-course-reserves.pl b/opac/opac-course-reserves.pl index 7e8e759134d..e5d474b5ee1 100755 --- a/opac/opac-course-reserves.pl +++ b/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; diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 249de81618e..cbb216e291c 100755 --- a/opac/opac-detail.pl +++ b/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 (&) diff --git a/opac/opac-discharge.pl b/opac/opac-discharge.pl index 95a4ac3e9fe..991ebae5e07 100755 --- a/opac/opac-discharge.pl +++ b/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; diff --git a/opac/opac-downloadcart.pl b/opac/opac-downloadcart.pl index 0fb7a02f3c2..ade1a53770a 100755 --- a/opac/opac-downloadcart.pl +++ b/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; diff --git a/opac/opac-downloadshelf.pl b/opac/opac-downloadshelf.pl index 99d14a73dae..31da711328d 100755 --- a/opac/opac-downloadshelf.pl +++ b/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; diff --git a/opac/opac-export.pl b/opac/opac-export.pl index 82954d660f5..d816ded995d 100755 --- a/opac/opac-export.pl +++ b/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; diff --git a/opac/opac-holdshistory.pl b/opac/opac-holdshistory.pl index 67ecae864ed..e869128a378 100755 --- a/opac/opac-holdshistory.pl +++ b/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; diff --git a/opac/opac-ics.pl b/opac/opac-ics.pl index c8116b4efc6..62603f3a2f4 100755 --- a/opac/opac-ics.pl +++ b/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( diff --git a/opac/opac-idref.pl b/opac/opac-idref.pl index 8b95311f7ee..795842215f9 100755 --- a/opac/opac-idref.pl +++ b/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( diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl index 5881dedcc5c..e619707451e 100755 --- a/opac/opac-illrequests.pl +++ b/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; diff --git a/opac/opac-imageviewer.pl b/opac/opac-imageviewer.pl index 6daa63d8e0f..bacbf848a7c 100755 --- a/opac/opac-imageviewer.pl +++ b/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; diff --git a/opac/opac-issue-note.pl b/opac/opac-issue-note.pl index 5153b15358c..d109ccc79a7 100755 --- a/opac/opac-issue-note.pl +++ b/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; diff --git a/opac/opac-library.pl b/opac/opac-library.pl index 52168615f35..951d0b43ab9 100755 --- a/opac/opac-library.pl +++ b/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(); diff --git a/opac/opac-main.pl b/opac/opac-main.pl index d030fd07514..5b98333b85a 100755 --- a/opac/opac-main.pl +++ b/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; diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index c9a4790efd3..8945cc339ba 100755 --- a/opac/opac-memberentry.pl +++ b/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; diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 1748c313613..40643830c65 100755 --- a/opac/opac-messaging.pl +++ b/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; diff --git a/opac/opac-modrequest-suspend.pl b/opac/opac-modrequest-suspend.pl index ec9b9a8291e..4022bb92df6 100755 --- a/opac/opac-modrequest-suspend.pl +++ b/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( { diff --git a/opac/opac-modrequest.pl b/opac/opac-modrequest.pl index 64b064c92bd..05b01a836ae 100755 --- a/opac/opac-modrequest.pl +++ b/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; diff --git a/opac/opac-mymessages.pl b/opac/opac-mymessages.pl index 5de888a4f06..6acebadc4da 100755 --- a/opac/opac-mymessages.pl +++ b/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(); diff --git a/opac/opac-news-rss.pl b/opac/opac-news-rss.pl index 58ec362f2f9..a969424fff2 100755 --- a/opac/opac-news-rss.pl +++ b/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; diff --git a/opac/opac-overdrive-search.pl b/opac/opac-overdrive-search.pl index 9b7618942cf..575596d8a05 100755 --- a/opac/opac-overdrive-search.pl +++ b/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; diff --git a/opac/opac-passwd.pl b/opac/opac-passwd.pl index 6b9081a965e..6ae82f0a8ea 100755 --- a/opac/opac-passwd.pl +++ b/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; diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl index b6c5592e7ef..9ee1278c0ab 100755 --- a/opac/opac-password-recovery.pl +++ b/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( { diff --git a/opac/opac-patron-consent.pl b/opac/opac-patron-consent.pl index 2de16abbe5b..017e04e9be2 100755 --- a/opac/opac-patron-consent.pl +++ b/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; diff --git a/opac/opac-patron-image.pl b/opac/opac-patron-image.pl index b40788db7ed..3f1efb8a47b 100755 --- a/opac/opac-patron-image.pl +++ b/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; diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl index fa3083c2af5..8ea6b120668 100755 --- a/opac/opac-privacy.pl +++ b/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; diff --git a/opac/opac-ratings-ajax.pl b/opac/opac-ratings-ajax.pl index 43293576e52..2f43762c05a 100755 --- a/opac/opac-ratings-ajax.pl +++ b/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; diff --git a/opac/opac-ratings.pl b/opac/opac-ratings.pl index 53a9b4d67e1..7e1bca61cb3 100755 --- a/opac/opac-ratings.pl +++ b/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; diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl index 9c6200f9f03..3652d000c70 100755 --- a/opac/opac-readingrecord.pl +++ b/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; diff --git a/opac/opac-recordedbooks-search.pl b/opac/opac-recordedbooks-search.pl index c23ef028c00..1d2f4964eee 100755 --- a/opac/opac-recordedbooks-search.pl +++ b/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; diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl index 71ea3292518..c4e4f229632 100755 --- a/opac/opac-registration-verify.pl +++ b/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; diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl index 8a946d0f179..46a205029e8 100755 --- a/opac/opac-renew.pl +++ b/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( diff --git a/opac/opac-reportproblem.pl b/opac/opac-reportproblem.pl index 293f2826c08..2cb1ff340b0 100755 --- a/opac/opac-reportproblem.pl +++ b/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; diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl index 2303ea0c255..dd02b4d7b98 100755 --- a/opac/opac-request-article.pl +++ b/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; diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index b70cff854ab..721981bb2a0 100755 --- a/opac/opac-reserve.pl +++ b/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"); diff --git a/opac/opac-restrictedpage.pl b/opac/opac-restrictedpage.pl index ca90b41ebc9..b438b7f010f 100755 --- a/opac/opac-restrictedpage.pl +++ b/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'}; diff --git a/opac/opac-retrieve-file.pl b/opac/opac-retrieve-file.pl index d19f9dd7380..3f6e6c8d3be 100755 --- a/opac/opac-retrieve-file.pl +++ b/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; diff --git a/opac/opac-review.pl b/opac/opac-review.pl index f00b79f2749..12152d228e0 100755 --- a/opac/opac-review.pl +++ b/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; diff --git a/opac/opac-routing-lists.pl b/opac/opac-routing-lists.pl index 2be52197e04..299bb29e780 100755 --- a/opac/opac-routing-lists.pl +++ b/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; diff --git a/opac/opac-search-history.pl b/opac/opac-search-history.pl index 64c696dde77..019fdc6b691 100755 --- a/opac/opac-search-history.pl +++ b/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; diff --git a/opac/opac-search.pl b/opac/opac-search.pl index cde8b6e555c..67c11c182f3 100755 --- a/opac/opac-search.pl +++ b/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 ); diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index eee5e2c29be..fdf8671ecb5 100755 --- a/opac/opac-sendbasket.pl +++ b/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; diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index c97aa450dc9..825de8175ed 100755 --- a/opac/opac-sendshelf.pl +++ b/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; diff --git a/opac/opac-serial-issues.pl b/opac/opac-serial-issues.pl index c842880345d..b84b1764984 100755 --- a/opac/opac-serial-issues.pl +++ b/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; diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl index 7eecf6c45f3..701871bafcd 100755 --- a/opac/opac-shareshelf.pl +++ b/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; diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 8fa4fb72745..b9eee82d7f3 100755 --- a/opac/opac-shelves.pl +++ b/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; diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl index 5ba6a234043..57c63fede10 100755 --- a/opac/opac-showmarc.pl +++ b/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; diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl index cfb359c6b78..e6aab17d603 100755 --- a/opac/opac-showreviews.pl +++ b/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; diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index b1f1701ddc5..1fb5ffb1369 100755 --- a/opac/opac-suggestions.pl +++ b/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'; diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index 200e8dfc474..df323ce003c 100755 --- a/opac/opac-tags.pl +++ b/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; diff --git a/opac/opac-tags_subject.pl b/opac/opac-tags_subject.pl index 25afac4b861..8af9c29ad4d 100755 --- a/opac/opac-tags_subject.pl +++ b/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; diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index d2d76da8f6d..f185702e323 100755 --- a/opac/opac-topissues.pl +++ b/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 diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 0d9bdd708c6..8deb054e721 100755 --- a/opac/opac-user.pl +++ b/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; diff --git a/opac/sci/sci-main.pl b/opac/sci/sci-main.pl index 88a3cf8ce1d..2171fa42c51 100755 --- a/opac/sci/sci-main.pl +++ b/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; diff --git a/opac/sco/help.pl b/opac/sco/help.pl index 25e43562838..57d02ec9835 100755 --- a/opac/sco/help.pl +++ b/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')) ) { diff --git a/opac/sco/printslip.pl b/opac/sco/printslip.pl index 3b7074194e6..a2564f1307f 100755 --- a/opac/sco/printslip.pl +++ b/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')) ) { diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index d4f91638cee..40d591519b1 100755 --- a/opac/sco/sco-main.pl +++ b/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; diff --git a/opac/sco/sco-patron-image.pl b/opac/sco/sco-patron-image.pl index e997ab984bf..36e86b7d137 100755 --- a/opac/sco/sco-patron-image.pl +++ b/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; diff --git a/opac/svc/checkout_notes b/opac/svc/checkout_notes index 8913ab70d77..fea4a9e67ae 100755 --- a/opac/svc/checkout_notes +++ b/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; diff --git a/opac/svc/shelfbrowser.pl b/opac/svc/shelfbrowser.pl index 82e583ca81e..d9797c2e4ee 100755 --- a/opac/svc/shelfbrowser.pl +++ b/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; diff --git a/opac/tracklinks.pl b/opac/tracklinks.pl index e357f0a1dfc..5849d3a0c91 100755 --- a/opac/tracklinks.pl +++ b/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') || ''; diff --git a/patron_lists/add-modify.pl b/patron_lists/add-modify.pl index c10c2084478..95ff7287073 100755 --- a/patron_lists/add-modify.pl +++ b/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; diff --git a/patron_lists/delete.pl b/patron_lists/delete.pl index 87c199b4268..773ec3d1686 100755 --- a/patron_lists/delete.pl +++ b/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; diff --git a/patron_lists/list.pl b/patron_lists/list.pl index 75f30e29890..7076b20c9f3 100755 --- a/patron_lists/list.pl +++ b/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; diff --git a/patron_lists/lists.pl b/patron_lists/lists.pl index df84727426b..f599cd164b9 100755 --- a/patron_lists/lists.pl +++ b/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; diff --git a/patron_lists/patrons.pl b/patron_lists/patrons.pl index 98ac9593c28..f97fcf46622 100755 --- a/patron_lists/patrons.pl +++ b/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; diff --git a/patroncards/add_user_search.pl b/patroncards/add_user_search.pl index 8eb2a731e9b..04bc0eb5b39 100755 --- a/patroncards/add_user_search.pl +++ b/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; diff --git a/patroncards/create-pdf.pl b/patroncards/create-pdf.pl index 6ea391fe3e8..e994ddbbb25 100755 --- a/patroncards/create-pdf.pl +++ b/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; diff --git a/patroncards/edit-batch.pl b/patroncards/edit-batch.pl index 7cab1a7cd30..d90d37cf266 100755 --- a/patroncards/edit-batch.pl +++ b/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; diff --git a/patroncards/edit-layout.pl b/patroncards/edit-layout.pl index 6ecbde47bb8..22ef6b93718 100755 --- a/patroncards/edit-layout.pl +++ b/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; diff --git a/patroncards/edit-profile.pl b/patroncards/edit-profile.pl index c192702459a..e5517dad979 100755 --- a/patroncards/edit-profile.pl +++ b/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; diff --git a/patroncards/edit-template.pl b/patroncards/edit-template.pl index fab470a13ef..02387011628 100755 --- a/patroncards/edit-template.pl +++ b/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; diff --git a/patroncards/home.pl b/patroncards/home.pl index 6e69187add5..93df48f3d36 100755 --- a/patroncards/home.pl +++ b/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( diff --git a/patroncards/image-manage.pl b/patroncards/image-manage.pl index 587d4ee8a2e..3f3c288136c 100755 --- a/patroncards/image-manage.pl +++ b/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; diff --git a/patroncards/manage.pl b/patroncards/manage.pl index a2e9546428b..f4d21c644d7 100755 --- a/patroncards/manage.pl +++ b/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( diff --git a/patroncards/print.pl b/patroncards/print.pl index ec7024aa573..ea154ea8e45 100755 --- a/patroncards/print.pl +++ b/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( diff --git a/plugins/plugins-enable.pl b/plugins/plugins-enable.pl index 181550781aa..6966be9d23c 100755 --- a/plugins/plugins-enable.pl +++ b/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"); diff --git a/plugins/plugins-home.pl b/plugins/plugins-home.pl index efdd503eacb..da892ba1f2b 100755 --- a/plugins/plugins-home.pl +++ b/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"); diff --git a/plugins/plugins-uninstall.pl b/plugins/plugins-uninstall.pl index 7d350fe82d7..d6a85d39d32 100755 --- a/plugins/plugins-uninstall.pl +++ b/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; diff --git a/plugins/plugins-upload.pl b/plugins/plugins-upload.pl index a681aabfd18..3e44f00b7e1 100755 --- a/plugins/plugins-upload.pl +++ b/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; diff --git a/plugins/run.pl b/plugins/run.pl index a0bd16ae4b9..4570844291a 100755 --- a/plugins/run.pl +++ b/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"); diff --git a/pos/pay.pl b/pos/pay.pl index c83405321e2..b401f124958 100755 --- a/pos/pay.pl +++ b/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; diff --git a/pos/printreceipt.pl b/pos/printreceipt.pl index a387b8ea4c6..02505595c45 100755 --- a/pos/printreceipt.pl +++ b/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; diff --git a/pos/register.pl b/pos/register.pl index e398bda396f..490fe111271 100755 --- a/pos/register.pl +++ b/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(); diff --git a/pos/registers.pl b/pos/registers.pl index 44c81363fb9..7a9c3a16996 100755 --- a/pos/registers.pl +++ b/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; diff --git a/reports/acquisitions_stats.pl b/reports/acquisitions_stats.pl index 8fe531358e1..1d27870c525 100755 --- a/reports/acquisitions_stats.pl +++ b/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 diff --git a/reports/bor_issues_top.pl b/reports/bor_issues_top.pl index 6737c039700..912798ea7b4 100755 --- a/reports/bor_issues_top.pl +++ b/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; diff --git a/reports/borrowers_out.pl b/reports/borrowers_out.pl index 22f71c99243..9d7fba6cac6 100755 --- a/reports/borrowers_out.pl +++ b/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 diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl index dc8b7b4b71c..f636f6b5664 100755 --- a/reports/borrowers_stats.pl +++ b/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 diff --git a/reports/cash_register_stats.pl b/reports/cash_register_stats.pl index 3b790ff8ca4..0dcc38f08c7 100755 --- a/reports/cash_register_stats.pl +++ b/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; diff --git a/reports/cat_issues_top.pl b/reports/cat_issues_top.pl index 040280dbee7..886fecfa6f3 100755 --- a/reports/cat_issues_top.pl +++ b/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 diff --git a/reports/catalogue_out.pl b/reports/catalogue_out.pl index 3835f134844..51961790a86 100755 --- a/reports/catalogue_out.pl +++ b/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 diff --git a/reports/catalogue_stats.pl b/reports/catalogue_stats.pl index b7b01e23d88..c3795df6d28 100755 --- a/reports/catalogue_stats.pl +++ b/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 diff --git a/reports/dictionary.pl b/reports/dictionary.pl index 26976c02155..ef95e7108d8 100755 --- a/reports/dictionary.pl +++ b/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 diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 854098ead1b..77c19b3cb46 100755 --- a/reports/guided_reports.pl +++ b/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 diff --git a/reports/issues_avg_stats.pl b/reports/issues_avg_stats.pl index d5bbf2da744..7be36a54c2d 100755 --- a/reports/issues_avg_stats.pl +++ b/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 diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index cb5cda0d0b3..3eb27fb3e27 100755 --- a/reports/issues_stats.pl +++ b/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; diff --git a/reports/itemslost.pl b/reports/itemslost.pl index 9c77e6e1724..901ff5a8d98 100755 --- a/reports/itemslost.pl +++ b/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( diff --git a/reports/manager.pl b/reports/manager.pl index 0d6e1bca88c..ff174f00d33 100755 --- a/reports/manager.pl +++ b/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; diff --git a/reports/orders_by_fund.pl b/reports/orders_by_fund.pl index 92bbb5f1873..a44ca3f864f 100755 --- a/reports/orders_by_fund.pl +++ b/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( diff --git a/reports/reports-home.pl b/reports/reports-home.pl index bffe6b6a19e..71aaa87e835 100755 --- a/reports/reports-home.pl +++ b/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; diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl index 3c91778ca8e..cb63a6ef87d 100755 --- a/reports/reserves_stats.pl +++ b/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 diff --git a/reports/serials_stats.pl b/reports/serials_stats.pl index 277b7671f4b..a3b12b55b38 100755 --- a/reports/serials_stats.pl +++ b/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 diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl index f1ab945f2e9..3a7c3deb6b3 100755 --- a/reserve/modrequest.pl +++ b/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; diff --git a/reserve/modrequest_suspendall.pl b/reserve/modrequest_suspendall.pl index e0098e08dbe..3217dbffb47 100755 --- a/reserve/modrequest_suspendall.pl +++ b/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( diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl index 63555944a59..5ee8dce2f6b 100755 --- a/reserve/placerequest.pl +++ b/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; diff --git a/reserve/request.pl b/reserve/request.pl index bf13c3dfb2b..a4563f34bb1 100755 --- a/reserve/request.pl +++ b/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; diff --git a/reviews/reviewswaiting.pl b/reviews/reviewswaiting.pl index 99a0d3f5876..6d50443618a 100755 --- a/reviews/reviewswaiting.pl +++ b/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; diff --git a/rotating_collections/addItems.pl b/rotating_collections/addItems.pl index f77c4ed81f5..6cde9aebcee 100755 --- a/rotating_collections/addItems.pl +++ b/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; diff --git a/rotating_collections/editCollections.pl b/rotating_collections/editCollections.pl index 6955291b61c..28a23e58675 100755 --- a/rotating_collections/editCollections.pl +++ b/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; diff --git a/rotating_collections/rotatingCollections.pl b/rotating_collections/rotatingCollections.pl index 5a22bf43e0d..b350861d1e3 100755 --- a/rotating_collections/rotatingCollections.pl +++ b/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; diff --git a/rotating_collections/transferCollection.pl b/rotating_collections/transferCollection.pl index 4380c1e8ab7..1d5dcf8d581 100755 --- a/rotating_collections/transferCollection.pl +++ b/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; diff --git a/serials/acqui-search-result.pl b/serials/acqui-search-result.pl index 95a838c2e48..1a820756d85 100755 --- a/serials/acqui-search-result.pl +++ b/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; diff --git a/serials/acqui-search.pl b/serials/acqui-search.pl index 2b1041cad59..682b5bbe7d7 100755 --- a/serials/acqui-search.pl +++ b/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; diff --git a/serials/add_user_search.pl b/serials/add_user_search.pl index b42b5faf389..1240670dde6 100755 --- a/serials/add_user_search.pl +++ b/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; diff --git a/serials/checkexpiration.pl b/serials/checkexpiration.pl index 97dbec19460..6ce76af2676 100755 --- a/serials/checkexpiration.pl +++ b/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; diff --git a/serials/claims.pl b/serials/claims.pl index 4a8a6b70b2a..f988a6cc4ff 100755 --- a/serials/claims.pl +++ b/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; diff --git a/serials/create-numberpattern.pl b/serials/create-numberpattern.pl index 506a539d39c..de6f04d997d 100755 --- a/serials/create-numberpattern.pl +++ b/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; diff --git a/serials/lateissues-export.pl b/serials/lateissues-export.pl index 7af3395d1b2..f20cdbe02c3 100755 --- a/serials/lateissues-export.pl +++ b/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; diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index 093bfb22302..b33cb8dbcdf 100755 --- a/serials/routing-preview.pl +++ b/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; diff --git a/serials/routing.pl b/serials/routing.pl index 6a237f6f6ea..2e3122d3b5b 100755 --- a/serials/routing.pl +++ b/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; diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl index f725d7f4261..963eeeb577e 100755 --- a/serials/serials-collection.pl +++ b/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; diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index ea9bee8fa52..76a6bf0b250 100755 --- a/serials/serials-edit.pl +++ b/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; diff --git a/serials/serials-home.pl b/serials/serials-home.pl index 6f2c40c0825..a0e4bc0185f 100755 --- a/serials/serials-home.pl +++ b/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; diff --git a/serials/serials-search.pl b/serials/serials-search.pl index 5b6608a5cd2..56a16e6543e 100755 --- a/serials/serials-search.pl +++ b/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; diff --git a/serials/showpredictionpattern.pl b/serials/showpredictionpattern.pl index d6bcfc79187..6420e50ce1a 100755 --- a/serials/showpredictionpattern.pl +++ b/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( { diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index 96891487bc1..b61012ee02f 100755 --- a/serials/subscription-add.pl +++ b/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; diff --git a/serials/subscription-batchedit.pl b/serials/subscription-batchedit.pl index b06f68d6c35..4e069b9ab66 100755 --- a/serials/subscription-batchedit.pl +++ b/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; diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl index 88788590bc8..d38147d8c13 100755 --- a/serials/subscription-bib-search.pl +++ b/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; diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index 118b3a13544..6e8204810fb 100755 --- a/serials/subscription-detail.pl +++ b/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; diff --git a/serials/subscription-frequencies.pl b/serials/subscription-frequencies.pl index 30af9f5ee20..86d14fccd22 100755 --- a/serials/subscription-frequencies.pl +++ b/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; diff --git a/serials/subscription-frequency.pl b/serials/subscription-frequency.pl index 2532f8f186b..4d46a83d794 100755 --- a/serials/subscription-frequency.pl +++ b/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; diff --git a/serials/subscription-history.pl b/serials/subscription-history.pl index 75474ed9632..acaf307016a 100755 --- a/serials/subscription-history.pl +++ b/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( { diff --git a/serials/subscription-numberpattern.pl b/serials/subscription-numberpattern.pl index db178607213..cc6b2926f7f 100755 --- a/serials/subscription-numberpattern.pl +++ b/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; diff --git a/serials/subscription-numberpatterns.pl b/serials/subscription-numberpatterns.pl index a84c304ac88..19b917bb05e 100755 --- a/serials/subscription-numberpatterns.pl +++ b/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( { diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl index a30b24940bb..5da15363c19 100755 --- a/serials/subscription-renew.pl +++ b/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; diff --git a/serials/viewalerts.pl b/serials/viewalerts.pl index 106b8679dae..bb356c6331c 100755 --- a/serials/viewalerts.pl +++ b/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; diff --git a/services/itemrecorddisplay.pl b/services/itemrecorddisplay.pl index 79ee88eb04e..f22faca8465 100755 --- a/services/itemrecorddisplay.pl +++ b/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( { diff --git a/suggestion/add_user_search.pl b/suggestion/add_user_search.pl index f6758aa2cf0..d4b5ff02434 100755 --- a/suggestion/add_user_search.pl +++ b/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; diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 370bac1e0c1..27a263cd2c0 100755 --- a/suggestion/suggestion.pl +++ b/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 @_; diff --git a/svc/authorised_values b/svc/authorised_values index 692b82d6d71..ae082d32e73 100755 --- a/svc/authorised_values +++ b/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 diff --git a/svc/cataloguing/automatic_linker.pl b/svc/cataloguing/automatic_linker.pl index a04ccfb8c97..a1d6b13b8b5 100755 --- a/svc/cataloguing/automatic_linker.pl +++ b/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; diff --git a/svc/checkout_notes b/svc/checkout_notes index 3abd3a8c573..5d13527bfc2 100755 --- a/svc/checkout_notes +++ b/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 diff --git a/svc/creator_batches b/svc/creator_batches index 743cf11ffd0..51e13dcdcec 100755 --- a/svc/creator_batches +++ b/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; diff --git a/svc/problem_reports b/svc/problem_reports index 9df283efb50..eafa206c551 100755 --- a/svc/problem_reports +++ b/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 diff --git a/t/Acquisition/CanUserManageBasket.t b/t/Acquisition/CanUserManageBasket.t index a862983f702..462189ecde4 100755 --- a/t/Acquisition/CanUserManageBasket.t +++ b/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/ }; diff --git a/t/Auth.t b/t/Auth.t index a02f45b0088..d5b2f1e7faa 100755 --- a/t/Auth.t +++ b/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'; diff --git a/t/Auth_with_shibboleth.t b/t/Auth_with_shibboleth.t index 17cbdc8856f..5ea1f0d5d25 100755 --- a/t/Auth_with_shibboleth.t +++ b/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 diff --git a/t/AuthoritiesMarc_MARC21.t b/t/AuthoritiesMarc_MARC21.t index fbf713ac66d..5c5c8371240 100755 --- a/t/AuthoritiesMarc_MARC21.t +++ b/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(); diff --git a/t/AuthoritiesMarc_UNIMARC.t b/t/AuthoritiesMarc_UNIMARC.t index 4d26f3948ba..84febb8bbfb 100755 --- a/t/AuthoritiesMarc_UNIMARC.t +++ b/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(); diff --git a/t/Biblio.t b/t/Biblio.t index f6259e905fd..91080bdf969 100755 --- a/t/Biblio.t +++ b/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(); } ); diff --git a/t/Biblio/TransformHtmlToXml.t b/t/Biblio/TransformHtmlToXml.t index bbbadd249fb..90a7c070da4 100755 --- a/t/Biblio/TransformHtmlToXml.t +++ b/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 { diff --git a/t/Biblio2.t b/t/Biblio2.t index 3cb0cb051c5..858bac89bf6 100755 --- a/t/Biblio2.t +++ b/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 { diff --git a/t/Budgets/CanUserModifyBudget.t b/t/Budgets/CanUserModifyBudget.t index 91f4c77791d..b2c8454d716 100755 --- a/t/Budgets/CanUserModifyBudget.t +++ b/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 diff --git a/t/Budgets/CanUserUseBudget.t b/t/Budgets/CanUserUseBudget.t index 9be23a376af..5c528b4f88d 100755 --- a/t/Budgets/CanUserUseBudget.t +++ b/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 diff --git a/t/Charset.t b/t/Charset.t index a3da56f5b0c..3e92883e0b4 100755 --- a/t/Charset.t +++ b/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; diff --git a/t/Circulation/AgeRestrictionMarkers.t b/t/Circulation/AgeRestrictionMarkers.t index a67f53db3c2..a658d35977e 100755 --- a/t/Circulation/AgeRestrictionMarkers.t +++ b/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' ); diff --git a/t/Circulation_barcodedecode.t b/t/Circulation_barcodedecode.t index dc6fe966255..8a57dcd9849 100755 --- a/t/Circulation_barcodedecode.t +++ b/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' }); diff --git a/t/ClassSortRoutine_Dewey.t b/t/ClassSortRoutine_Dewey.t index 404a9672312..f4dc8e72e13 100755 --- a/t/ClassSortRoutine_Dewey.t +++ b/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 ); diff --git a/t/ClassSortRoutine_Generic.t b/t/ClassSortRoutine_Generic.t index 128006bff2c..09c3dd72920 100755 --- a/t/ClassSortRoutine_Generic.t +++ b/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 "; diff --git a/t/ClassSortRoutine_LCC.t b/t/ClassSortRoutine_LCC.t index 9ec37cfc690..bfabee440df 100755 --- a/t/ClassSortRoutine_LCC.t +++ b/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 diff --git a/t/Creators.t b/t/Creators.t index 6e825d63bb3..b1206af16a4 100755 --- a/t/Creators.t +++ b/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); diff --git a/t/External/BakerTaylor.t b/t/External/BakerTaylor.t index f6ceb2aa501..e4809359c60 100755 --- a/t/External/BakerTaylor.t +++ b/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 diff --git a/t/ImportBatch.t b/t/ImportBatch.t index 9db2c279d91..7274879a3a6 100755 --- a/t/ImportBatch.t +++ b/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'); diff --git a/t/Koha.t b/t/Koha.t index 44c56f0e483..6c12ec80614 100755 --- a/t/Koha.t +++ b/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; diff --git a/t/Koha/Util/MARC.t b/t/Koha/Util/MARC.t index aff28cbf7dc..f278386c18f 100755 --- a/t/Koha/Util/MARC.t +++ b/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'); } diff --git a/t/Koha/sleep.pl b/t/Koha/sleep.pl index 009b4034dcf..072ec5b3776 100755 --- a/t/Koha/sleep.pl +++ b/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' }); diff --git a/t/Koha/wait.pl b/t/Koha/wait.pl index f909cb1f066..ebe873b0afd 100755 --- a/t/Koha/wait.pl +++ b/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' }); diff --git a/t/Koha_Util_MARC.t b/t/Koha_Util_MARC.t index 3e205c9caed..e33867003cd 100755 --- a/t/Koha_Util_MARC.t +++ b/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'); diff --git a/t/Labels.t b/t/Labels.t index bd0d9ec85b4..69793618a72 100755 --- a/t/Labels.t +++ b/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"; diff --git a/t/Labels_split_Regex.t b/t/Labels_split_Regex.t index e94eaec170e..b69e03b725a 100755 --- a/t/Labels_split_Regex.t +++ b/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}], diff --git a/t/Labels_split_ddcn.t b/t/Labels_split_ddcn.t index 33edba19cad..3044a37d2ed 100755 --- a/t/Labels_split_ddcn.t +++ b/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); } diff --git a/t/Labels_split_lccn.t b/t/Labels_split_lccn.t index f9462ba23c9..76a6a41c666 100755 --- a/t/Labels_split_lccn.t +++ b/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 { diff --git a/t/Languages.t b/t/Languages.t index 6492ba4d0cb..14c5d2866d8 100755 --- a/t/Languages.t +++ b/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 diff --git a/t/Letters.t b/t/Letters.t index 35a4b74a2a5..ceec8d776b5 100755 --- a/t/Letters.t +++ b/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'); diff --git a/t/Matcher.t b/t/Matcher.t index 42dc809044e..3345e142510 100755 --- a/t/Matcher.t +++ b/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 => [ diff --git a/t/Members/cardnumber.t b/t/Members/cardnumber.t index 7f4e2b05354..7fddc7e6768 100755 --- a/t/Members/cardnumber.t +++ b/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' ) ) { diff --git a/t/Output.t b/t/Output.t index 31ca103a753..02218deaddd 100755 --- a/t/Output.t +++ b/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(); diff --git a/t/Prices.t b/t/Prices.t index 5c2c8613061..b0832c5977d 100755 --- a/t/Prices.t +++ b/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'); diff --git a/t/SIP/Sip.t b/t/SIP/Sip.t index e7e06709d25..1dc7ed1684b 100755 --- a/t/SIP/Sip.t +++ b/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(); diff --git a/t/SMS.t b/t/SMS.t index 21dc75bbb80..bf8de651526 100755 --- a/t/SMS.t +++ b/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 )); } diff --git a/t/Scheduler.t b/t/Scheduler.t index f0f02e11f90..520b6b326f5 100755 --- a/t/Scheduler.t +++ b/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"); diff --git a/t/Scrubber.t b/t/Scrubber.t index 9bcd003636a..1b4a9e13d10 100755 --- a/t/Scrubber.t +++ b/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 { diff --git a/t/Search/History.t b/t/Search/History.t index 030bca2ab6f..0b3715c13cb 100755 --- a/t/Search/History.t +++ b/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 diff --git a/t/Search/buildQuery.t b/t/Search/buildQuery.t index 910bf4fd3c7..cab9d5aeef7 100755 --- a/t/Search/buildQuery.t +++ b/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"); diff --git a/t/Serials/GetNextSeq.t b/t/Serials/GetNextSeq.t index 8fc201a9e7b..c1cf423f3df 100755 --- a/t/Serials/GetNextSeq.t +++ b/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 = { diff --git a/t/Serials/ModSerialStatus.t b/t/Serials/ModSerialStatus.t index afd7effcfb5..480b84f4c11 100755 --- a/t/Serials/ModSerialStatus.t +++ b/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)'; diff --git a/t/SimpleMARC.t b/t/SimpleMARC.t index 6455820fbb8..91b77432e51 100755 --- a/t/SimpleMARC.t +++ b/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; diff --git a/t/SocialData.t b/t/SocialData.t index df14a50132b..97d657529fd 100755 --- a/t/SocialData.t +++ b/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; diff --git a/t/TmplToken.t b/t/TmplToken.t index 579ee9d591f..a52f3c5e6f7 100755 --- a/t/TmplToken.t +++ b/t/TmplToken.t @@ -5,7 +5,6 @@ use strict; use warnings; -use C4::TmplTokenType; use Test::More tests => 19; BEGIN { diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t index caa92688883..3bcd14bb8bc 100755 --- a/t/db_dependent/Accounts.t +++ b/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'); diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index 6fe9ede74ca..57ef90dc4e2 100755 --- a/t/db_dependent/Acquisition.t +++ b/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'); diff --git a/t/db_dependent/Acquisition/CancelReceipt.t b/t/db_dependent/Acquisition/CancelReceipt.t index d3317bcd54e..5b5b9c03d49 100755 --- a/t/db_dependent/Acquisition/CancelReceipt.t +++ b/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; diff --git a/t/db_dependent/Acquisition/GetBasketAsCSV.t b/t/db_dependent/Acquisition/GetBasketAsCSV.t index 5b9b648c0e4..ae79a8d8aa0 100755 --- a/t/db_dependent/Acquisition/GetBasketAsCSV.t +++ b/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; diff --git a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t b/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t index fce3cf60333..458a2c75900 100755 --- a/t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t +++ b/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; diff --git a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t b/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t index 913573432f1..9b52802108c 100755 --- a/t/db_dependent/Acquisition/GetOrdersByBiblionumber.t +++ b/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; diff --git a/t/db_dependent/Acquisition/Invoices.t b/t/db_dependent/Acquisition/Invoices.t index 399e9b71566..0327a8490b9 100755 --- a/t/db_dependent/Acquisition/Invoices.t +++ b/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(); diff --git a/t/db_dependent/Acquisition/NewOrder.t b/t/db_dependent/Acquisition/NewOrder.t index df455c2e675..6c7e6820fe7 100755 --- a/t/db_dependent/Acquisition/NewOrder.t +++ b/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 ); diff --git a/t/db_dependent/Acquisition/OrderFromSubscription.t b/t/db_dependent/Acquisition/OrderFromSubscription.t index fb85b52ed18..d9db71c1803 100755 --- a/t/db_dependent/Acquisition/OrderFromSubscription.t +++ b/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; diff --git a/t/db_dependent/Acquisition/OrderUsers.t b/t/db_dependent/Acquisition/OrderUsers.t index f4ffcb2652c..3ad3bcd0412 100755 --- a/t/db_dependent/Acquisition/OrderUsers.t +++ b/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; diff --git a/t/db_dependent/Acquisition/StandingOrders.t b/t/db_dependent/Acquisition/StandingOrders.t index d53d13d93d0..ecf7cd1e5ce 100755 --- a/t/db_dependent/Acquisition/StandingOrders.t +++ b/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; diff --git a/t/db_dependent/Acquisition/TransferOrder.t b/t/db_dependent/Acquisition/TransferOrder.t index 8fa55d2eb5a..a9e59a56372 100755 --- a/t/db_dependent/Acquisition/TransferOrder.t +++ b/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; diff --git a/t/db_dependent/Acquisition/close_reopen_basket.t b/t/db_dependent/Acquisition/close_reopen_basket.t index 7faaac16111..16ca5979f07 100755 --- a/t/db_dependent/Acquisition/close_reopen_basket.t +++ b/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; diff --git a/t/db_dependent/Acquisition/populate_order_with_prices.t b/t/db_dependent/Acquisition/populate_order_with_prices.t index 50af03bf6d6..0aa3a1af913 100755 --- a/t/db_dependent/Acquisition/populate_order_with_prices.t +++ b/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; diff --git a/t/db_dependent/Amazon.t b/t/db_dependent/Amazon.t index 23040739316..871808415d4 100755 --- a/t/db_dependent/Amazon.t +++ b/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(); diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index a612b1a599f..5fdf29a9137 100755 --- a/t/db_dependent/Auth.t +++ b/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; diff --git a/t/db_dependent/Auth/haspermission.t b/t/db_dependent/Auth/haspermission.t index 064422b013e..c332faf0c87 100755 --- a/t/db_dependent/Auth/haspermission.t +++ b/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; diff --git a/t/db_dependent/Auth_with_cas.t b/t/db_dependent/Auth_with_cas.t index 3038228e6a7..be33224325b 100755 --- a/t/db_dependent/Auth_with_cas.t +++ b/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 diff --git a/t/db_dependent/Auth_with_ldap.t b/t/db_dependent/Auth_with_ldap.t index 565ddbdae6d..39f6e8ef022 100755 --- a/t/db_dependent/Auth_with_ldap.t +++ b/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 diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t index 8e626f3f5c5..f72b0c37057 100755 --- a/t/db_dependent/AuthoritiesMarc.t +++ b/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 diff --git a/t/db_dependent/Authority/Merge.t b/t/db_dependent/Authority/Merge.t index bf25a913fce..efa9a30fc7d 100755 --- a/t/db_dependent/Authority/Merge.t +++ b/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 diff --git a/t/db_dependent/BackgroundJob.t b/t/db_dependent/BackgroundJob.t index 011c775119a..459f3b28568 100755 --- a/t/db_dependent/BackgroundJob.t +++ b/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; diff --git a/t/db_dependent/Barcodes.t b/t/db_dependent/Barcodes.t index 4253a615ebd..2846f4fe890 100755 --- a/t/db_dependent/Barcodes.t +++ b/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; diff --git a/t/db_dependent/Barcodes_ValueBuilder.t b/t/db_dependent/Barcodes_ValueBuilder.t index ef0fa3a39b4..f21f140c389 100755 --- a/t/db_dependent/Barcodes_ValueBuilder.t +++ b/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; diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index feac71d8eb7..45153030444 100755 --- a/t/db_dependent/Biblio.t +++ b/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'); diff --git a/t/db_dependent/Biblio/Isbd.t b/t/db_dependent/Biblio/Isbd.t index 4943afebabe..dc992b284a9 100755 --- a/t/db_dependent/Biblio/Isbd.t +++ b/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; diff --git a/t/db_dependent/Biblio/ModBiblioMarc.t b/t/db_dependent/Biblio/ModBiblioMarc.t index e710ffee3c5..8f7e28b49c2 100755 --- a/t/db_dependent/Biblio/ModBiblioMarc.t +++ b/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; diff --git a/t/db_dependent/Biblio/TransformHtmlToMarc.t b/t/db_dependent/Biblio/TransformHtmlToMarc.t index f4ac6a86372..708a764ff42 100755 --- a/t/db_dependent/Biblio/TransformHtmlToMarc.t +++ b/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; diff --git a/t/db_dependent/Biblio/TransformKohaToMarc.t b/t/db_dependent/Biblio/TransformKohaToMarc.t index 377dbab6a52..d2efaa6aa91 100755 --- a/t/db_dependent/Biblio/TransformKohaToMarc.t +++ b/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; diff --git a/t/db_dependent/Biblio/TransformMarcToKoha.t b/t/db_dependent/Biblio/TransformMarcToKoha.t index 1a08ded4f0d..5062ed7c48b 100755 --- a/t/db_dependent/Biblio/TransformMarcToKoha.t +++ b/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; diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t index c7eec725f9f..617673dcd52 100755 --- a/t/db_dependent/Budgets.t +++ b/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; diff --git a/t/db_dependent/Charset.t b/t/db_dependent/Charset.t index b1542a3b825..420b38641e3 100755 --- a/t/db_dependent/Charset.t +++ b/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 ); diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 4ab64dd5522..8aa5d4c970d 100755 --- a/t/db_dependent/Circulation.t +++ b/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; diff --git a/t/db_dependent/Circulation/Branch.t b/t/db_dependent/Circulation/Branch.t index 041c000449e..00352acbc3e 100755 --- a/t/db_dependent/Circulation/Branch.t +++ b/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( diff --git a/t/db_dependent/Circulation/CalcDateDue.t b/t/db_dependent/Circulation/CalcDateDue.t index 8085dbd486a..af23654b2be 100755 --- a/t/db_dependent/Circulation/CalcDateDue.t +++ b/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; diff --git a/t/db_dependent/Circulation/CalcFine.t b/t/db_dependent/Circulation/CalcFine.t index 85f38ea42e3..840679f78a7 100755 --- a/t/db_dependent/Circulation/CalcFine.t +++ b/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 ); diff --git a/t/db_dependent/Circulation/CheckIfIssuedToPatron.t b/t/db_dependent/Circulation/CheckIfIssuedToPatron.t index 2d67ffc022e..447d9545ad5 100755 --- a/t/db_dependent/Circulation/CheckIfIssuedToPatron.t +++ b/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; diff --git a/t/db_dependent/Circulation/CheckValidBarcode.t b/t/db_dependent/Circulation/CheckValidBarcode.t index 41305a84d3a..0e159b60acb 100755 --- a/t/db_dependent/Circulation/CheckValidBarcode.t +++ b/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; diff --git a/t/db_dependent/Circulation/GetHardDueDate.t b/t/db_dependent/Circulation/GetHardDueDate.t index 275ecc426e1..f68b98c20dd 100755 --- a/t/db_dependent/Circulation/GetHardDueDate.t +++ b/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', diff --git a/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t b/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t index 26985782602..15d59521d9f 100755 --- a/t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t +++ b/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; diff --git a/t/db_dependent/Circulation/GetTopIssues.t b/t/db_dependent/Circulation/GetTopIssues.t index 80e044356ea..a5dc375e740 100755 --- a/t/db_dependent/Circulation/GetTopIssues.t +++ b/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; diff --git a/t/db_dependent/Circulation/IsItemIssued.t b/t/db_dependent/Circulation/IsItemIssued.t index 5b51eb9985b..e214882783c 100755 --- a/t/db_dependent/Circulation/IsItemIssued.t +++ b/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; diff --git a/t/db_dependent/Circulation/MarkIssueReturned.t b/t/db_dependent/Circulation/MarkIssueReturned.t index e9152d3f9fe..e7b1d44421c 100755 --- a/t/db_dependent/Circulation/MarkIssueReturned.t +++ b/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; diff --git a/t/db_dependent/Circulation/OfflineOperation.t b/t/db_dependent/Circulation/OfflineOperation.t index 6a92da4b1ce..98cc530f902 100755 --- a/t/db_dependent/Circulation/OfflineOperation.t +++ b/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', diff --git a/t/db_dependent/Circulation/ReturnClaims.t b/t/db_dependent/Circulation/ReturnClaims.t index 87206aeb63d..ee7b8c54e69 100755 --- a/t/db_dependent/Circulation/ReturnClaims.t +++ b/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; diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t index 79ae8555bf2..c361d3c1651 100755 --- a/t/db_dependent/Circulation/Returns.t +++ b/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; diff --git a/t/db_dependent/Circulation/StoreLastBorrower.t b/t/db_dependent/Circulation/StoreLastBorrower.t index 7d9440db39f..b6770d8e061 100755 --- a/t/db_dependent/Circulation/StoreLastBorrower.t +++ b/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; diff --git a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t index 9abe3bdc8e8..1c8ea0f7d0c 100755 --- a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t +++ b/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; diff --git a/t/db_dependent/Circulation/TooMany.t b/t/db_dependent/Circulation/TooMany.t index d1663d98a3b..c8dbd09a7ae 100755 --- a/t/db_dependent/Circulation/TooMany.t +++ b/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 ); diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t index 0ded4142fb0..d4fb82b55b7 100755 --- a/t/db_dependent/Circulation/issue.t +++ b/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; diff --git a/t/db_dependent/Circulation/transferbook.t b/t/db_dependent/Circulation/transferbook.t index 2e2ac0fe744..84756a82b8d 100755 --- a/t/db_dependent/Circulation/transferbook.t +++ b/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; diff --git a/t/db_dependent/Circulation/transfers.t b/t/db_dependent/Circulation/transfers.t index 5e639ae90c5..99767c8798e 100755 --- a/t/db_dependent/Circulation/transfers.t +++ b/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', diff --git a/t/db_dependent/Contract.t b/t/db_dependent/Contract.t index 1a6bafdf07b..7ce9d34ac7d 100755 --- a/t/db_dependent/Contract.t +++ b/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; diff --git a/t/db_dependent/CourseReserves.t b/t/db_dependent/CourseReserves.t index c4a888a4079..f8715c209dd 100755 --- a/t/db_dependent/CourseReserves.t +++ b/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'); diff --git a/t/db_dependent/CourseReserves/CourseItems.t b/t/db_dependent/CourseReserves/CourseItems.t index 2e6f9eedbb3..9cb287cd327 100755 --- a/t/db_dependent/CourseReserves/CourseItems.t +++ b/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; diff --git a/t/db_dependent/Creators/Lib.t b/t/db_dependent/Creators/Lib.t index 7d10b353b1d..c18a659c1f3 100755 --- a/t/db_dependent/Creators/Lib.t +++ b/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'); diff --git a/t/db_dependent/DecreaseLoanHighHolds.t b/t/db_dependent/DecreaseLoanHighHolds.t index 9e25fafba99..8bb0fdce6eb 100755 --- a/t/db_dependent/DecreaseLoanHighHolds.t +++ b/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; diff --git a/t/db_dependent/Exporter/Record.t b/t/db_dependent/Exporter/Record.t index 9993d7874ba..5f843d08acf 100755 --- a/t/db_dependent/Exporter/Record.t +++ b/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; diff --git a/t/db_dependent/Filter_MARC_ViewPolicy.t b/t/db_dependent/Filter_MARC_ViewPolicy.t index 552245a01b6..8f3c7443588 100755 --- a/t/db_dependent/Filter_MARC_ViewPolicy.t +++ b/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; diff --git a/t/db_dependent/Fines.t b/t/db_dependent/Fines.t index 76cc0638a95..fef8a939afa 100755 --- a/t/db_dependent/Fines.t +++ b/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; diff --git a/t/db_dependent/FrameworkPlugin.t b/t/db_dependent/FrameworkPlugin.t index 3a28df4055c..f05c8105faa 100755 --- a/t/db_dependent/FrameworkPlugin.t +++ b/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; diff --git a/t/db_dependent/Heading.t b/t/db_dependent/Heading.t index 1615ea0eaa5..30a9e0ae885 100755 --- a/t/db_dependent/Heading.t +++ b/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 { diff --git a/t/db_dependent/Heading_MARC21.t b/t/db_dependent/Heading_MARC21.t index a2ea2df0d56..357d3126d44 100755 --- a/t/db_dependent/Heading_MARC21.t +++ b/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: { diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t index 365557e2b83..fb983caca5c 100755 --- a/t/db_dependent/Hold.t +++ b/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; diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index 64419b5fee8..0710eda1495 100755 --- a/t/db_dependent/Holds.t +++ b/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; diff --git a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t index bc2633a2086..18031c15d00 100755 --- a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t +++ b/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; diff --git a/t/db_dependent/Holds/HoldFulfillmentPolicy.t b/t/db_dependent/Holds/HoldFulfillmentPolicy.t index daf527d6223..7e21336c106 100755 --- a/t/db_dependent/Holds/HoldFulfillmentPolicy.t +++ b/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; diff --git a/t/db_dependent/Holds/HoldItemtypeLimit.t b/t/db_dependent/Holds/HoldItemtypeLimit.t index 13958e6241c..91573206948 100755 --- a/t/db_dependent/Holds/HoldItemtypeLimit.t +++ b/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; diff --git a/t/db_dependent/Holds/LocalHoldsPriority.t b/t/db_dependent/Holds/LocalHoldsPriority.t index 26c052b6cd8..a125d3eab19 100755 --- a/t/db_dependent/Holds/LocalHoldsPriority.t +++ b/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; -}; \ No newline at end of file +}; diff --git a/t/db_dependent/Holds/RevertWaitingStatus.t b/t/db_dependent/Holds/RevertWaitingStatus.t index 252d277a0f3..4dab0f3b701 100755 --- a/t/db_dependent/Holds/RevertWaitingStatus.t +++ b/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; diff --git a/t/db_dependent/Holds/WaitingReserves.t b/t/db_dependent/Holds/WaitingReserves.t index 50b6ed85734..7536b30b480 100755 --- a/t/db_dependent/Holds/WaitingReserves.t +++ b/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; diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t index eb5e9028b64..30f4ec3eae2 100755 --- a/t/db_dependent/HoldsQueue.t +++ b/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; diff --git a/t/db_dependent/Holidays.t b/t/db_dependent/Holidays.t index ced8bd538b3..677c4cc1f32 100755 --- a/t/db_dependent/Holidays.t +++ b/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; diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t index c3be5cea947..97a2062ce10 100755 --- a/t/db_dependent/ILSDI_Services.t +++ b/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; diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t index 0ed98219e10..24ef726f96d 100755 --- a/t/db_dependent/Illrequests.t +++ b/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; diff --git a/t/db_dependent/ImportBatch.t b/t/db_dependent/ImportBatch.t index da0c1899b21..c96222de5e1 100755 --- a/t/db_dependent/ImportBatch.t +++ b/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 diff --git a/t/db_dependent/ImportExportFramework.t b/t/db_dependent/ImportExportFramework.t index bd3a6d1580f..f52200d670b 100755 --- a/t/db_dependent/ImportExportFramework.t +++ b/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; diff --git a/t/db_dependent/Installer.t b/t/db_dependent/Installer.t index c8cbe6ceb78..8dfd9167558 100755 --- a/t/db_dependent/Installer.t +++ b/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' ); diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index b28d930ebe4..120d9b9307d 100755 --- a/t/db_dependent/Items.t +++ b/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 ); diff --git a/t/db_dependent/Items/AutomaticItemModificationByAge.t b/t/db_dependent/Items/AutomaticItemModificationByAge.t index f0472526a17..0c1b044b384 100755 --- a/t/db_dependent/Items/AutomaticItemModificationByAge.t +++ b/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; diff --git a/t/db_dependent/Items/GetHostItemsInfo.t b/t/db_dependent/Items/GetHostItemsInfo.t index 63e8ea423c9..d5c34c3b706 100755 --- a/t/db_dependent/Items/GetHostItemsInfo.t +++ b/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; diff --git a/t/db_dependent/Items/GetItemsForInventory.t b/t/db_dependent/Items/GetItemsForInventory.t index 5e3ea7834cb..b5c2b97bd26 100755 --- a/t/db_dependent/Items/GetItemsForInventory.t +++ b/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'); } diff --git a/t/db_dependent/Items/MoveItemFromBiblio.t b/t/db_dependent/Items/MoveItemFromBiblio.t index 75ae92afe0c..7a3cf2b6398 100755 --- a/t/db_dependent/Items/MoveItemFromBiblio.t +++ b/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; diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t index 9e0b8d3af96..ca807234a39 100755 --- a/t/db_dependent/Koha.t +++ b/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'); } diff --git a/t/db_dependent/Koha/Account/Line.t b/t/db_dependent/Koha/Account/Line.t index 232a56720ed..936fc5f9c3e 100755 --- a/t/db_dependent/Koha/Account/Line.t +++ b/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; diff --git a/t/db_dependent/Koha/Acquisition/Basket.t b/t/db_dependent/Koha/Acquisition/Basket.t index 7b6c17d5524..971752ae533 100755 --- a/t/db_dependent/Koha/Acquisition/Basket.t +++ b/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); diff --git a/t/db_dependent/Koha/Acquisition/Booksellers.t b/t/db_dependent/Koha/Acquisition/Booksellers.t index 5b5f58c1008..9025f1cc81d 100755 --- a/t/db_dependent/Koha/Acquisition/Booksellers.t +++ b/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; diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t index 8919fe29af6..dd2138405f0 100755 --- a/t/db_dependent/Koha/Acquisition/Order.t +++ b/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; diff --git a/t/db_dependent/Koha/ActionLogs.t b/t/db_dependent/Koha/ActionLogs.t index 24bce1b7eab..ede7e0cc5ec 100755 --- a/t/db_dependent/Koha/ActionLogs.t +++ b/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 ); diff --git a/t/db_dependent/Koha/Authorities.t b/t/db_dependent/Koha/Authorities.t index a618bfabb85..04ad663e28f 100755 --- a/t/db_dependent/Koha/Authorities.t +++ b/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; diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t index e7ecb4f3f5b..83de0634c6b 100755 --- a/t/db_dependent/Koha/Biblio.t +++ b/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; diff --git a/t/db_dependent/Koha/Biblio/Metadata.t b/t/db_dependent/Koha/Biblio/Metadata.t index 2afd5c3ce7e..7bd22e269a0 100755 --- a/t/db_dependent/Koha/Biblio/Metadata.t +++ b/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 { diff --git a/t/db_dependent/Koha/Biblios.t b/t/db_dependent/Koha/Biblios.t index 5758ea03e2f..d19e8f3c0d4 100755 --- a/t/db_dependent/Koha/Biblios.t +++ b/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; diff --git a/t/db_dependent/Koha/Charges/Fees.t b/t/db_dependent/Koha/Charges/Fees.t index 637aaa278f3..2f2af9d8769 100755 --- a/t/db_dependent/Koha/Charges/Fees.t +++ b/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 { diff --git a/t/db_dependent/Koha/Checkouts.t b/t/db_dependent/Koha/Checkouts.t index 7163bd208b5..9c4b0dbfeae 100755 --- a/t/db_dependent/Koha/Checkouts.t +++ b/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 ); diff --git a/t/db_dependent/Koha/Club/Enrollment.t b/t/db_dependent/Koha/Club/Enrollment.t index 8ea7d0742f4..528be791515 100755 --- a/t/db_dependent/Koha/Club/Enrollment.t +++ b/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; -} \ No newline at end of file +} diff --git a/t/db_dependent/Koha/Filter/EmbedItems.t b/t/db_dependent/Koha/Filter/EmbedItems.t index cfbad44d081..524bfb5f340 100755 --- a/t/db_dependent/Koha/Filter/EmbedItems.t +++ b/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; diff --git a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t b/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t index d4a7b2d6770..ca81af11886 100755 --- a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t +++ b/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; diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t index 7d19a132f13..51c33832771 100755 --- a/t/db_dependent/Koha/Holds.t +++ b/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; diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t index 161a13b5756..1ac523c1a05 100755 --- a/t/db_dependent/Koha/Item.t +++ b/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; diff --git a/t/db_dependent/Koha/ItemTypes.t b/t/db_dependent/Koha/ItemTypes.t index 157477c4f31..aecd8d971b5 100755 --- a/t/db_dependent/Koha/ItemTypes.t +++ b/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; diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t index 900004d9127..e3e7205e213 100755 --- a/t/db_dependent/Koha/Items.t +++ b/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; diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t index b78283ce250..64d3f1d9ea2 100755 --- a/t/db_dependent/Koha/Object.t +++ b/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; diff --git a/t/db_dependent/Koha/Patron/Category.t b/t/db_dependent/Koha/Patron/Category.t index 93711d7c955..5accf5679ea 100755 --- a/t/db_dependent/Koha/Patron/Category.t +++ b/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; -}; \ No newline at end of file +}; diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index 120e9813243..59c6a8a075e 100755 --- a/t/db_dependent/Koha/Patrons.t +++ b/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; diff --git a/t/db_dependent/Koha/Plugins/Circulation_hooks.t b/t/db_dependent/Koha/Plugins/Circulation_hooks.t index 5f8569d9ed8..5ef25f793e8 100755 --- a/t/db_dependent/Koha/Plugins/Circulation_hooks.t +++ b/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; diff --git a/t/db_dependent/Koha/Plugins/Holds_hooks.t b/t/db_dependent/Koha/Plugins/Holds_hooks.t index 02086fa8ded..07aa4f7344c 100755 --- a/t/db_dependent/Koha/Plugins/Holds_hooks.t +++ b/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; diff --git a/t/db_dependent/Koha/Pseudonymization.t b/t/db_dependent/Koha/Pseudonymization.t index cfefc82292c..674ad36bf1a 100755 --- a/t/db_dependent/Koha/Pseudonymization.t +++ b/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 ); diff --git a/t/db_dependent/Koha/SearchEngine/Indexer.t b/t/db_dependent/Koha/SearchEngine/Indexer.t index a1740c7f714..69f5ec3836c 100755 --- a/t/db_dependent/Koha/SearchEngine/Indexer.t +++ b/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; diff --git a/t/db_dependent/Koha/Statistics.t b/t/db_dependent/Koha/Statistics.t index 12ebc9e75ae..01600fa3484 100755 --- a/t/db_dependent/Koha/Statistics.t +++ b/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; diff --git a/t/db_dependent/Koha/Z3950Responder/Session.t b/t/db_dependent/Koha/Z3950Responder/Session.t index 279aafe1976..b48ac0cc769 100755 --- a/t/db_dependent/Koha/Z3950Responder/Session.t +++ b/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'); diff --git a/t/db_dependent/Koha/Z3950Responder/Session2.t b/t/db_dependent/Koha/Z3950Responder/Session2.t index e6e8e238620..71ba26ec3e4 100755 --- a/t/db_dependent/Koha/Z3950Responder/Session2.t +++ b/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; diff --git a/t/db_dependent/Koha_Authority.t b/t/db_dependent/Koha_Authority.t index 300b6a8bcf9..e5764579f45 100755 --- a/t/db_dependent/Koha_Authority.t +++ b/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; diff --git a/t/db_dependent/Koha_ExternalContent_RecordedBooks.t b/t/db_dependent/Koha_ExternalContent_RecordedBooks.t index 7f21be97216..fd9a1c1d839 100755 --- a/t/db_dependent/Koha_ExternalContent_RecordedBooks.t +++ b/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 ); diff --git a/t/db_dependent/Labels/t_Batch.t b/t/db_dependent/Labels/t_Batch.t index b74917b514a..61a37101291 100755 --- a/t/db_dependent/Labels/t_Batch.t +++ b/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; diff --git a/t/db_dependent/Languages.t b/t/db_dependent/Languages.t index 120f1d5a024..f9e50aade81 100755 --- a/t/db_dependent/Languages.t +++ b/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; diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index f916f0865de..7e5273fb020 100755 --- a/t/db_dependent/Letters.t +++ b/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'; diff --git a/t/db_dependent/Letters/GetLettersAvailableForALibrary.t b/t/db_dependent/Letters/GetLettersAvailableForALibrary.t index ded89859135..3a49e7d68e3 100755 --- a/t/db_dependent/Letters/GetLettersAvailableForALibrary.t +++ b/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; diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t index 8d049423c6c..7e72517eb63 100755 --- a/t/db_dependent/Letters/TemplateToolkit.t +++ b/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; diff --git a/t/db_dependent/LibraryGroups.t b/t/db_dependent/LibraryGroups.t index 26824210e87..f9ecabf6a27 100755 --- a/t/db_dependent/LibraryGroups.t +++ b/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"); -}; \ No newline at end of file +}; diff --git a/t/db_dependent/Linker_Default.t b/t/db_dependent/Linker_Default.t index 19f421373f2..e16d7902984 100755 --- a/t/db_dependent/Linker_Default.t +++ b/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; diff --git a/t/db_dependent/Linker_FirstMatch.t b/t/db_dependent/Linker_FirstMatch.t index cfcd752437e..d4d211a9dc4 100755 --- a/t/db_dependent/Linker_FirstMatch.t +++ b/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 ); diff --git a/t/db_dependent/Log.t b/t/db_dependent/Log.t index 3ce974bc695..b3084ce924e 100755 --- a/t/db_dependent/Log.t +++ b/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; diff --git a/t/db_dependent/MarcModificationTemplates.t b/t/db_dependent/MarcModificationTemplates.t index fa148f97715..82d8a29463f 100755 --- a/t/db_dependent/MarcModificationTemplates.t +++ b/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; diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t index 367d0d2aff8..dd0ed5d26f7 100755 --- a/t/db_dependent/Members.t +++ b/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; diff --git a/t/db_dependent/Members/GetAllIssues.t b/t/db_dependent/Members/GetAllIssues.t index 45c3682d4e2..b327c8fdc50 100755 --- a/t/db_dependent/Members/GetAllIssues.t +++ b/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; diff --git a/t/db_dependent/Members/IssueSlip.t b/t/db_dependent/Members/IssueSlip.t index 95867690a1f..dced42384d4 100755 --- a/t/db_dependent/Members/IssueSlip.t +++ b/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; diff --git a/t/db_dependent/Members/Statistics.t b/t/db_dependent/Members/Statistics.t index fe0ca9b1939..fc1a62049cd 100755 --- a/t/db_dependent/Members/Statistics.t +++ b/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; diff --git a/t/db_dependent/Message.t b/t/db_dependent/Message.t index cdb30322c65..ab65e0ba1ba 100755 --- a/t/db_dependent/Message.t +++ b/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; diff --git a/t/db_dependent/MungeMarcPrice.t b/t/db_dependent/MungeMarcPrice.t index 12a3d6af459..1a514232af2 100755 --- a/t/db_dependent/MungeMarcPrice.t +++ b/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; diff --git a/t/db_dependent/OAI/AndSets.t b/t/db_dependent/OAI/AndSets.t index d58959520ba..0d6bd9049fc 100755 --- a/t/db_dependent/OAI/AndSets.t +++ b/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; diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t index 09a09de890d..48fea418ebf 100755 --- a/t/db_dependent/OAI/Server.t +++ b/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; diff --git a/t/db_dependent/OAI/Sets.t b/t/db_dependent/OAI/Sets.t index 1fd577387f1..4dfd80bf037 100755 --- a/t/db_dependent/OAI/Sets.t +++ b/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; diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t index ed031b2932e..55a5db60b1b 100755 --- a/t/db_dependent/Overdues.t +++ b/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'); diff --git a/t/db_dependent/Passwordrecovery.t b/t/db_dependent/Passwordrecovery.t index f4a72097041..0f33acb0ea0 100755 --- a/t/db_dependent/Passwordrecovery.t +++ b/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; diff --git a/t/db_dependent/Patron/Borrower_PrevCheckout.t b/t/db_dependent/Patron/Borrower_PrevCheckout.t index 8a240cec4bb..3b12f70878a 100755 --- a/t/db_dependent/Patron/Borrower_PrevCheckout.t +++ b/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; diff --git a/t/db_dependent/Patron/Messages.t b/t/db_dependent/Patron/Messages.t index 0f099599828..8da4915d108 100755 --- a/t/db_dependent/Patron/Messages.t +++ b/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; \ No newline at end of file +$schema->storage->txn_rollback; diff --git a/t/db_dependent/Patroncards.t b/t/db_dependent/Patroncards.t index 3f9b742e311..5ae61af1dcd 100755 --- a/t/db_dependent/Patroncards.t +++ b/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; diff --git a/t/db_dependent/Record.t b/t/db_dependent/Record.t index 22fcdb3de06..53a4ae621f8 100755 --- a/t/db_dependent/Record.t +++ b/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; diff --git a/t/db_dependent/Record/Record.t b/t/db_dependent/Record/Record.t index 384588d66ec..495f8e05b17 100755 --- a/t/db_dependent/Record/Record.t +++ b/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 diff --git a/t/db_dependent/Record/marcrecord2csv.t b/t/db_dependent/Record/marcrecord2csv.t index 37b6e305834..53fa0bdb9f9 100755 --- a/t/db_dependent/Record/marcrecord2csv.t +++ b/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; diff --git a/t/db_dependent/Reports.t b/t/db_dependent/Reports.t index e28efd682e4..9cf56abef3f 100755 --- a/t/db_dependent/Reports.t +++ b/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 )); } diff --git a/t/db_dependent/Reports/Guided.t b/t/db_dependent/Reports/Guided.t index 5419bddb4ae..6373c0e6471 100755 --- a/t/db_dependent/Reports/Guided.t +++ b/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) diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 93e17991916..e748f115f48 100755 --- a/t/db_dependent/Reserves.t +++ b/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; diff --git a/t/db_dependent/Reserves/AutoUnsuspendReserves.t b/t/db_dependent/Reserves/AutoUnsuspendReserves.t index d5703cc4e9e..4d24794825d 100755 --- a/t/db_dependent/Reserves/AutoUnsuspendReserves.t +++ b/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; diff --git a/t/db_dependent/Reserves/CancelExpiredReserves.t b/t/db_dependent/Reserves/CancelExpiredReserves.t index 6822a043585..27a583b6f1a 100755 --- a/t/db_dependent/Reserves/CancelExpiredReserves.t +++ b/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; diff --git a/t/db_dependent/Reserves/GetReserveFee.t b/t/db_dependent/Reserves/GetReserveFee.t index bb9b4dacbab..f53f7c154fa 100755 --- a/t/db_dependent/Reserves/GetReserveFee.t +++ b/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; diff --git a/t/db_dependent/Reserves/MultiplePerRecord.t b/t/db_dependent/Reserves/MultiplePerRecord.t index 6e887407020..07f7ea9aba1 100755 --- a/t/db_dependent/Reserves/MultiplePerRecord.t +++ b/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; diff --git a/t/db_dependent/RotatingCollections.t b/t/db_dependent/RotatingCollections.t index 1db4e45a37b..f278ad47ac4 100755 --- a/t/db_dependent/RotatingCollections.t +++ b/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; diff --git a/t/db_dependent/SIP/ILS.t b/t/db_dependent/SIP/ILS.t index ebfdeea9c64..79eabdd558d 100755 --- a/t/db_dependent/SIP/ILS.t +++ b/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; diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t index db48fde51e9..790248b748c 100755 --- a/t/db_dependent/SIP/Message.t +++ b/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); diff --git a/t/db_dependent/SIP/SIPServer.t b/t/db_dependent/SIP/SIPServer.t index 4adecf95f8d..8d6d5747760 100755 --- a/t/db_dependent/SIP/SIPServer.t +++ b/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. diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t index 6fa5810662f..1f8cab65f21 100755 --- a/t/db_dependent/SIP/Transaction.t +++ b/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 ); diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 52051375c7d..8efe5dff865 100755 --- a/t/db_dependent/Search.t +++ b/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'], diff --git a/t/db_dependent/Search/History.t b/t/db_dependent/Search/History.t index db3a1038580..56946945349 100755 --- a/t/db_dependent/Search/History.t +++ b/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"; diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t index 0dcdada16a1..925a7502502 100755 --- a/t/db_dependent/Serials.t +++ b/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; diff --git a/t/db_dependent/Serials/Claims.t b/t/db_dependent/Serials/Claims.t index 6458497219e..afc3a18e663 100755 --- a/t/db_dependent/Serials/Claims.t +++ b/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 ); diff --git a/t/db_dependent/Serials/Frequency.t b/t/db_dependent/Serials/Frequency.t index b185854947c..02a64f7f99f 100755 --- a/t/db_dependent/Serials/Frequency.t +++ b/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(); diff --git a/t/db_dependent/Serials/GetFictiveIssueNumber.t b/t/db_dependent/Serials/GetFictiveIssueNumber.t index 1ad66b2c938..5a5e6b00576 100755 --- a/t/db_dependent/Serials/GetFictiveIssueNumber.t +++ b/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; diff --git a/t/db_dependent/Serials/GetNextDate.t b/t/db_dependent/Serials/GetNextDate.t index bcbb76c1ade..4081dea09a4 100755 --- a/t/db_dependent/Serials/GetNextDate.t +++ b/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; diff --git a/t/db_dependent/Serials/GetNextSeq.t b/t/db_dependent/Serials/GetNextSeq.t index d369b6ccdf4..270568de609 100755 --- a/t/db_dependent/Serials/GetNextSeq.t +++ b/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", diff --git a/t/db_dependent/Serials/Numberpattern.t b/t/db_dependent/Serials/Numberpattern.t index 84a62ccb5a0..65e1f420f1c 100755 --- a/t/db_dependent/Serials/Numberpattern.t +++ b/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(); diff --git a/t/db_dependent/Serials/ReNewSubscription.t b/t/db_dependent/Serials/ReNewSubscription.t index c8e4a60bb49..6abe8364c88 100755 --- a/t/db_dependent/Serials/ReNewSubscription.t +++ b/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; diff --git a/t/db_dependent/Serials_2.t b/t/db_dependent/Serials_2.t index caf3d432b15..d0a1b7a6157 100755 --- a/t/db_dependent/Serials_2.t +++ b/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/ }; diff --git a/t/db_dependent/ShelfBrowser.t b/t/db_dependent/ShelfBrowser.t index bf5906fa195..27d37419ad0 100755 --- a/t/db_dependent/ShelfBrowser.t +++ b/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; diff --git a/t/db_dependent/Stats.t b/t/db_dependent/Stats.t index 7e2e6f7b6c3..5bf1b615bea 100755 --- a/t/db_dependent/Stats.t +++ b/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', diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t index 762f9ad7a3c..44e90a945a8 100755 --- a/t/db_dependent/Suggestions.t +++ b/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; diff --git a/t/db_dependent/Tags.t b/t/db_dependent/Tags.t index 93014bb3c1f..30cbc12b481 100755 --- a/t/db_dependent/Tags.t +++ b/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)'; diff --git a/t/db_dependent/Templates.t b/t/db_dependent/Templates.t index 2efce26c291..5d44d47fa55 100755 --- a/t/db_dependent/Templates.t +++ b/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 diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index ddc12679c56..8b8b0f29294 100755 --- a/t/db_dependent/UsageStats.t +++ b/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'); } diff --git a/t/db_dependent/Utils/Datatables.t b/t/db_dependent/Utils/Datatables.t index ae0c61bc4e8..409dd6ecf6b 100755 --- a/t/db_dependent/Utils/Datatables.t +++ b/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; diff --git a/t/db_dependent/Utils/Datatables_Virtualshelves.t b/t/db_dependent/Utils/Datatables_Virtualshelves.t index 758f93fff91..d43dbc54386 100755 --- a/t/db_dependent/Utils/Datatables_Virtualshelves.t +++ b/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; diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t index ed34e5aa4d5..0633d3402c2 100755 --- a/t/db_dependent/XISBN.t +++ b/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; diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t index f90baff1970..521578947b6 100755 --- a/t/db_dependent/XSLT.t +++ b/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; diff --git a/t/db_dependent/api/v1/auth.t b/t/db_dependent/api/v1/auth.t index 2003ac657cf..cdb171925c6 100755 --- a/t/db_dependent/api/v1/auth.t +++ b/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; diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t index b3868a340f4..abd32a4629b 100755 --- a/t/db_dependent/api/v1/checkouts.t +++ b/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; diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t index e5a84bae3c5..5abba547396 100755 --- a/t/db_dependent/api/v1/holds.t +++ b/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; diff --git a/t/db_dependent/api/v1/return_claims.t b/t/db_dependent/api/v1/return_claims.t index 2123b5e0aec..a9877f79463 100755 --- a/t/db_dependent/api/v1/return_claims.t +++ b/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; diff --git a/t/db_dependent/rollingloans.t b/t/db_dependent/rollingloans.t index 605bde4f38f..f72fa9fcbf0 100755 --- a/t/db_dependent/rollingloans.t +++ b/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; diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t index 4d0410450c4..4bf121b022a 100755 --- a/t/db_dependent/selenium/basic_workflow.t +++ b/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; diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t index a59739fa8c4..220345fb82d 100755 --- a/t/db_dependent/selenium/regressions.t +++ b/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; diff --git a/t/db_dependent/www/regressions.t b/t/db_dependent/www/regressions.t index 9ea1a1d96a8..8b9c77b07bd 100755 --- a/t/db_dependent/www/regressions.t +++ b/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; diff --git a/t/db_dependent/zebra_config.pl b/t/db_dependent/zebra_config.pl index 8f962def232..169c51e55e7 100755 --- a/t/db_dependent/zebra_config.pl +++ b/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; diff --git a/t/lib/Dates.pm b/t/lib/Dates.pm index 66299d9eb12..53400998812 100644 --- a/t/lib/Dates.pm +++ b/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 diff --git a/t/lib/Koha/BackgroundJob/BatchTest.pm b/t/lib/Koha/BackgroundJob/BatchTest.pm index 6e740386516..2b6490dbfcc 100644 --- a/t/lib/Koha/BackgroundJob/BatchTest.pm +++ b/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 ); diff --git a/t/lib/Koha/Plugin/BadAPIRoute.pm b/t/lib/Koha/Plugin/BadAPIRoute.pm index baf7e23a3f6..66a1417a3d3 100644 --- a/t/lib/Koha/Plugin/BadAPIRoute.pm +++ b/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); diff --git a/t/lib/Koha/Plugin/Test.pm b/t/lib/Koha/Plugin/Test.pm index 1c296b05955..36565397b77 100644 --- a/t/lib/Koha/Plugin/Test.pm +++ b/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); diff --git a/t/lib/Mocks.pm b/t/lib/Mocks.pm index a2404647c0d..2b63c0ece50 100644 --- a/t/lib/Mocks.pm +++ b/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; diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm index 35d2c04fc39..8e235e94a7f 100644 --- a/t/lib/Selenium.pm +++ b/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)); diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index ee375425afc..e8b0dbf1269 100644 --- a/t/lib/TestBuilder.pm +++ b/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 { diff --git a/tags/list.pl b/tags/list.pl index 76d65c8dd15..ac2ccbc8b17 100755 --- a/tags/list.pl +++ b/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. diff --git a/tags/review.pl b/tags/review.pl index 866d94c3d97..0cc157aacc7 100755 --- a/tags/review.pl +++ b/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. diff --git a/tools/access_files.pl b/tools/access_files.pl index 5ead5814aa0..8a1c1adc58d 100755 --- a/tools/access_files.pl +++ b/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"); diff --git a/tools/ajax-inventory.pl b/tools/ajax-inventory.pl index 72175cfb7a5..a8c8c9d06d3 100755 --- a/tools/ajax-inventory.pl +++ b/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; diff --git a/tools/automatic_item_modification_by_age.pl b/tools/automatic_item_modification_by_age.pl index ae9bcec192b..3693f318f48 100755 --- a/tools/automatic_item_modification_by_age.pl +++ b/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; diff --git a/tools/background-job-progress.pl b/tools/background-job-progress.pl index 625389f9029..e9e914d0d76 100755 --- a/tools/background-job-progress.pl +++ b/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 diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 6354d3bea2e..63e22fc1445 100755 --- a/tools/batchMod.pl +++ b/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; diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl index ea87d8b6c85..2ec14ef6537 100755 --- a/tools/batch_delete_records.pl +++ b/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; diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl index d118120768d..31231e77c24 100755 --- a/tools/batch_record_modification.pl +++ b/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; diff --git a/tools/batch_records_ajax.pl b/tools/batch_records_ajax.pl index 4ddb0f53691..1085348da91 100755 --- a/tools/batch_records_ajax.pl +++ b/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; diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl index 1afc3f95406..add68a23bc1 100755 --- a/tools/cleanborrowers.pl +++ b/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; diff --git a/tools/copy-holidays.pl b/tools/copy-holidays.pl index e11353a09da..381f9e70a54 100755 --- a/tools/copy-holidays.pl +++ b/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; diff --git a/tools/csv-profiles.pl b/tools/csv-profiles.pl index cf4012fc478..2883f71d49b 100755 --- a/tools/csv-profiles.pl +++ b/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; diff --git a/tools/exceptionHolidays.pl b/tools/exceptionHolidays.pl index 68940744594..a96b1d0ebb6 100755 --- a/tools/exceptionHolidays.pl +++ b/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(); diff --git a/tools/export.pl b/tools/export.pl index 588f1b9c937..7b9686197e0 100755 --- a/tools/export.pl +++ b/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; diff --git a/tools/holidays.pl b/tools/holidays.pl index 3b7e93d7cd9..ddf45db1dcb 100755 --- a/tools/holidays.pl +++ b/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; diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl index 9d9eedffeed..949f40261d0 100755 --- a/tools/import_borrowers.pl +++ b/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(); diff --git a/tools/inventory.pl b/tools/inventory.pl index 2ad5452015a..5eac6e4e743 100755 --- a/tools/inventory.pl +++ b/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)"; diff --git a/tools/koha-news.pl b/tools/koha-news.pl index 65f560a5dde..cfc8066104f 100755 --- a/tools/koha-news.pl +++ b/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; diff --git a/tools/letter.pl b/tools/letter.pl index 3ed44c3848f..b913d0ee59d 100755 --- a/tools/letter.pl +++ b/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; diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index 8fcea16c03a..ef0bd36d332 100755 --- a/tools/manage-marc-import.pl +++ b/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; diff --git a/tools/marc_modification_templates.pl b/tools/marc_modification_templates.pl index ffe5784a955..b802d508a3e 100755 --- a/tools/marc_modification_templates.pl +++ b/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; diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index ee896848d1b..a12c81d715f 100755 --- a/tools/modborrowers.pl +++ b/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; diff --git a/tools/newHolidays.pl b/tools/newHolidays.pl index c402dfdf7f2..b07079d52b1 100755 --- a/tools/newHolidays.pl +++ b/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(); diff --git a/tools/overduerules.pl b/tools/overduerules.pl index b7860d87262..5cab5a802dd 100755 --- a/tools/overduerules.pl +++ b/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; diff --git a/tools/picture-upload.pl b/tools/picture-upload.pl index 868149e4a72..c708f7f2447 100755 --- a/tools/picture-upload.pl +++ b/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; diff --git a/tools/problem-reports.pl b/tools/problem-reports.pl index 0b07511cf3f..31a3671b688 100755 --- a/tools/problem-reports.pl +++ b/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; diff --git a/tools/quotes-upload.pl b/tools/quotes-upload.pl index 28ef9cef80a..6efb6da313d 100755 --- a/tools/quotes-upload.pl +++ b/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; diff --git a/tools/quotes.pl b/tools/quotes.pl index f87991a88b5..b45f55ea169 100755 --- a/tools/quotes.pl +++ b/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; diff --git a/tools/scheduler.pl b/tools/scheduler.pl index b6a39532cc3..53d4b641c4e 100755 --- a/tools/scheduler.pl +++ b/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; diff --git a/tools/showdiffmarc.pl b/tools/showdiffmarc.pl index 57da80e719e..c8794335782 100755 --- a/tools/showdiffmarc.pl +++ b/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; diff --git a/tools/stage-marc-import.pl b/tools/stage-marc-import.pl index e9afdc1461c..7653bc6893c 100755 --- a/tools/stage-marc-import.pl +++ b/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; diff --git a/tools/stockrotation.pl b/tools/stockrotation.pl index 18891fa3db6..b1d25484561 100755 --- a/tools/stockrotation.pl +++ b/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; diff --git a/tools/tools-home.pl b/tools/tools-home.pl index 4a4ed2ceef3..842ae688740 100755 --- a/tools/tools-home.pl +++ b/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; diff --git a/tools/upload-cover-image.pl b/tools/upload-cover-image.pl index 84fc4a416df..f55d8f128d9 100755 --- a/tools/upload-cover-image.pl +++ b/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; diff --git a/tools/upload-file.pl b/tools/upload-file.pl index 86ef2c5dc2d..7ec0fc7045b 100755 --- a/tools/upload-file.pl +++ b/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 diff --git a/tools/upload.pl b/tools/upload.pl index c01d57f925a..509e99bb002 100755 --- a/tools/upload.pl +++ b/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'; diff --git a/tools/viewlog.pl b/tools/viewlog.pl index e0b19e91b9c..5909cb39edb 100755 --- a/tools/viewlog.pl +++ b/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; diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl index 68e7da5035a..5c2b262a184 100755 --- a/virtualshelves/addbybiblionumber.pl +++ b/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; diff --git a/virtualshelves/downloadshelf.pl b/virtualshelves/downloadshelf.pl index c6cb31f4968..07b2682945f 100755 --- a/virtualshelves/downloadshelf.pl +++ b/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; diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index f15e2c9f64d..bc472497446 100755 --- a/virtualshelves/sendshelf.pl +++ b/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; diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index d233eb1355b..85a529e4928 100755 --- a/virtualshelves/shelves.pl +++ b/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; diff --git a/xt/yaml_valid.pl b/xt/yaml_valid.pl index 2bbb9650cbc..59e303a4f58 100755 --- a/xt/yaml_valid.pl +++ b/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 = <