Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/model/class_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
'name': 'event',
'label': _('event'),
'classes': [
'activity', 'acquisition', 'modification', 'move', 'production'],
'activity', 'acquisition', 'creation', 'modification', 'move',
'production'],
'table_columns':
['name', 'class', 'type', 'begin', 'end', 'description'],
'icon': 'mdi-calendar'},
Expand Down
11 changes: 11 additions & 0 deletions config/model/classes/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@
'mode': 'direct',
'multiple': True}}

creation: dict[str, Any] = copy.deepcopy(class_)
creation['label'] = _('creation')
creation['display']['tooltip'] = _('creation of conceptual items')
creation['relations'] = creation['relations'] | {
'created_source': {
'label': _('created source'),
'classes': ['source'],
'property': 'P94',
'multiple': True,
'mode': 'direct'}}

modification: dict[str, Any] = copy.deepcopy(class_)
modification['label'] = _('modification')
modification['display']['tooltip'] = _('modification of items')
Expand Down
9 changes: 8 additions & 1 deletion config/model/classes/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@
'buttons': ['link', 'insert'],
'tooltip': _('mentioned in the source')}},
'reference': standard_relations['reference'],
'file': standard_relations['file']},
'file': standard_relations['file'],
'source_creation': {
'label': _('creation event'),
'classes': ['creation'],
'property': 'P94',
'inverse': True,
'mode': 'direct',
'tooltip': _('Links the creation event of the source')}},
'display': {
'buttons': ['copy'],
'form_buttons': ['insert_and_continue'],
Expand Down
1 change: 1 addition & 0 deletions config/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'alias': {'attributes': {}},
'artifact': item.artifact,
'bibliography': reference.bibliography,
'creation': event.creation,
'edition': reference.edition,
'external_reference': reference.external_reference,
'feature': place.feature,
Expand Down
1 change: 1 addition & 0 deletions install/4_data_type.sql
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ INSERT INTO model.openatlas_class (name, cidoc_class_code, new_types_allowed, wr
('alias', 'E41', false, 'contributor', NULL),
('artifact', 'E22', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Artifact' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)),
('bibliography', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Bibliography' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)),
('creation', 'E65', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)),
('edition', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Edition' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)),
('external_reference', 'E31', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'External reference' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)),
('feature', 'E18', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Feature' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1)),
Expand Down
9 changes: 7 additions & 2 deletions install/upgrade/9.5.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ BEGIN;
-- Raise database version
UPDATE web.settings SET value = '9.5.0' WHERE name = 'database_version';

-- Remove cidoc_class_code FROM model.entity
ALTER TABLE model.entity DROP COLUMN IF EXISTS cidoc_class_code;
-- Add creation event for sources (#2743)
INSERT INTO model.openatlas_class (name, cidoc_class_code, new_types_allowed, write_access_group_name, standard_type_id) VALUES
('creation', 'E65', true, 'contributor', (SELECT id FROM model.entity WHERE name = 'Event' AND openatlas_class_name = 'type' ORDER BY id ASC LIMIT 1));

INSERT INTO web.hierarchy_openatlas_class (hierarchy_id, openatlas_class_name) VALUES
((SELECT id FROM web.hierarchy WHERE name='Event'), 'creation');

-- Remove cidoc_class_code FROM model.entity (#2875)
ALTER TABLE model.entity DROP COLUMN IF EXISTS cidoc_class_code;
DROP FUNCTION IF EXISTS model.delete_entity_related() CASCADE;

CREATE FUNCTION model.delete_entity_related() RETURNS trigger
Expand Down
Loading