From f239330bfef2bbf17887ba604b88b423daf65239 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 24 Jun 2025 12:39:51 +0200 Subject: [PATCH] Bug 39712: Add POD --- Koha/Manual.pm | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Koha/Manual.pm b/Koha/Manual.pm index 90f06d0b5d9..c3d3a4bac22 100644 --- a/Koha/Manual.pm +++ b/Koha/Manual.pm @@ -1,9 +1,39 @@ package Koha::Manual; +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + use Modern::Perl; use C4::Context; +=head1 NAME + +Koha::Manual - Build links to the documentation + +=head1 API + +=head2 Class Methods + +=head3 _get_help_version + +Return the version to use. +Either the system preference "Version", or the last version.major value if using unstable. + +=cut + sub _get_help_version { my $help_version = C4::Context->preference("Version"); if ( $help_version =~ m|^(\d+)\.(\d{2}).*$| ) { @@ -16,6 +46,14 @@ sub _get_help_version { return $help_version; } +=head3 _get_base_url + +Return the base URL to use. + +Use system preferences 'KohaManualLanguage' and 'KohaManualBaseURL' to properly build the URL. + +=cut + sub _get_base_url { my ($preferred_language) = @_; @@ -314,6 +352,14 @@ our $mapping = { 'virtualshelves/shelves' => '/lists.html#lists', }; +=head3 get_url + + my $koha_manual_url = Koha::Manual::get_url($referer, $lang); + +Return the external URL to the manual for the I<$url> passed in parameter + +=cut + sub get_url { my ( $url, $preferred_language ) = @_; my $file; -- 2.34.1