Closed bjendres closed 1 year ago
For the record: old change activities can be converted with the following pattern:
UPDATE civicrm_activity
SET details = REGEXP_REPLACE(details, "<tr>[\\r\\n\\s]+<td>[LOCALISED_LABEL]</td>", "<tr class=\"xcm-[ATTRIBUTE_NAME]\"><td>[LOCALISED_LABEL]</td>")
WHERE details REGEXP "<tr>[\\r\\n\\s]+<td>[LOCALISED_LABEL]</td>"
AND activity_type_id IN (CHANGE_ACTIVITY_TYPE_IDS)
AND status_id IN (ACTIVE STATUS_IDS)
e.g.
UPDATE civicrm_activity
SET details = REGEXP_REPLACE(details, "<tr>[\\r\\n\\s]+<td>Stadt</td>", "<tr class=\"xcm-city\"><td>Stadt</td>")
WHERE details REGEXP "<tr>[\\r\\n\\s]+<td>Stadt</td>"
AND activity_type_id IN (CHANGE_ACTIVITY_TYPE_IDS)
AND status_id IN (ACTIVE STATUS_IDS)
This has then to be looped through all attributes and (localised) labels.
Implementing this, however, is currently beyond our budget.
It seems that the hacky "diff helper" JS module doesn't work in a localised environment, because it cannot determine the attribute name any more - see HERE and HERE.
The right way to do it would be to add the attribute name as a property to the table row.