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

(-)a/Koha/REST/V1/Acquisitions/Vendors.pm (+1 lines)
Lines 216-221 sub config { Link Here
216
            gst_values  => \@gst_values,
216
            gst_values  => \@gst_values,
217
            edifact     => C4::Context->preference('EDIFACT'),
217
            edifact     => C4::Context->preference('EDIFACT'),
218
            marc_orders => C4::Context->preference('MarcOrderingAutomation'),
218
            marc_orders => C4::Context->preference('MarcOrderingAutomation'),
219
            erm_module  => C4::Context->preference('ERMModule'),
219
        },
220
        },
220
    );
221
    );
221
}
222
}
(-)a/api/v1/swagger/definitions/vendors_config.yaml (+3 lines)
Lines 16-19 properties: Link Here
16
  marc_orders:
16
  marc_orders:
17
    type: boolean
17
    type: boolean
18
    description: MarcOrderingAutomation system preference value
18
    description: MarcOrderingAutomation system preference value
19
  erm_module:
20
    type: boolean
21
    description: ERMModule system preference value
19
additionalProperties: false
22
additionalProperties: false
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue (+6 lines)
Lines 831-836 export default { Link Here
831
            let url = baseResource.getResourceTableUrl();
831
            let url = baseResource.getResourceTableUrl();
832
            if (filters?.by_expired)
832
            if (filters?.by_expired)
833
                url += "?max_expiration_date=" + filters.max_expiration_date;
833
                url += "?max_expiration_date=" + filters.max_expiration_date;
834
            const vendorId = baseResource.route.query.vendor_id;
835
            if (vendorId) {
836
                url = filters?.by_expired
837
                    ? url + "&vendor_id=" + vendorId
838
                    : url + "?vendor_id=" + vendorId;
839
            }
834
            return url;
840
            return url;
835
        };
841
        };
836
        const filterTable = async (filters, table, embedded = false) => {
842
        const filterTable = async (filters, table, embedded = false) => {
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue (-1 / +10 lines)
Lines 288-296 export default { Link Here
288
                },
288
                },
289
            ],
289
            ],
290
        });
290
        });
291
        const tableURL = () => {
292
            let url = baseResource.getResourceTableUrl();
293
294
            const vendorId = baseResource.route.query.vendor_id;
295
            if (vendorId) {
296
                url += "?vendor_id=" + vendorId;
297
            }
298
            return url;
299
        };
291
300
292
        const tableOptions = {
301
        const tableOptions = {
293
            url: baseResource.getResourceTableUrl(),
302
            url: tableURL(),
294
            options: { embed: "vendor,extended_attributes,+strings" },
303
            options: { embed: "vendor,extended_attributes,+strings" },
295
            table_settings: license_table_settings,
304
            table_settings: license_table_settings,
296
            add_filters: true,
305
            add_filters: true,
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/VendorMenu.vue (-1 / +23 lines)
Lines 75-80 Link Here
75
                    >{{ $__("Uncertain prices") }}</a
75
                    >{{ $__("Uncertain prices") }}</a
76
                >
76
                >
77
            </li>
77
            </li>
78
            <li v-if="ermModule && (erm || isUserPermitted('CAN_user_erm'))">
79
                <a
80
                    :href="`/cgi-bin/koha/erm/agreements?vendor_id=${vendorId}`"
81
                    >{{ $__("ERM agreements") }}</a
82
                >
83
            </li>
84
            <li v-if="ermModule && (erm || isUserPermitted('CAN_user_erm'))">
85
                <a :href="`/cgi-bin/koha/erm/licenses?vendor_id=${vendorId}`">{{
86
                    $__("ERM licenses")
87
                }}</a>
88
            </li>
78
        </ul>
89
        </ul>
79
    </div>
90
    </div>
80
</template>
91
</template>
Lines 103-116 export default { Link Here
103
        issuemanage: {
114
        issuemanage: {
104
            type: String,
115
            type: String,
105
        },
116
        },
117
        ermmodule: {
118
            type: String,
119
        },
120
        erm: {
121
            type: String,
122
        },
106
    },
123
    },
107
    setup(props) {
124
    setup(props) {
108
        const vendorStore = inject("vendorStore");
125
        const vendorStore = inject("vendorStore");
109
        const { isUserPermitted } = vendorStore;
126
        const { isUserPermitted, config } = vendorStore;
110
        const navigationStore = inject("navigationStore");
127
        const navigationStore = inject("navigationStore");
111
        const { params } = storeToRefs(navigationStore);
128
        const { params } = storeToRefs(navigationStore);
112
129
113
        const vendorId = ref(props.vendorid || params.value.id);
130
        const vendorId = ref(props.vendorid || params.value.id);
131
        const ermModule = props.ermmodule
132
            ? props.ermmodule
133
            : config.settings.ermModule;
114
        const templateRefs = ref([]);
134
        const templateRefs = ref([]);
115
135
116
        onMounted(() => {
136
        onMounted(() => {
Lines 123-128 export default { Link Here
123
        return {
143
        return {
124
            isUserPermitted,
144
            isUserPermitted,
125
            params,
145
            params,
146
            config,
147
            ermModule,
126
            vendorId,
148
            vendorId,
127
            templateRefs,
149
            templateRefs,
128
        };
150
        };
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue (-1 / +1 lines)
Lines 55-60 export default { Link Here
55
                    client.config.get("vendors").then(result => {
55
                    client.config.get("vendors").then(result => {
56
                        userPermissions.value = result.permissions;
56
                        userPermissions.value = result.permissions;
57
                        config.value.settings.edifact = result.edifact;
57
                        config.value.settings.edifact = result.edifact;
58
                        config.value.settings.ermModule = result.erm_module;
58
                        config.value.settings.marcOrderAutomation =
59
                        config.value.settings.marcOrderAutomation =
59
                            result.marcOrderAutomation;
60
                            result.marcOrderAutomation;
60
                        vendorStore.currencies = result.currencies;
61
                        vendorStore.currencies = result.currencies;
61
- 

Return to bug 38208