Skip to content
Snippets Groups Projects
Commit 05655dde authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #15370 TIME 0:45 fix dest_user reset migration

parent 8ff297de
No related branches found
No related tags found
No related merge requests found
......@@ -345,17 +345,11 @@ ALTER TABLE custom_fields ADD COLUMN mode custom_fields_modes NOT NULL DEFAULT '
ALTER TABLE listinstance DROP COLUMN IF EXISTS delegate;
ALTER TABLE listinstance ADD COLUMN delegate INTEGER;
/* Replace dest_user with the dest in listinstance, if the dests are differents */
/* Replace dest_user with the dest in listinstance */
UPDATE res_letterbox
SET dest_user = (
SELECT item_id FROM listinstance
WHERE item_mode = 'dest' AND item_type = 'user_id' AND listinstance.res_id = res_letterbox.res_id
)
WHERE res_id IN (
SELECT res_letterbox.res_id
FROM res_letterbox
JOIN listinstance l ON res_letterbox.res_id = l.res_id
WHERE dest_user != item_id AND item_type ='user_id' AND item_mode='dest'
);
......
......@@ -156,9 +156,9 @@ foreach ($customs as $custom) {
$query[] = ['identifier' => 'groupSign', 'values' => ['id' => $group['id'], 'label' => $group['group_desc'],'group' => '']];
}
} elseif ($key == 'closing_date') {
$query[] = ['identifier' => 'closingDate', 'values' => ['start' => getFormattedDate($value['fields']['closing_date_from'][0]), 'end' => getFormattedDate($value['fields']['closing_date_to'][0])]];
$query[] = ['identifier' => 'closingDate', 'values' => ['start' => getFormattedDate(['date' => $value['fields']['closing_date_from'][0]]), 'end' => getFormattedDate(['date' => $value['fields']['closing_date_to'][0]])]];
} elseif ($key == 'creation_date_pj') {
$query[] = ['identifier' => 'attachment_creationDate', 'values' => ['start' => getFormattedDate($value['fields']['creation_date_pj_from'][0]), 'end' => getFormattedDate($value['fields']['creation_date_pj_to'][0])]];
$query[] = ['identifier' => 'attachment_creationDate', 'values' => ['start' => getFormattedDate(['date' => $value['fields']['creation_date_pj_from'][0]]), 'end' => getFormattedDate(['date' => $value['fields']['creation_date_pj_to'][0]])]];
} elseif ($key == 'attachment_types') {
$types = \Attachment\models\AttachmentModel::getAttachmentsTypesByXML();
if (in_array($value['fields']['attachment_types'][0], array_keys($types))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment