From 6dedc24378afcf8c7dc9a42a692cc56aa3532b71 Mon Sep 17 00:00:00 2001 From: Alex Orluc <alex.orluc@maarch.org> Date: Thu, 28 Jul 2016 13:33:59 +0000 Subject: [PATCH] FEAT #4438 exlude converted_pdf and print_folder in sql --- visa/trunk/class/class_modules_tools_Abstract.php | 6 +++--- visa/trunk/lang/fr.php | 6 ++++++ visa/trunk/save_attach_res_from_cm.php | 9 ++++++--- visa/trunk/sign_file.php | 5 +++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/visa/trunk/class/class_modules_tools_Abstract.php b/visa/trunk/class/class_modules_tools_Abstract.php index 338a7d07c16..adb8e1864ea 100644 --- a/visa/trunk/class/class_modules_tools_Abstract.php +++ b/visa/trunk/class/class_modules_tools_Abstract.php @@ -145,8 +145,8 @@ abstract class visa_Abstract extends Database $stmt = $db->query("select filename, format, path, title, res_id, res_id_version, attachment_type " . "from res_view_attachments where res_id_master = ? AND status <> 'OBS' AND status <> 'SIGN' " - . "AND status <> 'DEL' and attachment_type IN " - . "('response_project','signed_response','outgoing_mail','waybill','transfer', 'simple_attachment', 'envelope', 'transmission', 'aihp', 'record_traffic', 'sva', 'svr') order by creation_date desc", + . "AND status <> 'DEL' and attachment_type NOT IN " + . "('converted_pdf','print_folder') order by creation_date desc", array($res_id)); $array_reponses = array(); @@ -199,7 +199,7 @@ abstract class visa_Abstract extends Database $this->errorMessageVisa = null; $db = new Database(); - $stmt = $db->query("SELECT * FROM res_attachments WHERE res_id_master = ? AND coll_id = ? AND status NOT IN ('DEL','OBS') AND attachment_type IN ('response_project', 'print_folder', 'signed_response','outgoing_mail','waybill','transfer', 'simple_attachment', 'envelope', 'transmission', 'aihp', 'sva', 'svr') ", array($res_id, $coll_id)); + $stmt = $db->query("SELECT * FROM res_attachments WHERE res_id_master = ? AND coll_id = ? AND status NOT IN ('DEL','OBS') AND attachment_type NOT IN ('converted_pdf','print_folder') ", array($res_id, $coll_id)); if ($stmt->rowCount() <= 0) { $this->errorMessageVisa = _NO_RESPONSE_PROJECT_VISA; return false; diff --git a/visa/trunk/lang/fr.php b/visa/trunk/lang/fr.php index a5946788086..58ee914a5a0 100644 --- a/visa/trunk/lang/fr.php +++ b/visa/trunk/lang/fr.php @@ -122,3 +122,9 @@ if (!defined("_NO_NEXT_STEP_VISA")) if (!defined("_VISA_USERS")) define("_VISA_USERS", "Personne(s) pour visa / signature"); + +if (!defined("_TMP_SIGNED_FILE_FAILED")) + define("_TMP_SIGNED_FILE_FAILED", "Echec de la génération document avec signature"); + +if (!defined("_ENCRYPTED")) + define("_ENCRYPTED", "crypté"); \ No newline at end of file diff --git a/visa/trunk/save_attach_res_from_cm.php b/visa/trunk/save_attach_res_from_cm.php index 39ca809fc55..6de210aab18 100644 --- a/visa/trunk/save_attach_res_from_cm.php +++ b/visa/trunk/save_attach_res_from_cm.php @@ -21,13 +21,16 @@ $docserver = $docserverControler->getDocserverToInsert( ); - - if (empty($docserver)) { $_SESSION['error'] = _DOCSERVER_ERROR . ' : ' - . _NO_AVAILABLE_DOCSERVER . '. ' . _MORE_INFOS; + . _IMG_SIGN_MISSING . '. ' . _MORE_INFOS; } else { // some checking on docserver size limit + if(!is_file($_SESSION['config']['tmppath'] . $tmpFileName)){ + echo "{status:1, error : '". _TMP_SIGNED_FILE_FAILED . ': ' ._FILE . ' ' . _ENCRYPTED .' ' . _OR .' ' . _MISSING ."'}"; + exit; + } + $newSize = $docserverControler->checkSize( $docserver, filesize($_SESSION['config']['tmppath'] . $tmpFileName) ); diff --git a/visa/trunk/sign_file.php b/visa/trunk/sign_file.php index 5129085a58f..5612c84d96f 100644 --- a/visa/trunk/sign_file.php +++ b/visa/trunk/sign_file.php @@ -35,14 +35,15 @@ if (!empty($_REQUEST['id']) && !empty($_REQUEST['collId'])){ $stmt = $db->query("select res_id_version, format, res_id_master, title, identifier, type_id, attachment_type from " . $tableName - . " where (attachment_type = ? or attachment_type = ? or attachment_type = ? or attachment_type = ? or attachment_type = 'transfer') and res_id_version = ?", array('response_project', 'outgoing_mail', 'sva', 'waybill', $objectId)); + . " where attachment_type NOT IN ('converted_pdf','print_folder') and res_id_version = ?", array($objectId)); + } elseif (isset($_REQUEST['isOutgoing'])) { $stmt = $db->query("select res_id, format, res_id_master, title, identifier, type_id, attachment_type from " . $tableName . " where attachment_type = ? and res_id = ?", array('outgoing_mail', $objectId)); } else { - $stmt = $db->query("select res_id, format, res_id_master, title, identifier, type_id, attachment_type from ".$tableName." where (attachment_type = ? or attachment_type = ? or attachment_type = ? or attachment_type = ? or attachment_type = 'transfer') and res_id = ?", array('svr','sva', 'response_project','waybill', $objectId)); + $stmt = $db->query("select res_id, format, res_id_master, title, identifier, type_id, attachment_type from ".$tableName." where (attachment_type NOT IN ('converted_pdf','print_folder')) and res_id = ?", array($objectId)); } if ($stmt->rowCount() < 1) { -- GitLab