diff --git a/src/views/admin/components/edition/item-edition-form.vue b/src/views/admin/components/edition/item-edition-form.vue index 26b8f44d5..027f60574 100644 --- a/src/views/admin/components/edition/item-edition-form.vue +++ b/src/views/admin/components/edition/item-edition-form.vue @@ -561,6 +561,33 @@ + + + + +
+

+ {{ $i18n.get("info_related_items") }} +

+
+ + + +
+ @@ -800,6 +827,7 @@ import { eventBusItemMetadata } from '../../js/event-bus-item-metadata'; import wpMediaFrames from '../../js/wp-media-frames'; import FileItem from '../other/file-item.vue'; import DocumentItem from '../other/document-item.vue'; +import RelatedItemsList from '../lists/related-items-list.vue'; import CustomDialog from '../other/custom-dialog.vue'; import AttachmentsList from '../lists/attachments-list.vue'; import { formHooks } from '../../js/mixins'; @@ -811,6 +839,7 @@ export default { FileItem, DocumentItem, AttachmentsList, + RelatedItemsList, ItemMetadatumErrorsTooltip }, mixins: [ formHooks ], @@ -873,6 +902,9 @@ export default { totalAttachments() { return this.getTotalAttachments(); }, + totalRelatedItems() { + return (this.item && this.item.related_items) ? Object.values(this.item.related_items).reduce((totalItems, aRelatedItemsGroup) => totalItems + parseInt(aRelatedItemsGroup.total_items), 0) : false; + }, formErrors() { return eventBusItemMetadata && eventBusItemMetadata.errors && eventBusItemMetadata.errors.length ? eventBusItemMetadata.errors : [] } @@ -1501,7 +1533,7 @@ export default { this.fetchItem({ itemId: this.itemId, contextEdit: true, - fetchOnly: 'title,thumbnail,status,modification_date,document_type,document,comment_status,document_as_html' + fetchOnly: 'title,thumbnail,status,modification_date,document_type,document,comment_status,document_as_html,related_items' }) .then((resp) => { resp.request.then((res) => { diff --git a/src/views/admin/components/lists/related-items-list.vue b/src/views/admin/components/lists/related-items-list.vue new file mode 100644 index 000000000..8bec23d4a --- /dev/null +++ b/src/views/admin/components/lists/related-items-list.vue @@ -0,0 +1,240 @@ + + + + + diff --git a/src/views/admin/pages/singles/item-page.vue b/src/views/admin/pages/singles/item-page.vue index 27dbf815e..5266c1eb7 100644 --- a/src/views/admin/pages/singles/item-page.vue +++ b/src/views/admin/pages/singles/item-page.vue @@ -253,7 +253,7 @@