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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue (-24 / +22 lines)
Lines 51-57 Link Here
51
                                v-model="agreement.status"
51
                                v-model="agreement.status"
52
                                label="description"
52
                                label="description"
53
                                :reduce="av => av.value"
53
                                :reduce="av => av.value"
54
                                :options="av_agreement_statuses"
54
                                :options="
55
                                    authorisedValues['av_agreement_statuses']
56
                                "
55
                                @option:selected="onStatusChanged"
57
                                @option:selected="onStatusChanged"
56
                                :required="!agreement.status"
58
                                :required="!agreement.status"
57
                            >
59
                            >
Lines 75-81 Link Here
75
                                v-model="agreement.closure_reason"
77
                                v-model="agreement.closure_reason"
76
                                label="description"
78
                                label="description"
77
                                :reduce="av => av.value"
79
                                :reduce="av => av.value"
78
                                :options="av_agreement_closure_reasons"
80
                                :options="
81
                                    authorisedValues[
82
                                        'av_agreement_closure_reasons'
83
                                    ]
84
                                "
79
                                :disabled="
85
                                :disabled="
80
                                    agreement.status == 'closed' ? false : true
86
                                    agreement.status == 'closed' ? false : true
81
                                "
87
                                "
Lines 117-123 Link Here
117
                                v-model="agreement.renewal_priority"
123
                                v-model="agreement.renewal_priority"
118
                                label="description"
124
                                label="description"
119
                                :reduce="av => av.value"
125
                                :reduce="av => av.value"
120
                                :options="av_agreement_renewal_priorities"
126
                                :options="
127
                                    authorisedValues[
128
                                        'av_agreement_renewal_priorities'
129
                                    ]
130
                                "
121
                            />
131
                            />
122
                        </li>
132
                        </li>
123
                        <li>
133
                        <li>
Lines 136-156 Link Here
136
                <UserRoles
146
                <UserRoles
137
                    :user_type="$__('Agreement user %s')"
147
                    :user_type="$__('Agreement user %s')"
138
                    :user_roles="agreement.user_roles"
148
                    :user_roles="agreement.user_roles"
139
                    :av_user_roles="av_user_roles"
149
                    :av_user_roles="authorisedValues['av_user_roles']"
140
                />
150
                />
141
                <AgreementLicenses
151
                <AgreementLicenses
142
                    :agreement_licenses="agreement.agreement_licenses"
152
                    :agreement_licenses="agreement.agreement_licenses"
143
                    :av_agreement_license_statuses="
153
                    :av_agreement_license_statuses="
144
                        av_agreement_license_statuses
154
                        authorisedValues['av_agreement_license_statuses']
145
                    "
155
                    "
146
                    :av_agreement_license_location="
156
                    :av_agreement_license_location="
147
                        av_agreement_license_location
157
                        authorisedValues['av_agreement_license_location']
148
                    "
158
                    "
149
                />
159
                />
150
                <AgreementRelationships
160
                <AgreementRelationships
151
                    :agreement_id="agreement.agreement_id"
161
                    :agreement_id="agreement.agreement_id"
152
                    :relationships="agreement.agreement_relationships"
162
                    :relationships="agreement.agreement_relationships"
153
                    :av_agreement_relationships="av_agreement_relationships"
163
                    :av_agreement_relationships="
164
                        authorisedValues['av_agreement_relationships']
165
                    "
154
                />
166
                />
155
                <Documents :documents="agreement.documents" />
167
                <Documents :documents="agreement.documents" />
156
                <fieldset class="action">
168
                <fieldset class="action">
Lines 182-206 import { storeToRefs } from "pinia" Link Here
182
194
183
export default {
195
export default {
184
    setup() {
196
    setup() {
185
        const AVStore = inject("AVStore")
197
        const mainStore = inject("mainStore")
186
        const {
198
        const { authorisedValues } = storeToRefs(mainStore)
187
            av_agreement_statuses,
188
            av_agreement_closure_reasons,
189
            av_agreement_renewal_priorities,
190
            av_user_roles,
191
            av_agreement_license_statuses,
192
            av_agreement_license_location,
193
            av_agreement_relationships,
194
        } = storeToRefs(AVStore)
195
199
196
        return {
200
        return {
197
            av_agreement_statuses,
201
            authorisedValues,
198
            av_agreement_closure_reasons,
199
            av_agreement_renewal_priorities,
200
            av_user_roles,
201
            av_agreement_license_statuses,
202
            av_agreement_license_location,
203
            av_agreement_relationships,
204
            max_allowed_packet,
202
            max_allowed_packet,
205
        }
203
        }
206
    },
204
    },
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (-7 / +6 lines)
Lines 70-82 export default { Link Here
70
        const vendorStore = inject("vendorStore")
70
        const vendorStore = inject("vendorStore")
71
        const { vendors } = storeToRefs(vendorStore)
71
        const { vendors } = storeToRefs(vendorStore)
72
72
73
        const AVStore = inject("AVStore")
73
        const {
74
        const { get_lib_from_av, map_av_dt_filter } = AVStore
74
            setConfirmationDialog,
75
75
            setMessage,
76
        const { setConfirmationDialog, setMessage } = inject("mainStore")
76
            get_lib_from_av,
77
77
            map_av_dt_filter,
78
        const { authorisedValues } = inject("ERMStore")
78
        } = inject("mainStore")
79
        console.log(authorisedValues)
80
79
81
        const table = ref()
80
        const table = ref()
82
81
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue (+1 lines)
Lines 91-96 export default { Link Here
91
            .then(config => {
91
            .then(config => {
92
                this.config = config
92
                this.config = config
93
                if (this.config.settings.ERMModule != 1) {
93
                if (this.config.settings.ERMModule != 1) {
94
                    this.loaded()
94
                    return this.setError(
95
                    return this.setError(
95
                        this.$__(
96
                        this.$__(
96
                            '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'
97
                            '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/stores/main.js (-2 lines)
Lines 112-118 export const useMainStore = defineStore("main", { Link Here
112
            });
112
            });
113
        },
113
        },
114
        async loadAuthorisedValues(authorisedValues) {
114
        async loadAuthorisedValues(authorisedValues) {
115
            console.log(authorisedValues);
116
            const AVsToFetch = Object.keys(authorisedValues).reduce(
115
            const AVsToFetch = Object.keys(authorisedValues).reduce(
117
                (acc, avKey) => {
116
                (acc, avKey) => {
118
                    if (Array.isArray(authorisedValues[avKey])) return acc;
117
                    if (Array.isArray(authorisedValues[avKey])) return acc;
119
- 

Return to bug 37930