Skip to content
Snippets Groups Projects
Verified Commit b8aeb96a authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FIX #8346 delete convert only if pj is edited and pdf convert is OK

parent 4dbb36b4
No related branches found
No related tags found
No related merge requests found
......@@ -939,16 +939,20 @@ if (isset($_POST['add']) && $_POST['add']) {
//UPDATE QUERY
if ((int) $_REQUEST['relation'] == 1) {
$stmt = $db->query('UPDATE res_attachments SET '.$set_update.' WHERE res_id = :res_id', $arrayPDO);
\Convert\models\AdrModel::deleteAttachAdr([
'resId' => $_REQUEST['res_id'],
'isVersion' => false
]);
if ($_SESSION['upfile'][0]['fileNamePdfOnTmp'] != '' && $_SESSION['upfile'][0]['upAttachment'] != false) {
\Convert\models\AdrModel::deleteAttachAdr([
'resId' => $_REQUEST['res_id'],
'isVersion' => false
]);
}
} else {
$stmt = $db->query('UPDATE res_version_attachments SET '.$set_update.' WHERE res_id = :res_id', $arrayPDO);
\Convert\models\AdrModel::deleteAttachAdr([
'resId' => $_REQUEST['res_id'],
'isVersion' => true
]);
if ($_SESSION['upfile'][0]['fileNamePdfOnTmp'] != '' && $_SESSION['upfile'][0]['upAttachment'] != false) {
\Convert\models\AdrModel::deleteAttachAdr([
'resId' => $_REQUEST['res_id'],
'isVersion' => true
]);
}
}
}
//copie de la version PDF de la pièce si mode de conversion sur le client
......
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