diff --git a/apps/maarch_entreprise/indexing_searching/view_resource_controler.php b/apps/maarch_entreprise/indexing_searching/view_resource_controler.php index 153870105b16300913704fac000015432e5e58bd..7a9686041a76b711cf3dc66c602fd91837125e25 100755 --- a/apps/maarch_entreprise/indexing_searching/view_resource_controler.php +++ b/apps/maarch_entreprise/indexing_searching/view_resource_controler.php @@ -117,6 +117,19 @@ if ($s_id == '') { $res_outgoing = $stmt->fetchObject(); if ($res_outgoing->category_id == 'outgoing' && $res_outgoing->source == 'with_empty_file') { + if(!empty($_REQUEST['editingMode'])){ + $stmt = $db->query("SELECT res_id FROM res_view_attachments WHERE status <> 'DEL' and status <> 'OBS' " + . "and res_id_master = ? and coll_id = ? " + . "and attachment_type = 'outgoing_mail' order by res_id desc", + array($s_id, $_SESSION['collection_id_choice'])); + $res_att = $stmt->fetchObject(); + if ($stmt->rowCount() > 0) { ?> + <script type="text/javascript"> + window.location.href = 'index.php?display=true&editingMode=true&module=attachments&page=view_attachment&res_id_master=<?php echo $s_id;?>&id=<?php echo $res_att->res_id;?>' + </script> + <?php exit(); + } + } else { $stmt = $db->query("SELECT res_id FROM res_view_attachments WHERE status <> 'DEL' and status <> 'OBS' " . "and res_id_master = ? and coll_id = ? and ((attachment_type = 'converted_pdf' and type_id = 1) " . "OR (attachment_type = 'outgoing_mail' and format = 'pdf')" @@ -151,6 +164,7 @@ if ($s_id == '') { exit(); } } + } } } diff --git a/modules/attachments/attachments_content.php b/modules/attachments/attachments_content.php index 6d4c9395c5ad2e0abf40b4af63859bc06fea0360..a77a597d59c49869f4c278efa7e855fea22ef83c 100755 --- a/modules/attachments/attachments_content.php +++ b/modules/attachments/attachments_content.php @@ -2075,7 +2075,7 @@ if(empty($_REQUEST['id'])){ $content .= '<iframe src="'.$srcAttachment.'" name="viewframevalid_attachment" id="viewframevalid_attachment" scrolling="auto" frameborder="0" style="width:100% !important;height:90vh;display:none" onmouseover="this.focus()"></iframe>'; // DOCUMENT PRINCIPAL // -$content .= '<iframe src="index.php?display=true&dir=indexing_searching&page=view_resource_controler&id='. functions::xssafe($_SESSION['doc_id']).'" name="viewframevalid_main" id="viewframevalid_main" scrolling="auto" frameborder="0" style="width:100% !important;height:90vh;display:none" onmouseover="this.focus()"></iframe>'; +$content .= '<iframe src="index.php?display=true&editingMode=true&dir=indexing_searching&page=view_resource_controler&id='. functions::xssafe($_SESSION['doc_id']).'" name="viewframevalid_main" id="viewframevalid_main" scrolling="auto" frameborder="0" style="width:100% !important;height:90vh;display:none" onmouseover="this.focus()"></iframe>'; $content .= '</div>'; diff --git a/modules/attachments/view_attachment.php b/modules/attachments/view_attachment.php index a05c039a8c7846f4ec3d457e7dbebca6a3c42d1a..b66f9e06baf05f53cc6760723b62441b9712f30c 100755 --- a/modules/attachments/view_attachment.php +++ b/modules/attachments/view_attachment.php @@ -130,7 +130,7 @@ if (! empty($_SESSION['error'])) { $stmtPdf = $db->query( "SELECT docserver_id, path, filename, format, title FROM res_view_attachments - WHERE filename=? AND status = 'TRA'", array(substr($line->filename, 0, strrpos($line->filename, ".")).'.pdf') + WHERE filename=? AND (status = 'TRA' or status = 'A_TRA')", array(substr($line->filename, 0, strrpos($line->filename, ".")).'.pdf') ); $linePdf = $stmtPdf->fetchObject(); if(!empty($linePdf)){