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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt (-18 lines)
Lines 3-9 Link Here
3
[% USE Asset %]
3
[% USE Asset %]
4
[% USE KohaDates %]
4
[% USE KohaDates %]
5
[% USE TablesSettings %]
5
[% USE TablesSettings %]
6
[% USE AuthorisedValues %]
7
[% SET footerjs = 1 %]
6
[% SET footerjs = 1 %]
8
[% PROCESS 'i18n.inc' %]
7
[% PROCESS 'i18n.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
8
[% INCLUDE 'doc-head-open.inc' %]
Lines 29-51 Link Here
29
28
30
    <script>
29
    <script>
31
30
32
        const agreement_statuses = [% To.json(AuthorisedValues.Get('ERM_AGREEMENT_STATUS')) | $raw %];
33
34
        const agreement_closure_reasons = [% To.json(AuthorisedValues.Get('ERM_AGREEMENT_CLOSURE_REASON')) | $raw %];
35
        const agreement_renewal_priorities = [% To.json(AuthorisedValues.Get('ERM_AGREEMENT_RENEWAL_PRIORITY')) | $raw %];
36
        const user_roles = [% To.json(AuthorisedValues.Get('ERM_USER_ROLES')) | $raw %];
37
38
        const license_types = [% To.json(AuthorisedValues.Get('ERM_LICENSE_TYPE')) | $raw %];
39
        const license_statuses = [% To.json(AuthorisedValues.Get('ERM_LICENSE_STATUS')) | $raw %];
40
41
        const agreement_license_statuses = [% To.json(AuthorisedValues.Get('ERM_AGREEMENT_LICENSE_STATUS')) | $raw %];
42
        const agreement_license_location = [% To.json(AuthorisedValues.Get('ERM_AGREEMENT_LICENSE_LOCATION')) | $raw %];
43
44
        const package_types = [% To.json(AuthorisedValues.Get('ERM_PACKAGE_TYPE')) | $raw %];
45
        const package_content_types = [% To.json(AuthorisedValues.Get('ERM_PACKAGE_CONTENT_TYPE')) | $raw %];
46
47
        const title_publication_types = [% To.json(AuthorisedValues.Get('ERM_TITLE_PUBLICATION_TYPE')) | $raw %];
48
49
        const agreement_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'agreements', 'agreements', 'json' ) | $raw %];
31
        const agreement_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'agreements', 'agreements', 'json' ) | $raw %];
50
        const license_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'licenses', 'licenses', 'json' ) | $raw %];
32
        const license_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'licenses', 'licenses', 'json' ) | $raw %];
51
        const eholdings_packages_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'eholdings', 'packages', 'json' ) | $raw %];
33
        const eholdings_packages_table_settings = [% TablesSettings.GetTableSettings( 'erm', 'eholdings', 'packages', 'json' ) | $raw %];
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue (-2 / +12 lines)
Lines 16-21 Link Here
16
    <div class="modal_centered" v-if="is_submitting">
16
    <div class="modal_centered" v-if="is_submitting">
17
        <div class="spinner dialog alert">{{ $__("Submitting...") }}</div>
17
        <div class="spinner dialog alert">{{ $__("Submitting...") }}</div>
18
    </div>
18
    </div>
19
    <div class="modal_centered" v-if="is_loading">
20
        <div class="spinner dialog message">{{ $__("Loading...") }}</div>
21
    </div>
19
</template>
22
</template>
20
23
21
<script>
24
<script>
Lines 24-33 import { storeToRefs } from "pinia" Link Here
24
export default {
27
export default {
25
    setup() {
28
    setup() {
26
        const mainStore = inject("mainStore")
29
        const mainStore = inject("mainStore")
27
        const { message, error, warning, is_submitting } =
30
        const { message, error, warning, is_submitting, is_loading } =
28
            storeToRefs(mainStore)
31
            storeToRefs(mainStore)
29
        const { removeMessages } = mainStore
32
        const { removeMessages } = mainStore
30
        return { message, error, warning, is_submitting, removeMessages }
33
        return {
34
            message,
35
            error,
36
            warning,
37
            is_submitting,
38
            is_loading,
39
            removeMessages,
40
        }
31
    },
41
    },
32
}
42
}
33
</script>
43
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementLicenses.vue (-4 / +4 lines)
Lines 44-51 Link Here
44
                    <v-select
