View | Details | Raw Unified | Return to bug 33408
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackagesList.vue (-2 / +5 lines)
Lines 81-86 export default { Link Here
81
            storeToRefs(AVStore)
81
            storeToRefs(AVStore)
82
        const { get_lib_from_av, map_av_dt_filter } = AVStore
82
        const { get_lib_from_av, map_av_dt_filter } = AVStore
83
83
84
        const ERMStore = inject("ERMStore")
85
        const { providers } = ERMStore
86
84
        const table = ref()
87
        const table = ref()
85
        const filters = reactive({
88
        const filters = reactive({
86
            package_name: "",
89
            package_name: "",
Lines 95-101 export default { Link Here
95
            get_lib_from_av,
98
            get_lib_from_av,
96
            escape_str,
99
            escape_str,
97
            map_av_dt_filter,
100
            map_av_dt_filter,
98
            erm_providers,
101
            providers,
99
            table,
102
            table,
100
        }
103
        }
101
    },
104
    },
Lines 165-171 export default { Link Here
165
            this.show_table = true
168
            this.show_table = true
166
            this.local_count_packages = null
169
            this.local_count_packages = null
167
170
168
            if (this.erm_providers.includes("local")) {
171
            if (this.providers.includes("local")) {
169
                const client = APIClient.erm
172
                const client = APIClient.erm
170
                const query = this.filters
173
                const query = this.filters
171
                    ? {
174
                    ? {
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue (-2 / +5 lines)
Lines 84-89 export default { Link Here
84
        const { av_title_publication_types } = storeToRefs(AVStore)
84
        const { av_title_publication_types } = storeToRefs(AVStore)
85
        const { get_lib_from_av } = AVStore
85
        const { get_lib_from_av } = AVStore
86
86
87
        const ERMStore = inject("ERMStore")
88
        const { providers } = ERMStore
89
87
        const table = ref()
90
        const table = ref()
88
        const filters = reactive({
91
        const filters = reactive({
89
            publication_title: "",
92
            publication_title: "",
Lines 96-102 export default { Link Here
96
            av_title_publication_types,
99
            av_title_publication_types,
97
            get_lib_from_av,
100
            get_lib_from_av,
98
            escape_str,
101
            escape_str,
99
            erm_providers,
102
            providers,
100
            table,
103
            table,
101
        }
104
        }
102
    },
105
    },
Lines 175-181 export default { Link Here
175
                        "/api/v1/erm/eholdings/ebsco/titles"
178
                        "/api/v1/erm/eholdings/ebsco/titles"
176
                    )
179
                    )
177
                }
180
                }
178
                if (this.erm_providers.includes("local")) {
181
                if (this.providers.includes("local")) {
179
                    const client = APIClient.erm
182
                    const client = APIClient.erm
180
183
181
                    const q = this.filters
184
                    const q = this.filters
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue (-7 / +13 lines)
Lines 1-5 Link Here
1
<template>
1
<template>
2
    <div v-if="initialized && ERMModule == 1">
2
    <div v-if="initialized && sysprefs.ERMModule == 1">
3
        <div id="sub-header">
3
        <div id="sub-header">
4
            <Breadcrumb />
4
            <Breadcrumb />
5
            <Help />
5
            <Help />
Lines 48-54 Link Here
48
                                    <li>
48
                                    <li>
49
                                        <ul>
49
                                        <ul>
50
                                            <li
50
                                            <li
51
                                                v-for="provider in erm_providers"
51
                                                v-for="provider in providers"
52
                                                :key="provider"
52
                                                :key="provider"
53
                                            >
53
                                            >
54
                                                <router-link
54
                                                <router-link
Lines 136-144 export default { Link Here
136
136
137
        const { loading, loaded, setError } = mainStore
137
        const { loading, loaded, setError } = mainStore
138
138
139
        const ERMStore = inject("ERMStore")
140
141
        const { sysprefs, providers } = ERMStore
142
139
        return {
143
        return {
140
            vendorStore,
144
            vendorStore,
141
            AVStore,
145
            AVStore,
146
            ERMStore,
147
            sysprefs,
148
            providers,
142
            setError,
149
            setError,
143
            loading,
150
            loading,
144
            loaded,
151
            loaded,
Lines 148-155 export default { Link Here
148
        return {
155
        return {
149
            component: "agreement",
156
            component: "agreement",
150
            initialized: false,
157
            initialized: false,
151
            ERMModule: null,
152
            erm_providers: [],
153
        }
158
        }
154
    },
159
    },
155
    beforeCreate() {
160
    beforeCreate() {
Lines 209-215 export default { Link Here
209
            promises.push(
214
            promises.push(
210
                sysprefs_client.sysprefs.get("ERMProviders").then(
215
                sysprefs_client.sysprefs.get("ERMProviders").then(
211
                    providers => {
216
                    providers => {
212
                        this.erm_providers = providers.value.split(",")
217
                        this.ERMStore.providers = providers.value.split(",")
218
                        this.providers = this.ERMStore.providers
213
                    },
219
                    },
214
                    error => {}
220
                    error => {}
215
                )
221
                )
Lines 221-228 export default { Link Here
221
        sysprefs_client.sysprefs
227
        sysprefs_client.sysprefs
222
            .get("ERMModule")
228
            .get("ERMModule")
223
            .then(value => {
229
            .then(value => {
224
                this.ERMModule = value.value
230
                this.ERMStore.sysprefs.ERMModule = value.value
225
                if (this.ERMModule != 1) {
231
                if (this.sysprefs.ERMModule != 1) {
226
                    return this.setError(
232
                    return this.setError(
227
                        this.$__(
233
                        this.$__(
228
                            'The e-resource management module is disabled, turn on <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ERMModule">ERMModule</a> to use it'
234
                            'The e-resource management module is disabled, turn on <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ERMModule">ERMModule</a> to use it'
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts (+3 lines)
Lines 28-33 const router = createRouter({ Link Here
28
import { useMainStore } from "../stores/main";
28
import { useMainStore } from "../stores/main";
29
import { useVendorStore } from "../stores/vendors";
29
import { useVendorStore } from "../stores/vendors";
30
import { useAVStore } from "../stores/authorised-values";
30
import { useAVStore } from "../stores/authorised-values";
31
import { useERMStore } from "../stores/erm";
31
32
32
const pinia = createPinia();
33
const pinia = createPinia();
33
34
Lines 54-59 const mainStore = useMainStore(pinia); Link Here
54
app.provide("mainStore", mainStore);
55
app.provide("mainStore", mainStore);
55
const AVStore = useAVStore(pinia);
56
const AVStore = useAVStore(pinia);
56
app.provide("AVStore", AVStore);
57
app.provide("AVStore", AVStore);
58
const ERMStore = useERMStore(pinia);
59
app.provide("ERMStore", ERMStore);
57
60
58
app.mount("#erm");
61
app.mount("#erm");
59
62
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js (-1 / +10 lines)
Line 0 Link Here
0
- 
1
import { defineStore } from "pinia";
2
3
export const useERMStore = defineStore("erm", {
4
    state: () => ({
5
        sysprefs: {
6
            ERMModule: false,
7
        },
8
        providers: [],
9
    }),
10
});

Return to bug 33408