Lines 19-118
import LicensesList from "../components/ERM/LicensesList.vue";
Link Here
|
19 |
import LicensesShow from "../components/ERM/LicensesShow.vue"; |
19 |
import LicensesShow from "../components/ERM/LicensesShow.vue"; |
20 |
import LicensesFormAdd from "../components/ERM/LicensesFormAdd.vue"; |
20 |
import LicensesFormAdd from "../components/ERM/LicensesFormAdd.vue"; |
21 |
|
21 |
|
22 |
const breadcrumbs = { |
|
|
23 |
home: { |
24 |
text: "Home", // $t("Home") |
25 |
path: "/cgi-bin/koha/mainpage.pl", |
26 |
}, |
27 |
erm_home: { |
28 |
text: "E-resource management", // $t("E-resource management") |
29 |
path: "/cgi-bin/koha/erm/erm.pl", |
30 |
}, |
31 |
agreements: { |
32 |
text: "Agreements", // $t("Agreements") |
33 |
path: "/cgi-bin/koha/erm/agreements", |
34 |
}, |
35 |
eholdings: { |
36 |
home: { |
37 |
text: "eHoldings", // $t("eHoldings") |
38 |
}, |
39 |
local: { |
40 |
home: { |
41 |
text: "Local", // $t("Local") |
42 |
}, |
43 |
titles: { |
44 |
text: "Titles", // $t("Titles") |
45 |
path: "/cgi-bin/koha/erm/eholdings/local/titles", |
46 |
}, |
47 |
packages: { |
48 |
text: "Packages", // $t("Packages") |
49 |
path: "/cgi-bin/koha/erm/eholdings/local/packages", |
50 |
}, |
51 |
}, |
52 |
ebsco: { |
53 |
home: { |
54 |
text: "EBSCO", // $t("EBSCO") |
55 |
}, |
56 |
titles: { |
57 |
text: "Titles", // $t("Titles") |
58 |
path: "/cgi-bin/koha/erm/eholdings/ebsco/titles", |
59 |
}, |
60 |
packages: { |
61 |
text: "Packages", // $t("Packages") |
62 |
path: "/cgi-bin/koha/erm/eholdings/ebsco/packages", |
63 |
}, |
64 |
}, |
65 |
}, |
66 |
licenses: { |
67 |
text: "Licenses", // $t("Licenses") |
68 |
path: "/cgi-bin/koha/erm/licenses", |
69 |
}, |
70 |
}; |
71 |
const breadcrumb_paths = { |
72 |
agreements: [ |
73 |
breadcrumbs.home, |
74 |
breadcrumbs.erm_home, |
75 |
breadcrumbs.agreements, |
76 |
], |
77 |
eholdings: [ |
78 |
breadcrumbs.home, |
79 |
breadcrumbs.erm_home, |
80 |
breadcrumbs.eholdings.home, |
81 |
], |
82 |
eholdings_local: [ |
83 |
breadcrumbs.home, |
84 |
breadcrumbs.erm_home, |
85 |
breadcrumbs.eholdings.home, |
86 |
breadcrumbs.eholdings.local.home, |
87 |
], |
88 |
eholdings_ebsco: [ |
89 |
breadcrumbs.home, |
90 |
breadcrumbs.erm_home, |
91 |
breadcrumbs.eholdings.home, |
92 |
breadcrumbs.eholdings.ebsco.home, |
93 |
], |
94 |
licenses: [breadcrumbs.home, breadcrumbs.erm_home, breadcrumbs.licenses], |
95 |
}; |
96 |
|
97 |
function build_breadcrumb(parent_breadcrumb, current) { |
98 |
let breadcrumb = parent_breadcrumb.flat(Infinity); |
99 |
if (current) { |
100 |
breadcrumb.push({ |
101 |
text: current, |
102 |
}); |
103 |
} |
104 |
return breadcrumb; |
105 |
} |
106 |
|
107 |
export const routes = [ |
22 |
export const routes = [ |
108 |
{ |
|
|
109 |
path: "/cgi-bin/koha/mainpage.pl", |
110 |
beforeEnter(to, from, next) { |
111 |
window.location.href = "/cgi-bin/koha/mainpage.pl"; |
112 |
}, |
113 |
}, |
114 |
{ |
23 |
{ |
115 |
path: "/cgi-bin/koha/admin/background_jobs/:id", |
24 |
path: "/cgi-bin/koha/admin/background_jobs/:id", |
|
|
25 |
is_base: true, |
116 |
beforeEnter(to, from, next) { |
26 |
beforeEnter(to, from, next) { |
117 |
window.location.href = |
27 |
window.location.href = |
118 |
"/cgi-bin/koha/admin/background_jobs.pl?op=view&id=" + |
28 |
"/cgi-bin/koha/admin/background_jobs.pl?op=view&id=" + |
Lines 121-484
export const routes = [
Link Here
|
121 |
}, |
31 |
}, |
122 |
{ |
32 |
{ |
123 |
path: "/cgi-bin/koha/erm/erm.pl", |
33 |
path: "/cgi-bin/koha/erm/erm.pl", |
124 |
component: Home, |
34 |
component: {template: '<router-view />'}, |
125 |
meta: { |
35 |
is_default: true, |
126 |
breadcrumb: () => [breadcrumbs.home, breadcrumbs.erm_home], |
36 |
is_base: true, |
127 |
}, |
37 |
title: 'E-resource management', |
128 |
}, |
|
|
129 |
{ |
130 |
path: "/cgi-bin/koha/erm/agreements", |
131 |
children: [ |
38 |
children: [ |
132 |
{ |
39 |
{ |
133 |
path: "", |
40 |
path: "", |
134 |
component: AgreementsList, |
41 |
component: Home, |
135 |
meta: { |
42 |
is_navigation_item: false, |
136 |
breadcrumb: () => breadcrumb_paths.agreements, |
|
|
137 |
}, |
138 |
}, |
43 |
}, |
139 |
{ |
44 |
{ |
140 |
path: ":agreement_id", |
45 |
path: "/cgi-bin/koha/erm/agreements", |
141 |
component: AgreementsShow, |
46 |
title: 'Agreements', |
142 |
meta: { |
47 |
icon: 'fa-check-circle-o', |
143 |
breadcrumb: () => |
48 |
is_end_node: true, |
144 |
build_breadcrumb( |
|
|
145 |
breadcrumb_paths.agreements, |
146 |
"Show agreement" // $t("Show agreement") |
147 |
), |
148 |
}, |
149 |
}, |
150 |
{ |
151 |
path: "add", |
152 |
component: AgreementsFormAdd, |
153 |
meta: { |
154 |
breadcrumb: () => |
155 |
build_breadcrumb( |
156 |
breadcrumb_paths.agreements, |
157 |
"Add agreement" // $t("Add agreement") |
158 |
), |
159 |
}, |
160 |
}, |
161 |
{ |
162 |
path: "edit/:agreement_id", |
163 |
component: AgreementsFormAdd, |
164 |
meta: { |
165 |
breadcrumb: () => |
166 |
build_breadcrumb( |
167 |
breadcrumb_paths.agreements, |
168 |
"Edit agreement" // $t("Edit agreement") |
169 |
), |
170 |
}, |
171 |
}, |
172 |
], |
173 |
}, |
174 |
{ |
175 |
path: "/cgi-bin/koha/erm/eholdings", |
176 |
meta: { |
177 |
breadcrumb: () => breadcrumb_paths.eholdings, |
178 |
}, |
179 |
children: [ |
180 |
{ |
181 |
path: "", |
182 |
meta: { |
183 |
breadcrumb: () => breadcrumb_paths.eholdings, |
184 |
}, |
185 |
}, |
186 |
{ |
187 |
path: "local", |
188 |
children: [ |
49 |
children: [ |
189 |
{ |
50 |
{ |
190 |
path: "", |
51 |
path: "", |
191 |
meta: { |
52 |
component: AgreementsList, |
192 |
breadcrumb: () => breadcrumb_paths.eholdings_local, |
|
|
193 |
}, |
194 |
}, |
53 |
}, |
195 |
{ |
54 |
{ |
196 |
path: "packages", |
55 |
path: ":agreement_id", |
197 |
children: [ |
56 |
component: AgreementsShow, |
198 |
{ |
57 |
title: "Show agreement", |
199 |
path: "", |
|
|
200 |
component: EHoldingsLocalPackagesList, |
201 |
meta: { |
202 |
breadcrumb: () => |
203 |
build_breadcrumb([ |
204 |
breadcrumb_paths.eholdings_local, |
205 |
breadcrumbs.eholdings.local |
206 |
.packages, |
207 |
]), |
208 |
}, |
209 |
}, |
210 |
{ |
211 |
path: ":package_id", |
212 |
component: EHoldingsLocalPackagesShow, |
213 |
meta: { |
214 |
breadcrumb: () => |
215 |
build_breadcrumb( |
216 |
[ |
217 |
breadcrumb_paths.eholdings_local, |
218 |
breadcrumbs.eholdings.local |
219 |
.packages, |
220 |
], |
221 |
"Show package" // $t("Show package") |
222 |
), |
223 |
}, |
224 |
}, |
225 |
{ |
226 |
path: "add", |
227 |
component: EHoldingsLocalPackagesFormAdd, |
228 |
meta: { |
229 |
breadcrumb: () => |
230 |
build_breadcrumb( |
231 |
[ |
232 |
breadcrumb_paths.eholdings_local, |
233 |
breadcrumbs.eholdings.local |
234 |
.packages, |
235 |
], |
236 |
"Add package" // $t("Add package") |
237 |
), |
238 |
}, |
239 |
}, |
240 |
{ |
241 |
path: "edit/:package_id", |
242 |
component: EHoldingsLocalPackagesFormAdd, |
243 |
meta: { |
244 |
breadcrumb: () => |
245 |
build_breadcrumb( |
246 |
[ |
247 |
breadcrumb_paths.eholdings_local, |
248 |
breadcrumbs.eholdings.local |
249 |
.packages, |
250 |
], |
251 |
"Edit package" // $t("Edit package") |
252 |
), |
253 |
}, |
254 |
}, |
255 |
], |
256 |
}, |
58 |
}, |
257 |
{ |
59 |
{ |
258 |
path: "titles", |
60 |
path: "add", |
259 |
children: [ |
61 |
component: AgreementsFormAdd, |
260 |
{ |
62 |
title: "Add agreement", |
261 |
path: "", |
|
|
262 |
component: EHoldingsLocalTitlesList, |
263 |
meta: { |
264 |
breadcrumb: () => |
265 |
build_breadcrumb([ |
266 |
breadcrumb_paths.eholdings_local, |
267 |
breadcrumbs.eholdings.local.titles, |
268 |
]), |
269 |
}, |
270 |
}, |
271 |
{ |
272 |
path: ":title_id", |
273 |
component: EHoldingsLocalTitlesShow, |
274 |
meta: { |
275 |
breadcrumb: () => |
276 |
build_breadcrumb( |
277 |
[ |
278 |
breadcrumb_paths.eholdings_local, |
279 |
breadcrumbs.eholdings.local |
280 |
.titles, |
281 |
], |
282 |
"Show title" // $t("Show title") |
283 |
), |
284 |
}, |
285 |
}, |
286 |
{ |
287 |
path: "add", |
288 |
component: EHoldingsLocalTitlesFormAdd, |
289 |
meta: { |
290 |
breadcrumb: () => |
291 |
build_breadcrumb( |
292 |
[ |
293 |
breadcrumb_paths.eholdings_local, |
294 |
breadcrumbs.eholdings.local |
295 |
.titles, |
296 |
], |
297 |
"Add title" // $t("Add title") |
298 |
), |
299 |
}, |
300 |
}, |
301 |
{ |
302 |
path: "edit/:title_id", |
303 |
component: EHoldingsLocalTitlesFormAdd, |
304 |
meta: { |
305 |
breadcrumb: () => |
306 |
build_breadcrumb( |
307 |
[ |
308 |
breadcrumb_paths.eholdings_local, |
309 |
breadcrumbs.eholdings.local |
310 |
.titles, |
311 |
], |
312 |
"Edit title" // $t("Edit title") |
313 |
), |
314 |
}, |
315 |
}, |
316 |
{ |
317 |
path: "import", |
318 |
component: EHoldingsLocalTitlesFormImport, |
319 |
meta: { |
320 |
breadcrumb: () => |
321 |
build_breadcrumb( |
322 |
[ |
323 |
breadcrumb_paths.eholdings_local, |
324 |
breadcrumbs.eholdings.local |
325 |
.titles, |
326 |
], |
327 |
"Import from a list" // $t("Import from a list") |
328 |
), |
329 |
}, |
330 |
}, |
331 |
], |
332 |
}, |
63 |
}, |
333 |
{ |
64 |
{ |
334 |
path: "resources/:resource_id", |
65 |
path: "edit/:agreement_id", |
335 |
component: EHoldingsLocalResourcesShow, |
66 |
component: AgreementsFormAdd, |
336 |
meta: { |
67 |
title: "Edit agreement", |
337 |
breadcrumb: () => |
|
|
338 |
build_breadcrumb( |
339 |
[ |
340 |
breadcrumb_paths.eholdings_local, |
341 |
breadcrumbs.eholdings.local.titles, |
342 |
], |
343 |
"Resource" // $t("Resource") |
344 |
), |
345 |
}, |
346 |
}, |
68 |
}, |
347 |
], |
69 |
], |
348 |
}, |
70 |
}, |
349 |
{ |
71 |
{ |
350 |
path: "ebsco", |
72 |
path: "/cgi-bin/koha/erm/licenses", |
|
|
73 |
title: "Licenses", |
74 |
icon: "fa-gavel", |
75 |
is_end_node: true, |
351 |
children: [ |
76 |
children: [ |
352 |
{ |
77 |
{ |
353 |
path: "", |
78 |
path: "", |
354 |
meta: { |
79 |
component: LicensesList, |
355 |
breadcrumb: () => breadcrumb_paths.eholdings_ebsco, |
80 |
}, |
356 |
}, |
81 |
{ |
|
|
82 |
path: ":license_id", |
83 |
component: LicensesShow, |
84 |
title: "Show license", |
85 |
}, |
86 |
{ |
87 |
path: "add", |
88 |
component: LicensesFormAdd, |
89 |
title: "Add license", |
357 |
}, |
90 |
}, |
358 |
{ |
91 |
{ |
359 |
path: "packages", |
92 |
path: "edit/:license_id", |
|
|
93 |
component: LicensesFormAdd, |
94 |
title: "Edit license", |
95 |
}, |
96 |
], |
97 |
}, |
98 |
{ |
99 |
path: "/cgi-bin/koha/erm/eholdings", |
100 |
title: "eHoldings", |
101 |
icon: 'fa-crosshairs', |
102 |
disabled: true, |
103 |
children: [ |
104 |
{ |
105 |
path: "local", |
106 |
title: "Local", |
107 |
icon: "fa-map-marker", |
108 |
disabled: true, |
360 |
children: [ |
109 |
children: [ |
361 |
{ |
110 |
{ |
362 |
path: "", |
111 |
path: "packages", |
363 |
component: EHoldingsEBSCOPackagesList, |
112 |
title: "Packages", |
364 |
meta: { |
113 |
icon: "fa-archive", |
365 |
breadcrumb: () => |
114 |
is_end_node: true, |
366 |
build_breadcrumb([ |
115 |
children: [ |
367 |
breadcrumb_paths.eholdings_ebsco, |
116 |
{ |
368 |
breadcrumbs.eholdings.ebsco |
117 |
path: "", |
369 |
.packages, |
118 |
component: EHoldingsLocalPackagesList, |
370 |
]), |
119 |
}, |
371 |
}, |
120 |
{ |
|
|
121 |
path: ":package_id", |
122 |
component: EHoldingsLocalPackagesShow, |
123 |
title: "Show package", |
124 |
}, |
125 |
{ |
126 |
path: "add", |
127 |
component: EHoldingsLocalPackagesFormAdd, |
128 |
title: "Add package", |
129 |
}, |
130 |
{ |
131 |
path: "edit/:package_id", |
132 |
component: EHoldingsLocalPackagesFormAdd, |
133 |
title: "Edit package", |
134 |
}, |
135 |
], |
372 |
}, |
136 |
}, |
373 |
{ |
137 |
{ |
374 |
path: ":package_id", |
138 |
path: "titles", |
375 |
component: EHoldingsEBSCOPackagesShow, |
139 |
title: "Titles", |
376 |
meta: { |
140 |
icon: "fa-sort-alpha-asc", |
377 |
breadcrumb: () => |
141 |
is_end_node: true, |
378 |
build_breadcrumb( |
142 |
children: [ |
379 |
[ |
143 |
{ |
380 |
breadcrumb_paths.eholdings_ebsco, |
144 |
path: "", |
381 |
breadcrumbs.eholdings.ebsco |
145 |
component: EHoldingsLocalTitlesList, |
382 |
.packages, |
146 |
}, |
383 |
], |
147 |
{ |
384 |
"Show package" // $t("Show package") |
148 |
path: ":title_id", |
385 |
), |
149 |
component: EHoldingsLocalTitlesShow, |
386 |
}, |
150 |
title: "Show title", |
|
|
151 |
}, |
152 |
{ |
153 |
path: "add", |
154 |
component: EHoldingsLocalTitlesFormAdd, |
155 |
title: "Add title", |
156 |
}, |
157 |
{ |
158 |
path: "edit/:title_id", |
159 |
component: EHoldingsLocalTitlesFormAdd, |
160 |
title: "Edit title", |
161 |
}, |
162 |
{ |
163 |
path: "import", |
164 |
component: EHoldingsLocalTitlesFormImport, |
165 |
title: "Import from a list", |
166 |
}, |
167 |
{ |
168 |
path: "/cgi-bin/koha/erm/eholdings/local/resources/:resource_id", |
169 |
component: EHoldingsLocalResourcesShow, |
170 |
title: "Resource", |
171 |
}, |
172 |
], |
387 |
}, |
173 |
}, |
388 |
], |
174 |
], |
389 |
}, |
175 |
}, |
390 |
{ |
176 |
{ |
391 |
path: "titles", |
177 |
path: "ebsco", |
|
|
178 |
title: "EBSCO", |
179 |
icon: 'fa-globe', |
180 |
disabled: true, |
392 |
children: [ |
181 |
children: [ |
393 |
{ |
182 |
{ |
394 |
path: "", |
183 |
path: "packages", |
395 |
component: EHoldingsEBSCOTitlesList, |
184 |
title: "Packages", |
396 |
meta: { |
185 |
icon: "fa-archive", |
397 |
breadcrumb: () => |
186 |
is_end_node: true, |
398 |
build_breadcrumb([ |
187 |
children: [ |
399 |
breadcrumb_paths.eholdings_ebsco, |
188 |
{ |
400 |
breadcrumbs.eholdings.ebsco.titles, |
189 |
path: "", |
401 |
]), |
190 |
component: EHoldingsEBSCOPackagesList, |
402 |
}, |
191 |
}, |
|
|
192 |
{ |
193 |
path: ":package_id", |
194 |
component: EHoldingsEBSCOPackagesShow, |
195 |
title: "Show package", |
196 |
}, |
197 |
], |
403 |
}, |
198 |
}, |
404 |
{ |
199 |
{ |
405 |
path: ":title_id", |
200 |
path: "titles", |
406 |
component: EHoldingsEBSCOTitlesShow, |
201 |
title: "Titles", |
407 |
meta: { |
202 |
icon: "fa-sort-alpha-asc", |
408 |
breadcrumb: () => |
203 |
is_end_node: true, |
409 |
build_breadcrumb( |
204 |
children: [ |
410 |
[ |
205 |
{ |
411 |
breadcrumb_paths.eholdings_ebsco, |
206 |
path: "", |
412 |
breadcrumbs.eholdings.ebsco |
207 |
component: EHoldingsEBSCOTitlesList, |
413 |
.titles, |
208 |
}, |
414 |
], |
209 |
{ |
415 |
"Show title" // $t("Show title") |
210 |
path: ":title_id", |
416 |
), |
211 |
component: EHoldingsEBSCOTitlesShow, |
417 |
}, |
212 |
title: "Show title", |
|
|
213 |
}, |
214 |
{ |
215 |
path: "/cgi-bin/koha/erm/eholdings/ebsco/resources/:resource_id", |
216 |
component: EHoldingsEBSCOResourcesShow, |
217 |
title: "Resource", |
218 |
is_navigation_item: false, |
219 |
}, |
220 |
], |
418 |
}, |
221 |
}, |
419 |
], |
222 |
], |
420 |
}, |
223 |
}, |
421 |
{ |
|
|
422 |
path: "resources/:resource_id", |
423 |
component: EHoldingsEBSCOResourcesShow, |
424 |
meta: { |
425 |
breadcrumb: () => |
426 |
build_breadcrumb( |
427 |
[ |
428 |
breadcrumb_paths.eholdings_ebsco, |
429 |
breadcrumbs.eholdings.ebsco.titles, |
430 |
], |
431 |
"Resource" // $t("Resource") |
432 |
), |
433 |
}, |
434 |
}, |
435 |
], |
224 |
], |
436 |
}, |
225 |
}, |
437 |
], |
226 |
] |
438 |
}, |
|
|
439 |
{ |
440 |
path: "/cgi-bin/koha/erm/licenses", |
441 |
children: [ |
442 |
{ |
443 |
path: "", |
444 |
component: LicensesList, |
445 |
meta: { |
446 |
breadcrumb: () => breadcrumb_paths.licenses, |
447 |
}, |
448 |
}, |
449 |
{ |
450 |
path: ":license_id", |
451 |
component: LicensesShow, |
452 |
meta: { |
453 |
breadcrumb: () => |
454 |
build_breadcrumb( |
455 |
breadcrumb_paths.licenses, |
456 |
"Show license" // $t("Show license") |
457 |
), |
458 |
}, |
459 |
}, |
460 |
{ |
461 |
path: "add", |
462 |
component: LicensesFormAdd, |
463 |
meta: { |
464 |
breadcrumb: () => |
465 |
build_breadcrumb( |
466 |
breadcrumb_paths.licenses, |
467 |
"Add license" // $t("Add license") |
468 |
), |
469 |
}, |
470 |
}, |
471 |
{ |
472 |
path: "edit/:license_id", |
473 |
component: LicensesFormAdd, |
474 |
meta: { |
475 |
breadcrumb: () => |
476 |
build_breadcrumb( |
477 |
breadcrumb_paths.licenses, |
478 |
"Edit license" // $t("Edit license") |
479 |
), |
480 |
}, |
481 |
}, |
482 |
], |
483 |
}, |
227 |
}, |
484 |
]; |
228 |
]; |