diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseElement.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseElement.vue
index 1a6b851f4c..750ae0d1eb 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseElement.vue
+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/BaseElement.vue
@@ -114,6 +114,9 @@ export default {
});
return property;
},
+ additionalFieldsChanged(additionalFieldValues, resource) {
+ resource.extended_attributes = additionalFieldValues;
+ },
},
name: "BaseElement",
};
diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue
index 87328a2e13..480ef72d8b 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue
+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue
@@ -16,7 +16,7 @@
tableUrl,
embedded,
hasAdditionalFields,
- resourceName,
+ extendedAttributesResourceType,
}"
@select-resource="$emit('select-resource', $event)"
/>
@@ -97,6 +97,7 @@ export default {
displayNameLowerCase: __("agreement"),
displayNamePlural: __("agreements"),
},
+ extendedAttributesResourceType: "agreement",
av_agreement_statuses,
av_agreement_closure_reasons,
av_agreement_renewal_priorities,
@@ -191,44 +192,8 @@ export default {
},
{
name: "additional_fields",
- type: "component",
- showElement: {
- type: "relationship",
- hidden: agreement =>
- agreement._strings?.additional_field_values
- ?.length > 0,
- componentPath: "./AdditionalFieldsDisplay.vue",
- componentProps: {
- extended_attributes_resource_type: {
- type: "string",
- value: "agreement",
- },
- additional_field_values: {
- resourceProperty:
- "_strings.additional_field_values",
- },
- },
- },
- componentPath: "./AdditionalFieldsEntry.vue",
- componentProps: {
- extended_attributes_resource_type: {
- type: "string",
- value: "agreement",
- },
- additional_field_values: {
- resourceProperty: "extended_attributes",
- },
- resource: {
- type: "resource",
- value: "agreement",
- },
- },
- events: [
- {
- name: "additional-fields-changed",
- callback: this.additionalFieldsChanged,
- },
- ],
+ extended_attributes_resource_type:
+ this.extendedAttributesResourceType,
},
{
name: "periods",
diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageResource.vue
index 666a40015b..ab6e0d81b3 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageResource.vue
+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageResource.vue
@@ -16,7 +16,7 @@
tableUrl,
embedded,
hasAdditionalFields,
- resourceName,
+ extendedAttributesResourceType,
getToolbarButtons,
}"
@select-resource="$emit('select-resource', $event)"
@@ -79,7 +79,7 @@ export default {
return {
...BaseResource.setup({
- resourceName: "erm_package",
+ resourceName: "package",
nameAttr: "name",
idAttr: "package_id",
showComponent: "EHoldingsLocalPackagesShow",
@@ -94,6 +94,7 @@ export default {
displayNameLowerCase: __("package"),
displayNamePlural: __("packages"),
},
+ extendedAttributesResourceType: "package",
av_package_types,
av_package_content_types,
vendors,
@@ -151,6 +152,11 @@ export default {
type: "text",
label: __("Notes"),
},
+ {
+ name: "additional_fields",
+ extended_attributes_resource_type:
+ this.extendedAttributesResourceType,
+ },
{
name: "package_agreements",
type: "relationshipWidget",
@@ -249,7 +255,7 @@ export default {
},
},
],
- erm_package: {
+ package: {
package_id: null,
vendor_id: null,
name: "",
diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue
index 80f8bea0aa..0b5d919699 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue
+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue
@@ -16,7 +16,7 @@
filterTable,
tableUrl,
hasAdditionalFields,
- resourceName,
+ extendedAttributesResourceType,
}"
@select-resource="$emit('select-resource', $event)"
/>
@@ -89,11 +89,12 @@ export default {
displayNameLowerCase: __("license"),
displayNamePlural: __("licenses"),
},
+ extendedAttributesResourceType: "license",
+ av_license_types,
+ av_license_statuses,
+ av_user_roles,
+ vendors,
}),
- av_license_types,
- av_license_statuses,
- av_user_roles,
- vendors,
};
},
data() {
@@ -204,43 +205,8 @@ export default {
},
{
name: "additional_fields",
- type: "relationship",
- showElement: {
- type: "relationship",
- hidden: license =>
- !!license._strings?.additional_field_values?.length,
- componentPath: "./AdditionalFieldsDisplay.vue",
- componentProps: {
- extended_attributes_resource_type: {
- type: "string",
- value: "license",
- },
- additional_field_values: {
- resourceProperty:
- "_strings.additional_field_values",
- },
- },
- },
- componentPath: "./AdditionalFieldsEntry.vue",
- componentProps: {
- extended_attributes_resource_type: {
- type: "string",
- value: "license",
- },
- additional_field_values: {
- resourceProperty: "extended_attributes",
- },
- resource: {
- type: "resource",
- value: "license",
- },
- },
- events: [
- {
- name: "additional-fields-changed",
- callback: this.additionalFieldsChanged,
- },
- ],
+ extended_attributes_resource_type:
+ this.extendedAttributesResourceType,
},
{
name: "user_roles",
diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/FormElement.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/FormElement.vue
index 57f97aed91..faa6b8498e 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/FormElement.vue
+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/FormElement.vue
@@ -140,11 +140,22 @@
:resource="resource"
>
+
+
+
{{ $__("Required") }}
diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue
index caa2897cee..05af461a24 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue
+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue
@@ -1,6 +1,6 @@
{{ $__("Loading") }}
-
+
[],
@@ -128,15 +128,17 @@ export default {
},
async getSearchableAdditionalFields() {
const client = APIClient.additional_fields;
- await client.additional_fields.getAll(this.resourceName).then(
- searchable_additional_fields => {
- this.searchable_additional_fields =
- searchable_additional_fields.filter(
- field => field.searchable
- );
- },
- error => {}
- );
+ await client.additional_fields
+ .getAll(this.extendedAttributesResourceType)
+ .then(
+ searchable_additional_fields => {
+ this.searchable_additional_fields =
+ searchable_additional_fields.filter(
+ field => field.searchable
+ );
+ },
+ error => {}
+ );
},
async getSearchableAVOptions() {
const client_av = APIClient.authorised_values;
diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ShowElement.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ShowElement.vue
index ed18db9100..46af0f7c40 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ShowElement.vue
+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ShowElement.vue
@@ -119,15 +119,29 @@
>
+
+
+