44
                    <v-select
45
                        :id="`license_status_${counter}`"
45
                        :id="`license_status_${counter}`"
46
                        v-model="agreement_license.status"
46
                        v-model="agreement_license.status"
47
                        label="lib"
47
                        label="description"
48
                        :reduce="av => av.authorised_value"
48
                        :reduce="av => av.value"
49
                        :options="av_agreement_license_statuses"
49
                        :options="av_agreement_license_statuses"
50
                    >
50
                    >
51
                        <template #search="{ attributes, events }">
51
                        <template #search="{ attributes, events }">
Lines 66-73 Link Here
66
                    <v-select
66
                    <v-select
67
                        :id="`license_location_${counter}`"
67
                        :id="`license_location_${counter}`"
68
                        v-model="agreement_license.physical_location"
68
                        v-model="agreement_license.physical_location"
69
                        label="lib"
69
                        label="description"
70
                        :reduce="av => av.authorised_value"
70
                        :reduce="av => av.value"
71
                        :options="av_agreement_license_location"
71
                        :options="av_agreement_license_location"
72
                    />
72
                    />
73
                </li>
73
                </li>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementRelationships.vue (-2 / +2 lines)
Lines 44-51 Link Here
44
                    <v-select
44
                    <v-select
45
                        :id="`related_agreement_relationship_${counter}`"
45
                        :id="`related_agreement_relationship_${counter}`"
46
                        v-model="relationship.relationship"
46
                        v-model="relationship.relationship"
47
                        label="lib"
47
                        label="description"
48
                        :reduce="av => av.authorised_value"
48
                        :reduce="av => av.value"
49
                        :options="av_agreement_relationships"
49
                        :options="av_agreement_relationships"
50
                    >
50
                    >
51
                        <template #search="{ attributes, events }">
51
                        <template #search="{ attributes, events }">
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue (-7 / +7 lines)
Lines 59-66 Link Here
59
                                <v-select
59
                                <v-select
60
                                    id="agreement_status"
60
                                    id="agreement_status"
61
                                    v-model="agreement.status"
61
                                    v-model="agreement.status"
62
                                    label="lib"
62
                                    label="description"
63
                                    :reduce="av => av.authorised_value"
63
                                    :reduce="av => av.value"
64
                                    :options="av_agreement_statuses"
64
                                    :options="av_agreement_statuses"
65
                                    @option:selected="onStatusChanged"
65
                                    @option:selected="onStatusChanged"
66
                                    :required="!agreement.status"
66
                                    :required="!agreement.status"
Lines 85-92 Link Here
85
                                <v-select
85
                                <v-select
86
                                    id="agreement_closure_reason"
86
                                    id="agreement_closure_reason"
87
                                    v-model="agreement.closure_reason"
87
                                    v-model="agreement.closure_reason"
88
                                    label="lib"
88
                                    label="description"
89
                                    :reduce="av => av.authorised_value"
89
                                    :reduce="av => av.value"
90
                                    :options="av_agreement_closure_reasons"
90
                                    :options="av_agreement_closure_reasons"
91
                                    :disabled="
91
                                    :disabled="
92
                                        agreement.status == 'closed'
92
                                        agreement.status == 'closed'
Lines 129-136 Link Here
129
                                <v-select
129
                                <v-select
130
                                    id="agreement_renewal_priority"
130
                                    id="agreement_renewal_priority"
131
                                    v-model="agreement.renewal_priority"
131
                                    v-model="agreement.renewal_priority"
132
                                    label="lib"
132
                                    label="description"
133
                                    :reduce="av => av.authorised_value"
133
                                    :reduce="av => av.value"
134
                                    :options="av_agreement_renewal_priorities"
134
                                    :options="av_agreement_renewal_priorities"
135
                                />
135
                                />
136
                            </li>
136
                            </li>
Lines 395-401 export default { Link Here
395
            }
395
            }
396
        },
396
        },
397
        onStatusChanged(e) {
397
        onStatusChanged(e) {
398
            if (e.authorised_value != "closed") {
398
            if (e.value != "closed") {
399
                this.agreement.closure_reason = ""
399
                this.agreement.closure_reason = ""
400
            }
400
            }
401
        },
401
        },
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOPackageTitlesList.vue (-3 / +3 lines)
Lines 27-36 Link Here
27
                            <option value="">{{ $__("All") }}</option>
