retrieve_view_from_coll_id($coll_id); if(empty($view)) { $view = $sec->retrieve_table_from_coll($coll_id); } $db = new dbquery(); $db->connect(); //$db->query("select docserver_id, path, filename from ".$view." where res_id = ".$res_id); $db->query("select docserver_id from res_view_attachments where res_id_master = " . $res_id . " order by res_id desc"); while ($res = $db->fetch_object()) { $docserver_id = $res->docserver_id; break; } $db->query("select path_template from ".$_SESSION['tablename']['docservers']." where docserver_id = '".$docserver_id."'"); $res = $db->fetch_object(); $docserver_path = $res->path_template; $db->query("select filename, path,title,res_id,res_id_version,attachment_type from res_view_attachments where res_id_master = " . $res_id . " AND status <> 'OBS' AND status <> 'SIGN' AND status <> 'DEL' and attachment_type IN ('response_project','signed_response') order by creation_date asc"); $array_reponses = array(); $cpt_rep = 0; while ($res2 = $db->fetch_object()){ $filename=$res2->filename; $path = preg_replace('/#/', DIRECTORY_SEPARATOR, $res2->path); $filename_pdf = str_replace(pathinfo($filename, PATHINFO_EXTENSION), "pdf",$filename); if (file_exists($docserver_path.$path.$filename_pdf)){ $array_reponses[$cpt_rep]['path'] = $docserver_path.$path.$filename_pdf; $array_reponses[$cpt_rep]['title'] = $res2->title; $array_reponses[$cpt_rep]['attachment_type'] = $res2->attachment_type; if ($res2->res_id_version == 0){ $array_reponses[$cpt_rep]['res_id'] = $res2->res_id; $array_reponses[$cpt_rep]['is_version'] = 0; } else{ $array_reponses[$cpt_rep]['res_id'] = $res2->res_id_version; $array_reponses[$cpt_rep]['is_version'] = 1; } $cpt_rep++; } } return $array_reponses; } /*************/ $res_id = $_REQUEST['res_id']; $coll_id = $_REQUEST['coll_id']; require_once "modules" . DIRECTORY_SEPARATOR . "visa" . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . "class_modules_tools.php"; include('apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'definition_mail_categories.php'); require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php"); $core =new core_tools(); $data = get_general_data($coll_id, $res_id, 'minimal'); /* Partie centrale */ // AVANCEMENT $avancement_html = ''; $avancement_html .= '