* @date $date$ * @version $Revision$ * @ingroup apps */ /** * $confirm bool false */ $confirm = false; /** * $etapes array Contains only one etap : form */ $etapes = array('form'); /** * $frm_width Width of the modal (empty) */ $frm_width=''; /** * $frm_height Height of the modal (empty) */ $frm_height = ''; /** * $mode_form Mode of the modal : fullscreen */ $mode_form = 'fullscreen'; include('apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'definition_mail_categories.php'); require_once "modules" . DIRECTORY_SEPARATOR . "visa" . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . "class_modules_tools.php"; $_ENV['date_pattern'] = "/^[0-3][0-9]-[0-1][0-9]-[1-2][0-9][0-9][0-9]$/"; function writeLogIndex($EventInfo) { $logFileOpened = fopen($_SESSION['config']['logdir']."visa_mail.log", 'a'); fwrite($logFileOpened, '[' . date('d') . '/' . date('m') . '/' . date('Y') . ' ' . date('H') . ':' . date('i') . ':' . date('s') . '] ' . $EventInfo . "\r\n" ); fclose($logFileOpened); } function check_category($coll_id, $res_id) { require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_security.php"); $sec = new security(); $view = $sec->retrieve_view_from_coll_id($coll_id); $db = new Database(); $stmt = $db->query("SELECT category_id FROM ".$view." WHERE res_id = ?", array($res_id)); $res = $stmt->fetchObject(); if(!isset($res->category_id)) { $ind_coll = $sec->get_ind_collection($coll_id); $table_ext = $_SESSION['collections'][$ind_coll]['extensions'][0]; $db->query("INSERT INTO ".$table_ext." (res_id, category_id) VALUES (?, ?)", array($res_id, $_SESSION['coll_categories']['letterbox_coll']['default_category'])); } } function get_form_txt($values, $path_manage_action, $id_action, $table, $module, $coll_id, $mode ) { if (preg_match("/MSIE 6.0/", $_SERVER["HTTP_USER_AGENT"])) { $browser_ie = true; $display_value = 'block'; } elseif(preg_match('/msie/i', $_SERVER["HTTP_USER_AGENT"]) && !preg_match('/opera/i', $_SERVER["HTTP_USER_AGENT"]) ) { $browser_ie = true; $display_value = 'block'; } else { $browser_ie = false; $display_value = 'table-row'; } unset($_SESSION['m_admin']['contact']); $_SESSION['req'] = "action"; $res_id = $values[0]; $_SESSION['doc_id'] = $res_id; // Ouverture de la modal $docLockerCustomPath = 'apps/maarch_entreprise/actions/docLocker.php'; $docLockerPath = $_SESSION['config']['businessappurl'] . '/actions/docLocker.php'; if (is_file($docLockerCustomPath)) require_once $docLockerCustomPath; else if (is_file($docLockerPath)) require_once $docLockerPath; else exit("can't find docLocker.php"); $docLocker = new docLocker($res_id); if (!$docLocker->canOpen()) { $docLockerscriptError = ''; return $docLockerscriptError; } $frm_str = ''; require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_security.php"); require_once("apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_business_app_tools.php"); require_once("modules".DIRECTORY_SEPARATOR."basket".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_modules_tools.php"); require_once("apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_types.php"); require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php"); $sec =new security(); $core_tools =new core_tools(); $b = new basket(); $type = new types(); $business = new business_app_tools(); $visa = new visa(); /*check_category($coll_id, $res_id); $data = get_general_data($coll_id, $res_id, 'minimal');*/ /* echo '
';
print_r($data);
echo '';exit;
*/
$db = new Database();
$view = $sec->retrieve_view_from_coll_id($coll_id);
$stmt = $db->query("select alt_identifier, status from "
. $view
. " where res_id = ?", array($res_id));
$resChrono = $stmt->fetchObject();
$chrono_number = $resChrono->alt_identifier;
$currentStatus = $resChrono->status;
$frm_str .= ''.print_r($tab_docs,true).''; //$selectedCat = ''; $list_docs = ''; foreach($tab_docs as $num=>$res_id_doc){ $stmt = $db->query("select alt_identifier, status from " . $view . " where res_id = ?" , array($res_id_doc)); $resChrono_doc = $stmt->fetchObject(); $chrono_number_doc = $resChrono_doc->alt_identifier; $allAnsSigned = true; $stmt2 = $db->query("SELECT status from res_view_attachments where (attachment_type='response_project' OR attachment_type='outgoing_mail') and res_id_master = ?", array($res_id_doc)); while($line = $stmt2->fetchObject()){ if ($line->status == 'TRA' || $line->status == 'A_TRA' ){ $allAnsSigned = false; } } if ($allAnsSigned) $classSign = "visibility:visible;"; else $classSign = "visibility:hidden;"; $list_docs .= $res_id_doc."#"; if ($res_id_doc == $res_id){ $classLine = ' class="selectedId " '; } else $classLine = ' class="unselectedId " '; $id_to_display = _ID_TO_DISPAY; $frm_str .= '