27
                            <option value="">{{ $__("All") }}</option>
28
                            <option
28
                            <option
29
                                v-for="type in av_title_publication_types"
29
                                v-for="type in av_title_publication_types"
30
                                :key="type.authorised_values"
30
                                :key="type.value"
31
                                :value="type.authorised_value"
31
                                :value="type.value"
32
                            >
32
                            >
33
                                {{ type.lib }}
33
                                {{ type.description }}
34
                            </option>
34
                            </option>
35
                        </select>
35
                        </select>
36
                    </li>
36
                    </li>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlesList.vue (-5 / +5 lines)
Lines 16-25 Link Here
16
                <option value="">{{ $__("All") }}</option>
16
                <option value="">{{ $__("All") }}</option>
17
                <option
17
                <option
18
                    v-for="type in av_title_publication_types"
18
                    v-for="type in av_title_publication_types"
19
                    :key="type.authorised_values"
19
                    :key="type.value"
20
                    :value="type.authorised_value"
20
                    :value="type.value"
21
                >
21
                >
22
                    {{ type.lib }}
22
                    {{ type.description }}
23
                </option>
23
                </option>
24
            </select>
24
            </select>
25
            {{ $__("Selection status") }}:
25
            {{ $__("Selection status") }}:
Lines 194-201 export default { Link Here
194
            }, {})
194
            }, {})
195
            window["av_title_publication_types"] =
195
            window["av_title_publication_types"] =
196
                this.av_title_publication_types.map(e => {
196
                this.av_title_publication_types.map(e => {
197
                    e["_id"] = e["authorised_value"]
197
                    e["_id"] = e["value"]
198
                    e["_str"] = e["lib"]
198
                    e["_str"] = e["description"]
199
                    return e
199
                    return e
200
                })
200
                })
201
201
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesFormAdd.vue (-4 / +4 lines)
Lines 38-45 Link Here
38
                            <v-select
38
                            <v-select
39
                                id="package_type"
39
                                id="package_type"
40
                                v-model="erm_package.package_type"
40
                                v-model="erm_package.package_type"
41
                                label="lib"
41
                                label="description"
42
                                :reduce="av => av.authorised_value"
42
                                :reduce="av => av.value"
43
                                :options="av_package_types"
43
                                :options="av_package_types"
44
                            />
44
                            />
45
                        </li>
45
                        </li>
Lines 50-57 Link Here
50
                            <v-select
50
                            <v-select
51
                                id="package_content_type"
51
                                id="package_content_type"
52
                                v-model="erm_package.content_type"
52
                                v-model="erm_package.content_type"
53
                                label="lib"
53
                                label="description"
54
                                :reduce="av => av.authorised_value"
54
                                :reduce="av => av.value"
55
                                :options="av_package_content_types"
55
                                :options="av_package_content_types"
56
                            />
56
                            />
57
                        </li>
57
                        </li>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormAdd.vue (-2 / +2 lines)
Lines 232-239 Link Here
232
                            <v-select
232
                            <v-select
233
                                id="title_publication_type"
233
                                id="title_publication_type"
234
                                v-model="title.publication_type"
234
                                v-model="title.publication_type"
235
                                label="lib"
235
                                label="description"
236
                                :reduce="av => av.authorised_value"
236
                                :reduce="av => av.value"
237
                                :options="av_title_publication_types"
237
                                :options="av_title_publication_types"
238
                            />
238
                            />
239
                        </li>
239
                        </li>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesFormAdd.vue (-4 / +4 lines)
Lines 59-66 Link Here
59
                                <v-select
59
                                <v-select
60
                                    id="license_type"
60
                                    id="license_type"
61
                                    v-model="license.type"
61
                                    v-model="license.type"
62
                                    label="lib"
62
                                    label="description"
63
                                    :reduce="av => av.authorised_value"
63
                                    :reduce="av => av.value"
64
                                    :options="av_license_types"
64
                                    :options="av_license_types"
65
                                >
65
                                >
66
                                    <template #search="{ attributes, events }">
66
                                    <template #search="{ attributes, events }">
