Lines 1-5
Link Here
|
1 |
<template> |
1 |
<template> |
2 |
<div v-if="initialized && PreservationModule == 1"> |
2 |
<div v-if="initialized && config.settings.enabled == 1"> |
3 |
<div id="sub-header"> |
3 |
<div id="sub-header"> |
4 |
<Breadcrumbs /> |
4 |
<Breadcrumbs /> |
5 |
<Help /> |
5 |
<Help /> |
Lines 32-37
import LeftMenu from "../LeftMenu.vue"
Link Here
|
32 |
import Dialog from "../Dialog.vue" |
32 |
import Dialog from "../Dialog.vue" |
33 |
import { APIClient } from "../../fetch/api-client.js" |
33 |
import { APIClient } from "../../fetch/api-client.js" |
34 |
import "vue-select/dist/vue-select.css" |
34 |
import "vue-select/dist/vue-select.css" |
|
|
35 |
import { storeToRefs } from "pinia" |
35 |
|
36 |
|
36 |
export default { |
37 |
export default { |
37 |
setup() { |
38 |
setup() { |
Lines 42-103
export default {
Link Here
|
42 |
const { loading, loaded, setError } = mainStore |
43 |
const { loading, loaded, setError } = mainStore |
43 |
|
44 |
|
44 |
const PreservationStore = inject("PreservationStore") |
45 |
const PreservationStore = inject("PreservationStore") |
|
|
46 |
|
47 |
const { config } = storeToRefs(PreservationStore) |
48 |
|
45 |
return { |
49 |
return { |
46 |
AVStore, |
50 |
AVStore, |
47 |
loading, |
51 |
loading, |
48 |
loaded, |
52 |
loaded, |
|
|
53 |
config, |
49 |
setError, |
54 |
setError, |
50 |
PreservationStore, |
|
|
51 |
} |
55 |
} |
52 |
}, |
56 |
}, |
53 |
data() { |
57 |
data() { |
54 |
return { |
58 |
return { |
55 |
initialized: false, |
59 |
initialized: false, |
56 |
PreservationModule: null, |
|
|
57 |
} |
60 |
} |
58 |
}, |
61 |
}, |
59 |
beforeCreate() { |
62 |
beforeCreate() { |
60 |
this.loading() |
63 |
this.loading() |
61 |
|
64 |
|
62 |
const fetch_config = () => { |
65 |
const fetch_additional_config = () => { |
63 |
const sysprefs_client = APIClient.sysprefs |
66 |
let promises = [] |
64 |
const av_client = APIClient.authorised_values |
67 |
const av_client = APIClient.authorised_values |
65 |
let promises = [ |
68 |
promises.push( |
66 |
sysprefs_client.sysprefs |
|
|
67 |
.get("PreservationNotForLoanWaitingListIn") |
68 |
.then( |
69 |
value => { |
70 |
this.PreservationStore.settings.not_for_loan_waiting_list_in = |
71 |
value.value |
72 |
}, |
73 |
error => {} |
74 |
), |
75 |
sysprefs_client.sysprefs |
76 |
.get("PreservationNotForLoanDefaultTrainIn") |
77 |
.then( |
78 |
value => { |
79 |
this.PreservationStore.settings.not_for_loan_default_train_in = |
80 |
value.value |
81 |
}, |
82 |
error => {} |
83 |
), |
84 |
av_client.values.get("NOT_LOAN").then( |
69 |
av_client.values.get("NOT_LOAN").then( |
85 |
values => { |
70 |
values => { |
86 |
this.AVStore.av_notforloan = values |
71 |
this.AVStore.av_notforloan = values |
87 |
}, |
72 |
}, |
88 |
error => {} |
73 |
error => {} |
89 |
), |
74 |
) |
90 |
] |
75 |
) |
91 |
|
|
|
92 |
return Promise.all(promises) |
76 |
return Promise.all(promises) |
93 |
} |
77 |
} |
94 |
|
78 |
|
95 |
const sysprefs_client = APIClient.sysprefs |
79 |
const client = APIClient.preservation |
96 |
sysprefs_client.sysprefs |
80 |
client.config |
97 |
.get("PreservationModule") |
81 |
.get() |
98 |
.then(value => { |
82 |
.then(config => { |
99 |
this.PreservationModule = value.value |
83 |
this.config = config |
100 |
if (this.PreservationModule != 1) { |
84 |
if (this.config.settings.enabled != 1) { |
101 |
return this.setError( |
85 |
return this.setError( |
102 |
this.$__( |
86 |
this.$__( |
103 |
'The preservation module is disabled, turn on <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=PreservationModule">PreservationModule</a> to use it' |
87 |
'The preservation module is disabled, turn on <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=PreservationModule">PreservationModule</a> to use it' |
Lines 105-111
export default {
Link Here
|
105 |
false |
89 |
false |
106 |
) |
90 |
) |
107 |
} |
91 |
} |
108 |
return fetch_config() |
92 |
return fetch_additional_config() |
109 |
}) |
93 |
}) |
110 |
.then(() => { |
94 |
.then(() => { |
111 |
this.loaded() |
95 |
this.loaded() |