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_BZ 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/systempreferences' => '/systempreferences.html#local-use',
96 'admin/transport-cost-matrix' => '/administration.html#transport-cost-matrix',
97 'admin/z3950servers' => '/administration.html#z39.50/sru-servers',
98 'authorities/authorities-home' => '/cataloging.html#authorities',
99 'authorities/authorities' => '/cataloging.html#authorities',
100 'authorities/detail' => '/cataloging.html#authorities',
101 'authorities/merge' => '/cataloging.html#merging-authorities',
102 'catalogue/detail' => '/cataloging.html#bibliographic-records',
103 'catalogue/issuehistory' => '/cataloging.html#item-specific-circulation-history',
104 'catalogue/itemsearch' => '/searching.html#item-searching',
105 'catalogue/moredetail' => '/cataloging.html#item-records',
106 'catalogue/search-history' => '/plugins.html#search-history',
107 'catalogue/search' => '/searching.html',
108 'cataloguing/addbiblio' => '/cataloging.html#bibliographic-records',
109 'cataloguing/addbooks' => '/cataloging.html',
110 'cataloguing/additem' => '/cataloging.html#item-records',
111 'cataloguing/linkitem' => '/cataloging.html#adding-analytic-records',
112 'cataloguing/merge' => '/cataloging.html#merging-records',
113 'cataloguing/moveitem' => '/cataloging.html#moving-items',
114 'circ/branchoverdues' => '/circulation.html#overdues-with-fines',
115 'circ/branchtransfers' => '/circulation.html#transfers',
116 'circ/circulation-home' => '/circulation.html',
117 'circ/circulation' => '/circulation.html#check-out-(issuing)',
118 'circ/offline' => '/circulation.html#offline-circulation-in-koha',
119 'circ/on-site_checkouts' => '/circulation.html#pending-on-site-checkouts',
120 'circ/overdue' => '/circulation.html#overdues',
121 'circ/pendingreserves' => '/circulation.html#holds-to-pull',
122 'circ/renew' => '/circulation.html#renewing',
123 'circ/reserveratios' => '/circulation.html#hold-ratios',
124 'circ/returns' => '/circulation.html#check-in-returning',
125 'circ/selectbranchprinter' => '/circulation.html#set-library',
126 'circ/transferstoreceive' => '/circulation.html#transfers-to-receive',
127 'circ/view_holdsqueue' => '/circulation.html#holds-queue',
128 'circ/waitingreserves' => '/circulation.html#holds-awaiting-pickup',
129 'course_reserves/add_items' => '/course_reserves.html',
130 'course_reserves/course-details' => '/course_reserves.html',
131 'course_reserves/course-reserves' => '/course_reserves.html',
132 'course_reserves/course' => '/course_reserves.html#adding-courses',
133 'labels/label-edit-batch' => '/tools.html#batches',
134 'labels/label-edit-layout' => '/tools.html#layouts',
135 'labels/label-edit-profile' => '/tools.html#profiles',
136 'labels/label-edit-template' => '/tools.html#templates',
137 'labels/label-home' => '/tools.html#label-creator',
138 'labels/label-manage' => '/tools.html#layouts',
139 'labels/label-manage' => '/tools.html#templates',
140 'labels/label-manage' => '/tools.html#profiles',
141 'labels/label-manage' => '/tools.html#batches',
142 'labels/spinelabel-home' => '/tools.html#quick-spine-label-creator',
144 'members/boraccount' => '/patrons.html#fines',
145 'members/discharge' => '/patrons.html#patron-discharges',
146 'members/files' => '/patrons.html#files',
147 'members/mancredit' => '/patrons.html#creating-manual-credits',
148 'members/maninvoice' => '/patrons.html#creating-manual-invoices',
149 'members/member-flags' => '/patrons.html#patron-permissions',
150 'members/member-password' => '/patrons.html#editing-patrons',
151 'members/member' => '/patrons.html#patron-search',
152 'members/memberentry' => '/patrons.html#add-a-new-patron',
153 'members/members-home' => '/patrons.html',
154 'members/members-update' => '/patrons.html#managing-patron-self-edits',
155 'members/moremember' => '/patrons.html#patron-information',
156 'members/notices' => '/patrons.html#notices',
157 'members/pay' => '/patrons.html#pay/reverse-fines',
158 'members/paycollect' => '/patrons.html#pay/reverse-fines',
159 'members/purchase-suggestions' => '/patrons.html#purchase-suggestions',
160 'members/readingrec' => '/patrons.html#circulation-history',
161 'members/routing-lists' => '/patrons.html#routing-lists',
162 'members/statistics' => '/patrons.html#statistics',
163 'offline_circ/list' => '/circulation.html#offline-circulation-utilities',
164 'offline_circ/process_koc' => '/circulation.html#upload-offline-circ-file',
165 'patron_lists/lists' => '/tools.html#patron-lists',
166 'patroncards/edit-batch' => '/tools.html#batches',
167 'patroncards/edit-layout' => '/tools.html#layouts',
168 'patroncards/edit-profile' => '/tools.html#profiles',
169 'patroncards/edit-template' => '/tools.html#templates',
170 'patroncards/home' => '/tools.html#patron-card-creator',
171 'patroncards/image-manage' => '/tools.html#manage-images',
172 'patroncards/manage' => '/tools.html#patron-card-creator',
173 'plugins/plugins-home' => '/plugins.html',
174 'plugins/plugins-upload' => '/plugins.html',
175 'reports/acquisitions_stats' => '/reports.html#acquisitions-statistics',
176 'reports/bor_issues_top' => '/reports.html#patrons-with-the-most-checkouts',
177 'reports/borrowers_out' => '/reports.html#patrons-with-no-checkouts',
178 'reports/borrowers_stats' => '/reports.html#patron-statistics',
179 'reports/cat_issues_top' => '/reports.html#most-circulated-items',
180 'reports/catalogue_out' => '/reports.html#items-with-no-checkouts',
181 'reports/catalogue_stats' => '/reports.html#catalog-statistics',
182 'reports/dictionary' => '/reports.html#report-dictionary',
183 'reports/guided_reports' => '/reports.html#custom-reports',
184 'reports/issues_avg_stats' => '/reports.html#average-loan-time',
185 'reports/issues_stats' => '/reports.html#circulation-statistics',
186 'reports/itemslost' => '/reports.html#lost-items',
187 'reports/manager' => '/reports.html#catalog-by-item-type',
188 'reports/reports-home' => '/reports.html',
189 'reports/reserves_stats' => '/reports.html#holds-statistics',
190 'reports/serials_stats' => '/reports.html#serials-statistics',
191 'reserve/request' => '/circulation.html#holds',
192 'reviews/reviewswaiting' => '/tools.html#comments',
193 'rotating_collections/rotatingCollections' => '/tools.html#rotating-collections',
194 'serials/checkexpiration' => '/serials.html#check-serial-expiration',
195 'serials/claims' => '/serials.html#claim-late-serials',
196 'serials/routing' => '/serials.html#create-a-routing-list',
197 'serials/serials-collection' => '/serials.html',
198 'serials/serials-edit' => '/serials.html#receive-issues',
199 'serials/serials-home' => '/serials.html',
200 'serials/subscription-add' => '/serials.html#add-a-subscription',
201 'serials/subscription-detail' => '/serials.html',
202 'serials/subscription-frequencies' => '/serials.html#manage-serial-frequencies',
203 'serials/subscription-numberpatterns' => '/serials.html#manage-serial-numbering-patterns',
204 'suggestion/suggestion' => '/acquisitions.html#managing-suggestions',
205 'tags/list' => '/tools.html#tag-moderation',
206 'tags/review' => '/tools.html#tag-moderation',
207 'tools/batchMod' => '/tools.html#batch-item-deletion',
208 'tools/batch_delete_records' => '/tools.html#batch-record-deletion',
209 'tools/batch_record_modification' => '/tools.html#batch-record-modification',
210 'tools/cleanborrowers' => '/tools.html#patrons-anonymize-bulk-delete',
211 'tools/csv-profiles' => '/tools.html#csv-profiles',
212 'tools/export' => '/tools.html#export-bibliographic-records',
213 'tools/holidays' => '/tools.html#calendar',
214 'tools/import_borrowers' => '/tools.html#patron-import',
215 'tools/inventory' => '/tools.html#inventory-stocktaking',
216 'tools/koha-news' => '/tools.html#news',
217 'tools/letter' => '/tools.html#notices-slips',
218 'tools/manage-marc-import' => '/tools.html#staged-marc-record-management',
219 'tools/marc_modification_templates' => '/tools.html#marc-modification-templates',
220 'tools/modborrowers' => '/tools.html#batch-patron-modification',
221 'tools/overduerules' => '/tools.html#overdue-notice-status-triggers',
222 'tools/picture-upload' => '/tools.html#upload-patron-images',
223 'tools/quotes-upload' => '/tools.html#import-quotes',
224 'tools/quotes' => '/tools.html#quote-of-the-day-(qotd)-editor',
225 'tools/scheduler' => '/tools.html#task-scheduler',
226 'tools/stage-marc-import' => '/tools.html#stage-marc-records-for-import',
227 'tools/tools-home' => '/tools.html',
228 'tools/upload-cover-image' => '/tools.html#upload-local-cover-image',
229 'tools/viewlog' => '/tools.html#log-viewer',
230 'virtualshelves/shelves' => '/lists.html#lists',
234 my ( $url, $preferred_language ) = @_;
236 if ($url =~ /koha\/(.*)\
.pl
/) {
241 $file =~ s/[^a-zA-Z0-9_\-\/]*//g
;
243 my $base_url = _get_base_url
( $preferred_language );
244 return $base_url . ( exists $mapping->{$file} ?
$mapping->{$file} : $mapping->{mainpage
} );