Lines 83-91 Link Here
83
                                <v-select
83
                                <v-select
84
                                    id="license_status"
84
                                    id="license_status"
85
                                    v-model="license.status"
85
                                    v-model="license.status"
86
                                    :reduce="av => av.authorised_value"
86
                                    :reduce="av => av.value"
87
                                    :options="av_license_statuses"
87
                                    :options="av_license_statuses"
88
                                    label="lib"
88
                                    label="description"
89
                                >
89
                                >
90
                                    <template #search="{ attributes, events }">
90
                                    <template #search="{ attributes, events }">
91
                                        <input
91
                                        <input
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue (-15 / +43 lines)
Lines 1-5 Link Here
1
<template>
1
<template>
2
    <div v-if="ERMModule">
2
    <div v-if="is_loading">
3
        <Dialog />
4
    </div>
5
    <div v-else-if="ERMModule">
3
        <Breadcrumb />
6
        <Breadcrumb />
4
        <div class="main container-fluid">
7
        <div class="main container-fluid">
5
            <div class="row">
8
            <div class="row">
Lines 124-151 import Breadcrumb from "../../components/Breadcrumb.vue" Link Here
124
import Dialog from "../../components/Dialog.vue"
127
import Dialog from "../../components/Dialog.vue"
125
import { APIClient } from "../../fetch/api-client.js"
128
import { APIClient } from "../../fetch/api-client.js"
126
import "vue-select/dist/vue-select.css"
129
import "vue-select/dist/vue-select.css"
130
import { storeToRefs } from "pinia"
127
131
128
export default {
132
export default {
129
    setup() {
133
    setup() {
134
        const vendorStore = inject("vendorStore")
135
130
        const AVStore = inject("AVStore")
136
        const AVStore = inject("AVStore")
131
        AVStore.av_agreement_statuses = agreement_statuses
132
        AVStore.av_agreement_closure_reasons = agreement_closure_reasons
133
        AVStore.av_agreement_renewal_priorities = agreement_renewal_priorities
134
        AVStore.av_user_roles = user_roles
135
        AVStore.av_license_types = license_types
136
        AVStore.av_license_statuses = license_statuses
137
        AVStore.av_agreement_license_statuses = agreement_license_statuses
138
        AVStore.av_agreement_license_location = agreement_license_location
139
        AVStore.av_package_types = package_types
140
        AVStore.av_package_content_types = package_content_types
141
        AVStore.av_title_publication_types = title_publication_types
142
137
143
        const vendorStore = inject("vendorStore")
138
        const mainStore = inject("mainStore")
139
140
        // Note that we cannot use loading and loaded from messages
141
        // Pinia is not initiated yet there
142
        const { is_loading } = storeToRefs(mainStore)
144
143
145
        return {
144
        return {
146
            vendorStore,
145
            vendorStore,
146
            AVStore,
147
            mainStore,
147
            erm_providers,
148
            erm_providers,
148
            ERMModule,
149
            ERMModule,
150
            is_loading,
149
        }
151
        }
150
    },
152
    },
151
    data() {
153
    data() {
Lines 154-167 export default { Link Here
154
        }
156
        }
155
    },
157
    },
156
    beforeCreate() {
158
    beforeCreate() {
157
        const client = APIClient.acquisition
159
        this.mainStore.is_loading = true
158
        client.vendors.getAll().then(
160
161
        const acq_client = APIClient.acquisition
162
        acq_client.vendors.getAll().then(
159
            vendors => {
163
            vendors => {
160
                this.vendors = vendors
164
                this.vendors = vendors
161
                this.initialized = true
165
                this.initialized = true
162
            },
166
            },
163
            error => {}
167
            error => {}
164
        )
168
        )
169
170
        const av_client = APIClient.authorised_values
171
        const authorised_values = {
172
            av_agreement_statuses: "ERM_AGREEMENT_STATUS",
173
            av_agreement_closure_reasons: "ERM_AGREEMENT_CLOSURE_REASON",
174
            av_agreement_renewal_priorities: "ERM_AGREEMENT_RENEWAL_PRIORITY",
175
            av_user_roles: "ERM_USER_ROLES",
176
            av_license_types: "ERM_LICENSE_TYPE",
177
            av_license_statuses: "ERM_LICENSE_STATUS",
178
            av_agreement_license_statuses: "ERM_AGREEMENT_LICENSE_STATUS",
179
            av_agreement_license_location: "ERM_AGREEMENT_LICENSE_LOCATION",
180
            av_package_types: "ERM_PACKAGE_TYPE",
181
            av_package_content_types: "ERM_PACKAGE_CONTENT_TYPE",
182
            av_title_publication_types: "ERM_TITLE_PUBLICATION_TYPE",
183
        }
184
        let promises = []
185
        Object.entries(authorised_values).forEach(([av_var, av_cat]) => {
186
            promises.push(
187
                av_client.values.getAll(av_cat).then(av => {
188
                    this.AVStore[av_var] = av
189
                })
190
            )
191
        })
192
        Promise.all(promises).then(() => (this.mainStore.is_loading = false))
165
    },
193
    },
166
    components: {
194
    components: {
167
        Breadcrumb,
195
        Breadcrumb,
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UserRoles.vue (-2 / +2 lines)
Lines 35-42 Link Here
35
                    <v-select
35
                    <v-select
36
                        :id="`user_role_${counter}`"
36
                        :id="`user_role_${counter}`"
37
                        v-model="user_role.role"
37
                        v-model="user_role.role"
38
                        label="lib"
38
                        label="description"
39
                        :reduce="av => av.authorised_value"
39
                        :reduce="av => av.value"
40
                        :options="av_user_roles"
40
                        :options="av_user_roles"
41
                    >
41
                    >
42
                        <template #search="{ attributes, events }">
42
                        <template #search="{ attributes, events }">
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js (-1 / +3 lines)
Lines 1-9 Link Here
1
import ERMAPIClient from "./erm-api-client";
1
import ERMAPIClient from "./erm-api-client";
2
import PatronAPIClient from "./patron-api-client";
2
import PatronAPIClient from "./patron-api-client";
3
import AcquisitionAPIClient from "./acquisition-api-client";
3
import AcquisitionAPIClient from "./acquisition-api-client";
4
import AVAPIClient from "./authorised-values";
4
5
5
export const APIClient = {
6
export const APIClient = {
6
    erm: new ERMAPIClient(),
7
    erm: new ERMAPIClient(),
7
    patron: new PatronAPIClient(),
8
    patron: new PatronAPIClient(),
8
    acquisition: new AcquisitionAPIClient(),
9
    acquisition: new AcquisitionAPIClient(),
9
};
10
    authorised_values: new AVAPIClient(),
11
};
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/authorised-values.js (+20 lines)
Line 0 Link Here
1
import HttpClient from "./http-client";
2
3
export class AVAPIClient extends HttpClient {
4
    constructor() {
5
        super({
6
            baseURL: "/api/v1/authorised_value_categories/",
7
        });
8
    }
9
10
    get values() {
11
        return {
12
            getAll: (category_name, query) =>
13
                this.get({
14
                    endpoint: category_name + "/values?" + (query || "_per_page=-1"),
15
                }),
16
        };
17
    }
18
}
19
20
export default AVAPIClient;
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/messages.js (+10 lines)
Lines 31-34 export const submitted = function () { Link Here
31
    const mainStore = useMainStore();
31
    const mainStore = useMainStore();
32
    const { submitted } = mainStore;
32
    const { submitted } = mainStore;
33
    submitted();
33
    submitted();
34
};
35
export const loading = function () {
36
    const mainStore = useMainStore();
37
    const { loading } = mainStore;
38
    loading();
39
};
40
export const loaded = function () {
41
    const mainStore = useMainStore();
42
    const { loaded } = mainStore;
43
    loaded();
34
};
44
};
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts (-2 / +3 lines)
Lines 27-33 const router = createRouter({ Link Here
27
27
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
31
32
const pinia = createPinia();
32
const pinia = createPinia();
33
33
Lines 52-58 app.config.unwrapInjectedRef = true; Link Here
52
app.provide("vendorStore", useVendorStore(pinia));
52
app.provide("vendorStore", useVendorStore(pinia));
53
const mainStore = useMainStore(pinia);
53
const mainStore = useMainStore(pinia);
54
app.provide("mainStore", mainStore);
54
app.provide("mainStore", mainStore);
55
app.provide("AVStore", useAVStore(pinia));
55
const AVStore = useAVStore(pinia);
56
app.provide("AVStore", AVStore);
56
57
57
app.mount("#erm");
58
app.mount("#erm");
58
59
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/authorised_values.js (-17 / +17 lines)
Lines 11-37 export const useAVStore = defineStore("authorised_values", { Link Here
11
        av_agreement_license_statuses: [],
11
        av_agreement_license_statuses: [],
12
        av_agreement_license_location: [],
12
        av_agreement_license_location: [],
13
        av_agreement_relationships: [
13
        av_agreement_relationships: [
14
            { authorised_value: "supersedes", lib: __("supersedes") },
14
            { value: "supersedes", description: __("supersedes") },
15
            { authorised_value: "is-superseded-by", lib: __("is superseded by") },
15
            { value: "is-superseded-by", description: __("is superseded by") },
16
            {
16
            {
17
                authorised_value: "provides_post-cancellation_access_for",
17
                value: "provides_post-cancellation_access_for",
18
                lib: __("provides post-cancellation access for"),
18
                description: __("provides post-cancellation access for"),
19
            },
19
            },
20
            {
20
            {
21
                authorised_value: "has-post-cancellation-access-in",
21
                value: "has-post-cancellation-access-in",
22
                lib: __("has post-cancellation access in"),
22
                description: __("has post-cancellation access in"),
23
            },
23
            },
24
            {
24
            {
25
                authorised_value: "tracks_demand-driven_acquisitions_for",
25
                value: "tracks_demand-driven_acquisitions_for",
26
                lib: __("tracks demand-driven acquisitions for"),
26
                description: __("tracks demand-driven acquisitions for"),
27
            },
27
            },
28
            {
28
            {
29
                authorised_value: "has-demand-driven-acquisitions-in",
29
                value: "has-demand-driven-acquisitions-in",
30
                lib: __("has demand-driven acquisitions in"),
30
                description: __("has demand-driven acquisitions in"),
31
            },
31
            },
32
            { authorised_value: "has_backfile_in", lib: __("has backfile in") },
32
            { value: "has_backfile_in", description: __("has backfile in") },
33
            { authorised_value: "has_frontfile_in", lib: __("has frontfile in") },
33
            { value: "has_frontfile_in", description: __("has frontfile in") },
34
            { authorised_value: "related_to", lib: __("related to") },
34
            { value: "related_to", description: __("related to") },
35
        ],
35
        ],
36
        av_package_types: [],
36
        av_package_types: [],
37
        av_package_content_types: [],
37
        av_package_content_types: [],
Lines 47-59 export const useAVStore = defineStore("authorised_values", { Link Here
47
                );
47
                );
48
                return;
48
                return;
49
            }
49
            }
50
            let o = this[arr_name].find((e) => e.authorised_value == av);
50
            let o = this[arr_name].find((e) => e.value == av);
51
            return o ? o.lib : av;
51
            return o ? o.description : av;
52
        },
52
        },
53
        map_av_dt_filter(arr_name) {
53
        map_av_dt_filter(arr_name) {
54
            return this[arr_name].map((e) => {
54
            return this[arr_name].map((e) => {
55
                e["_id"] = e["authorised_value"];
55
                e["_id"] = e["value"];
56
                e["_str"] = e["lib"];
56
                e["_str"] = e["description"];
57
                return e;
57
                return e;
58
            });
58
            });
59
        },
59
        },
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js (-1 / +7 lines)
Lines 9-14 export const useMainStore = defineStore("main", { Link Here
9
        previousError: null,
9
        previousError: null,
10
        displayed_already: false,
10
        displayed_already: false,
11
        is_submitting: false,
11
        is_submitting: false,
12
        is_loading: false,
12
    }),
13
    }),
13
    actions: {
14
    actions: {
14
        setMessage(message) {
15
        setMessage(message) {
Lines 41-45 export const useMainStore = defineStore("main", { Link Here
41
        submitted(){
42
        submitted(){
42
            this.is_submitting = false;
43
            this.is_submitting = false;
43
        },
44
        },
45
        loading(){
46
            this.is_loading = true;
47
        },
48
        loaded(){
49
            this.is_loading = false;
50
        },
44
    },
51
    },
45
});
52
});
46
- 

Return to bug 32983