7 sub _get_help_version
{
8 my $help_version = C4
::Context
->preference("Version");
9 if ( $help_version =~ m
|^(\d
+)\
.(\d
{2}).*$| ) {
12 unless ( $major % 2 ) { $major-- };
13 $major = sprintf("%02d", $major);
14 $help_version = "$version.$major";
20 my ( $preferred_language ) = @_;
22 my @available_languages = qw( en ar cs es fr it pt_BR tz zh_TW );
24 my ( $language ) = grep {
25 my $preferred_short = substr $preferred_language, 0, 2;
26 my $avail_short = substr $_, 0, 2;
27 $preferred_short eq $avail_short ?
$_ : ()
28 } @available_languages;
30 my $KohaManualLanguage = $language || C4
::Context
->preference('KohaManualLanguage') || 'en';
31 my $KohaManualBaseURL = C4
::Context
->preference('KohaManualBaseURL') || 'https://koha-community.org/manual';
32 if ( $KohaManualBaseURL =~ m
|^/| ) {
33 $KohaManualBaseURL = C4
::Context
->preference('staffClientBaseURL') . $KohaManualBaseURL;
35 return $KohaManualBaseURL . '/' . _get_help_version
. '/' . $KohaManualLanguage . '/html'; # TODO html could be a KohaManualFormat with pdf, html, epub
39 'about' => '/plugins.html#about-koha',
40 'acqui/acqui-home' => '/acquisitions.html',
41 'acqui/addorderiso2709' => '/acquisitions.html#create-a-basket',
42 'acqui/basket' => '/acquisitions.html#create-a-basket',
43 'acqui/basketgroup' => '/acquisitions.html#create-a-basket-group',
44 'acqui/basketheader' => '/acquisitions.html#create-a-basket',
45 'acqui/booksellers' => '/acquisitions.html#acquisition-searches',
46 'acqui/edifactmsgs' => '/acquisitions.html#edifact-messages',
47 'acqui/histsearch' => '/acquisitions.html#acquisition-searches',
48 'acqui/invoice' => '/acquisitions.html#invoices',
49 'acqui/invoices' => '/acquisitions.html#invoices',
50 'acqui/lateorders' => '/acquisitions.html#claims-late-orders',
51 'acqui/neworderbiblio' => '/acquisitions.html#create-a-basket',
52 'acqui/neworderempty' => '/acquisitions.html#create-a-basket',
53 'acqui/newordersubscription' => '/acquisitions.html#create-a-basket',
54 'acqui/newordersuggestion' => '/acquisitions.html#create-a-basket',
55 'acqui/orderreceive' => '/acquisitions.html#receiving-orders',
56 'acqui/parcel' => '/acquisitions.html#receiving-orders',
57 'acqui/parcels' => '/acquisitions.html#receiving-orders',
58 'acqui/supplier' => '/acquisitions.html#vendors',
59 'acqui/uncertainprice' => '/acquisitions.html#create-a-basket',
60 'acqui/z3950_search' => '/acquisitions.html#create-a-basket',
61 'admin/admin-home' => '/administration.html',
62 'admin/aqbudgetperiods' => '/administration.html#budgets',
63 'admin/aqbudgets' => '/administration.html#funds',
64 'admin/aqcontract' => '/acquisitions.html#vendor-contracts',
65 'admin/aqplan' => '/administration.html#budget-planning',
66 'admin/auth_subfields_structure' => '/administration.html#authority-types',
67 'admin/auth_tag_structure' => '/administration.html#authority-types',
68 'admin/authorised_values' => '/administration.html#authorized-values',
69 'admin/authtypes' => '/administration.html#authority-types',
70 'admin/biblio_framework' => '/administration.html#marc-bibliographic-frameworks',
71 'admin/branch_transfer_limits' => '/administration.html#library-transfer-limits',
72 'admin/branches' => '/administration.html#libraries-&-groups',
73 'admin/categorie' => '/administration.html#patron-categories',
74 'admin/checkmarc' => '/administration.html#marc-bibliographic-framework-test',
75 'admin/cities' => '/administration.html#cities-and-towns',
76 'admin/classsources' => '/administration.html#classification-sources',
77 'admin/columns_settings' => '/administration.html#column-settings',
78 'admin/currency' => '/administration.html#currencies-and-exchange-rates',
79 'admin/didyoumean' => '/administration.html#did-you-mean?',
80 'admin/edi_accounts' => '/administration.html#edi-accounts',
81 'admin/edi_ean_accounts' => '/administration.html#library-eans',
82 'admin/fieldmapping' => '/administration.html#keywords-to-marc-mapping',
83 'admin/item_circulation_alerts' => '/administration.html#item-circulation-alerts',
84 'admin/items_search_fields' => '/administration.html#item-search-fields',
85 'admin/itemtypes' => '/administration.html#item-types',
86 'admin/koha2marclinks' => '/administration.html#koha-to-marc-mapping',
87 'admin/marc_subfields_structure' => '/administration.html#marc-bibliographic-frameworks',
88 'admin/marctagstructure' => '/administration.html#marc-bibliographic-frameworks',
89 'admin/matching-rules' => '/administration.html#record-matching-rules',
90 'admin/oai_set_mappings' => '/administration.html#oai-sets-configuration',
91 'admin/oai_sets' => '/administration.html#oai-sets-configuration',
92 'admin/patron-attr-types' => '/administration.html#patron-attribute-types',
93 'admin/preferences' => '/systempreferences.html',
94 'admin/smart-rules' => '/administration.html#circulation-and-fine-rules',
95 'admin/sms_providers' => '/administration.html#sms-cellular-providers',
96 'admin/systempreferences' => '/systempreferences.html#local-use',
97 'admin/transport-cost-matrix' => '/administration.html#transport-cost-matrix',
98 'admin/z3950servers' => '/administration.html#z39.50/sru-servers',
99 'authorities/authorities-home' => '/cataloging.html#authorities',
100 'authorities/authorities' => '/cataloging.html#authorities',
101 'authorities/detail' => '/cataloging.html#authorities',
102 'authorities/merge' => '/cataloging.html#merging-authorities',
103 'catalogue/detail' => '/cataloging.html#bibliographic-records',
104 'catalogue/issuehistory' => '/cataloging.html#item-specific-circulation-history',
105 'catalogue/itemsearch' => '/searching.html#item-searching',
106 'catalogue/moredetail' => '/cataloging.html#item-records',
107 'catalogue/search-history' => '/plugins.html#search-history',
108 'catalogue/search' => '/searching.html',
109 'cataloguing/addbiblio' => '/cataloging.html#bibliographic-records',
110 'cataloguing/addbooks' => '/cataloging.html',
111 'cataloguing/additem' => '/cataloging.html#item-records',
112 'cataloguing/linkitem' => '/cataloging.html#adding-analytic-records',
113 'cataloguing/merge' => '/cataloging.html#merging-records',
114 'cataloguing/moveitem' => '/cataloging.html#moving-items',
115 'circ/article-requests' => '/circulation.html#article-requests',
116 'circ/branchoverdues' => '/circulation.html#overdues-with-fines',
117 'circ/branchtransfers' => '/circulation.html#transfers',
118 'circ/circulation-home' => '/circulation.html',
119 'circ/circulation' => '/circulation.html#check-out-(issuing)',
120 'circ/offline' => '/circulation.html#offline-circulation-in-koha',
121 'circ/on-site_checkouts' => '/circulation.html#pending-on-site-checkouts',
122 'circ/overdue' => '/circulation.html#overdues',
123 'circ/pendingreserves' => '/circulation.html#holds-to-pull',
124 'circ/renew' => '/circulation.html#renewing',
125 'circ/reserveratios' => '/circulation.html#hold-ratios',
126 'circ/returns' => '/circulation.html#check-in-returning',
127 'circ/selectbranchprinter' => '/circulation.html#set-library',
128 'circ/transferstoreceive' => '/circulation.html#transfers-to-receive',
129 'circ/view_holdsqueue' => '/circulation.html#holds-queue',
130 'circ/waitingreserves' => '/circulation.html#holds-awaiting-pickup',
131 'course_reserves/add_items' => '/course_reserves.html',
132 'course_reserves/course-details' => '/course_reserves.html',
133 'course_reserves/course-reserves' => '/course_reserves.html',
134 'course_reserves/course' => '/course_reserves.html#adding-courses',
135 'labels/label-edit-batch' => '/tools.html#batches',
136 'labels/label-edit-layout' => '/tools.html#layouts',
137 'labels/label-edit-profile' => '/tools.html#profiles',
138 'labels/label-edit-template' => '/tools.html#templates',
139 'labels/label-home' => '/tools.html#label-creator',
140 'labels/label-manage' => '/tools.html#layouts',
141 'labels/label-manage' => '/tools.html#templates',
142 'labels/label-manage' => '/tools.html#profiles',
143 'labels/label-manage' => '/tools.html#batches',
144 'labels/spinelabel-home' => '/tools.html#quick-spine-label-creator',
146 'members/apikeys' => '/webservices.html#api-key-management-interface-for-patrons',
147 'members/boraccount' => '/patrons.html#fines',
148 'members/discharge' => '/patrons.html#patron-discharges',
149 'members/files' => '/patrons.html#files',
150 'members/mancredit' => '/patrons.html#creating-manual-credits',
151 'members/maninvoice' => '/patrons.html#creating-manual-invoices',
152 'members/member-flags' => '/patrons.html#patron-permissions',
153 'members/member-password' => '/patrons.html#editing-patrons',
154 'members/member' => '/patrons.html#patron-search',
155 'members/memberentry' => '/patrons.html#add-a-new-patron',
156 'members/members-home' => '/patrons.html',
157 'members/members-update' => '/patrons.html#managing-patron-self-edits',
158 'members/moremember' => '/patrons.html#patron-information',
159 'members/notices' => '/patrons.html#notices',
160 'members/pay' => '/patrons.html#pay/reverse-fines',
161 'members/paycollect' => '/patrons.html#pay/reverse-fines',
162 'members/purchase-suggestions' => '/patrons.html#purchase-suggestions',
163 'members/readingrec' => '/patrons.html#circulation-history',
164 'members/routing-lists' => '/patrons.html#routing-lists',
165 'members/statistics' => '/patrons.html#statistics',
166 'offline_circ/list' => '/circulation.html#offline-circulation-utilities',
167 'offline_circ/process_koc' => '/circulation.html#upload-offline-circ-file',
168 'patron_lists/lists' => '/tools.html#patron-lists',
169 'patroncards/edit-batch' => '/tools.html#batches',
170 'patroncards/edit-layout' => '/tools.html#layouts',
171 'patroncards/edit-profile' => '/tools.html#profiles',
172 'patroncards/edit-template' => '/tools.html#templates',
173 'patroncards/home' => '/tools.html#patron-card-creator',
174 'patroncards/image-manage' => '/tools.html#manage-images',
175 'patroncards/manage' => '/tools.html#patron-card-creator',
176 'plugins/plugins-home' => '/plugins.html',
177 'plugins/plugins-upload' => '/plugins.html',
178 'reports/acquisitions_stats' => '/reports.html#acquisitions-statistics',
179 'reports/bor_issues_top' => '/reports.html#patrons-with-the-most-checkouts',
180 'reports/borrowers_out' => '/reports.html#patrons-with-no-checkouts',
181 'reports/borrowers_stats' => '/reports.html#patron-statistics',
182 'reports/cat_issues_top' => '/reports.html#most-circulated-items',
183 'reports/catalogue_out' => '/reports.html#items-with-no-checkouts',
184 'reports/catalogue_stats' => '/reports.html#catalog-statistics',
185 'reports/dictionary' => '/reports.html#report-dictionary',
186 'reports/guided_reports' => '/reports.html#custom-reports',
187 'reports/issues_avg_stats' => '/reports.html#average-loan-time',
188 'reports/issues_stats' => '/reports.html#circulation-statistics',
189 'reports/itemslost' => '/reports.html#lost-items',
190 'reports/manager' => '/reports.html#catalog-by-item-type',
191 'reports/reports-home' => '/reports.html',
192 'reports/reserves_stats' => '/reports.html#holds-statistics',
193 'reports/serials_stats' => '/reports.html#serials-statistics',
194 'reserve/request' => '/circulation.html#holds',
195 'reviews/reviewswaiting' => '/tools.html#comments',
196 'rotating_collections/rotatingCollections' => '/tools.html#rotating-collections',
197 'serials/checkexpiration' => '/serials.html#check-serial-expiration',
198 'serials/claims' => '/serials.html#claim-late-serials',
199 'serials/routing' => '/serials.html#create-a-routing-list',
200 'serials/serials-collection' => '/serials.html',
201 'serials/serials-edit' => '/serials.html#receive-issues',
202 'serials/serials-home' => '/serials.html',
203 'serials/subscription-add' => '/serials.html#add-a-subscription',
204 'serials/subscription-detail' => '/serials.html',
205 'serials/subscription-frequencies' => '/serials.html#manage-serial-frequencies',
206 'serials/subscription-numberpatterns' => '/serials.html#manage-serial-numbering-patterns',
207 'suggestion/suggestion' => '/acquisitions.html#managing-suggestions',
208 'tags/list' => '/tools.html#tag-moderation',
209 'tags/review' => '/tools.html#tag-moderation',
210 'tools/batchMod' => '/tools.html#batch-item-deletion',
211 'tools/batch_delete_records' => '/tools.html#batch-record-deletion',
212 'tools/batch_record_modification' => '/tools.html#batch-record-modification',
213 'tools/cleanborrowers' => '/tools.html#patrons-anonymize-bulk-delete',
214 'tools/csv-profiles' => '/tools.html#csv-profiles',
215 'tools/export' => '/tools.html#export-bibliographic-records',
216 'tools/holidays' => '/tools.html#calendar',
217 'tools/import_borrowers' => '/tools.html#patron-import',
218 'tools/inventory' => '/tools.html#inventory-stocktaking',
219 'tools/koha-news' => '/tools.html#news',
220 'tools/letter' => '/tools.html#notices-slips',
221 'tools/manage-marc-import' => '/tools.html#staged-marc-record-management',
222 'tools/marc_modification_templates' => '/tools.html#marc-modification-templates',
223 'tools/modborrowers' => '/tools.html#batch-patron-modification',
224 'tools/overduerules' => '/tools.html#overdue-notice-status-triggers',
225 'tools/picture-upload' => '/tools.html#upload-patron-images',
226 'tools/quotes-upload' => '/tools.html#import-quotes',
227 'tools/quotes' => '/tools.html#quote-of-the-day-(qotd)-editor',
228 'tools/scheduler' => '/tools.html#task-scheduler',
229 'tools/stage-marc-import' => '/tools.html#stage-marc-records-for-import',
230 'tools/tools-home' => '/tools.html',
231 'tools/upload-cover-image' => '/tools.html#upload-local-cover-image',
232 'tools/viewlog' => '/tools.html#log-viewer',
233 'virtualshelves/shelves' => '/lists.html#lists',
237 my ( $url, $preferred_language ) = @_;
239 if ($url =~ /koha\/(.*)\
.pl
/) {
244 $file =~ s/[^a-zA-Z0-9_\-\/]*//g
;
246 my $base_url = _get_base_url
( $preferred_language );
247 return $base_url . ( exists $mapping->{$file} ?
$mapping->{$file} : $mapping->{mainpage
} );