. */ /** * File : details.php * * Detailed informations on an indexed document * * @package indexing_searching * @version 1.3 * @since 10/2005 * @license GPL * @author Claire Figueras */ $core = new core_tools(); $core->test_user(); $core->load_lang(); require_once 'core/manage_bitmask.php'; require_once 'core/class/class_request.php'; require_once 'core/class/class_security.php'; require_once 'apps/' . $_SESSION['config']['app_id'] . '/security_bitmask.php'; require_once 'apps/' . $_SESSION['config']['app_id'] . '/class/class_list_show.php'; require_once 'core/class/class_history.php'; require_once 'core/class/LinkController.php'; require_once 'apps/' . $_SESSION['config']['app_id'] . '/class/class_indexing_searching_app.php'; require_once 'apps/' . $_SESSION['config']['app_id'] . '/class/class_types.php'; if (file_exists( $_SESSION['config']['corepath'] . 'custom/apps/' . $_SESSION['config']['app_id'] . '/definition_mail_categories.php' ) ) { $path = $_SESSION['config']['corepath'] . 'custom/apps/' . $_SESSION['config']['app_id'] . '/definition_mail_categories.php'; } else { $path = 'apps/' . $_SESSION['config']['app_id'] . '/definition_mail_categories.php'; } include_once $path; //test service print_details $printDetails = false; if ($core->test_service('print_details', 'apps', false)) { $printDetails = true; } //test service put_in_validation $putInValid = false; if ($core->test_service('put_in_validation', 'apps', false)) { $putInValid = true; } //test service view technical infos $viewTechnicalInfos = false; if ($core->test_service('view_technical_infos', 'apps', false)) { $viewTechnicalInfos = true; } //test service add new version $addNewVersion = false; if ($core->test_service('add_new_version', 'apps', false)) { $addNewVersion = true; } //test service view_emails_notifs // $viewEmailsNotifs = false; // if ($core->test_service('view_emails_notifs', 'notifications', false)) { // $viewEmailsNotifs = true; // } if (!isset($_REQUEST['coll_id'])) { $_REQUEST['coll_id'] = ''; } $_SESSION['doc_convert'] = array(); $_SESSION['save_list']['fromDetail'] = "true"; //var_dump($_SESSION['save_list']['fromDetail']); /****************Management of the location bar ************/ $init = false; if (isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == 'true') { $init = true; } if (isset($_SESSION['indexation'] ) && $_SESSION['indexation'] == true) { $init = true; } $level = ''; if ( isset($_REQUEST['level']) && ( $_REQUEST['level'] == 2 || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4 || $_REQUEST['level'] == 1 ) ) { $level = $_REQUEST['level']; } $page_path = $_SESSION['config']['businessappurl'] . 'index.php?page=details&dir=indexing_searching&coll_id=' . $_REQUEST['coll_id'] . '&id=' . $_REQUEST['id']; $page_label = _DETAILS; $page_id = 'details'; $core->manage_location_bar($page_path, $page_label, $page_id, $init, $level); /***********************************************************/ $hist = new history(); $security = new security(); $func = new functions(); $request= new request; $type = new types(); $s_id = ''; $_SESSION['req'] ='details'; $_SESSION['indexing'] = array(); $is = new indexing_searching_app(); $coll_id = ''; $table = ''; if (!isset($_REQUEST['coll_id']) || empty($_REQUEST['coll_id'])) { //$_SESSION['error'] = _COLL_ID.' '._IS_MISSING; $coll_id = $_SESSION['collections'][0]['id']; $table = $_SESSION['collections'][0]['view']; $is_view = true; } else { $coll_id = $_REQUEST['coll_id']; $table = $security->retrieve_view_from_coll_id($coll_id); $is_view = true; if (empty($table)) { $table = $security->retrieve_table_from_coll($coll_id); $is_view = false; } } $_SESSION['collection_id_choice'] = $coll_id; $_SESSION['current_basket']['coll_id'] = $coll_id; if (isset($_GET['id']) && !empty($_GET['id'])) { $s_id = addslashes($func->wash($_GET['id'], 'num', _THE_DOC)); } $db = new dbquery(); $db->connect(); $db->query("select res_id from mlb_coll_ext where res_id = " . $s_id); if ($db->nb_result() <= 0) { echo '
' . _QUALIFY_FIRST . '
';exit; ?> test_right_doc($coll_id, $s_id); //$_SESSION['error'] = 'coll '.$coll_id.', res_id : '.$s_id; if (!$right) { ?> add( $table, $s_id , 'VIEW', 'resview', _VIEW_DETAILS_NUM . $s_id, $_SESSION['config']['databasetype'], 'apps' ); } $modify_doc = check_right( $_SESSION['user']['security'][$coll_id]['DOC']['securityBitmask'], DATA_MODIFICATION ); $delete_doc = check_right( $_SESSION['user']['security'][$coll_id]['DOC']['securityBitmask'], DELETE_RECORD ); //update index with the doctype if (isset($_POST['submit_index_doc'])) { if ( $core->is_module_loaded('entities') && is_array($_SESSION['details']['diff_list']) ) { require_once('modules/entities/class/class_manage_listdiff.php'); $list = new diffusion_list(); $params = array( 'mode'=> 'listinstance', 'table' => $_SESSION['tablename']['ent_listinstance'], 'coll_id' => $coll_id, 'res_id' => $s_id, 'user_id' => $_SESSION['user']['UserId'], 'concat_list' => true, 'only_cc' => false ); $list->load_list_db( $_SESSION['details']['diff_list'], $params ); //pb enchainement avec action redirect $_SESSION['details']['diff_list']['key_value'] = md5($res_id); } $is->update_mail($_POST, 'POST', $s_id, $coll_id); if ($core->is_module_loaded('tags')) { include_once("modules".DIRECTORY_SEPARATOR."tags".DIRECTORY_SEPARATOR."tags_update.php"); } } //delete the doctype if (isset($_POST['delete_doc'])) { $is ->delete_doc($s_id, $coll_id); ?> update_doc_status($s_id, $coll_id, 'VAL'); ?> query("select type_id from ".$table." where res_id = ".$s_id); if ($db->nb_result() > 0) { $res = $db->fetch_object(); $type_id = $res->type_id; $indexes = $type->get_indexes($type_id, $coll_id, 'minimal'); for($i=0;$iis_module_loaded('cases') == true) { $case_sql_complementary = " , case_id"; } $db->query( "select status, format, typist, creation_date, fingerprint, filesize, " . "res_id, work_batch, page_count, is_paper, scan_date, scan_user, " . "scan_location, scan_wkstation, scan_batch, source, doc_language, " . "description, closing_date, alt_identifier, initiator, entity_label " . $comp_fields . $case_sql_complementary . " from " . $table . " where res_id = " . $s_id ); //$db->show(); } ?>

(retrieve_coll_label_from_coll_id($coll_id); ?>)







nb_result() == 0) { ?>


.


true, 'img_priority' => true, 'img_type_id' => true, 'img_doc_date' => true, 'img_admission_date' => true, 'img_nature_id' => true, 'img_subject' => true, 'img_process_limit_date' => true, 'img_author' => true, 'img_destination' => true, 'img_arbox_id' => true, 'img_folder' => true ); $res = $db->fetch_object(); $typist = $res->typist; $format = $res->format; $filesize = $res->filesize; $creation_date = $db->format_date_db($res->creation_date, false); $chrono_number = $res->alt_identifier; $initiator = $res->initiator; $fingerprint = $res->fingerprint; $work_batch = $res->work_batch; $page_count = $res->page_count; $is_paper = $res->is_paper; $scan_date = $db->format_date_db($res->scan_date); $scan_user = $res->scan_user; $scan_location = $res->scan_location; $scan_wkstation = $res->scan_wkstation; $scan_batch = $res->scan_batch; $doc_language = $res->doc_language; $closing_date = $db->format_date_db($res->closing_date, false); $indexes = $type->get_indexes($type_id, $coll_id); $entityLabel = $res->entity_label; $dbUser = new dbquery(); $queryUser = "select firstname, lastname from users where user_id = '" . $typist ."'"; $dbUser->query($queryUser); $dbEntities = new dbquery(); $queryEntities = "select entity_label from entities where entity_id = '" . $initiator . "'"; $dbEntities->query($queryEntities); $resultEntities = $dbEntities->fetch_object(); $entities = $resultEntities->entity_label; $resultUser = $dbUser->fetch_object(); if ($resultUser->lastname <> '') { $typistLabel = $resultUser->firstname . ' ' . $resultUser->lastname; } else { $typistLabel = $typist; } if ($core->is_module_loaded('cases') == true) { require_once('modules/cases/class/class_modules_tools.php'); $case = new cases(); if ($res->case_id <> '') $case_properties = $case->get_case_info($res->case_id); } //$db->show_array($indexes); foreach (array_keys($indexes) as $key) { if (preg_match('/^custom/', $key)) { $tmp = 'doc_' . $key; } else{ $tmp = $key; } if ($indexes[$key]['type'] == "date") { $res->$tmp = $db->format_date_db($res->$tmp, false); } $indexes[$key]['value'] = $res->$tmp; $indexes[$key]['show_value'] = $res->$tmp; if ($indexes[$key]['type'] == "string") { $indexes[$key]['show_value'] = $db->show_string($res->$tmp); } elseif ($indexes[$key]['type'] == "date") { $indexes[$key]['show_value'] = $db->format_date_db($res->$tmp, true); } } //$db->show_array($indexes); $process_data = $is->get_process_data($coll_id, $s_id); $status = $res->status; if (!empty($status)) { require_once('core/class/class_manage_status.php'); $status_obj = new manage_status(); $res_status = $status_obj->get_status_data($status); if ($modify_doc) { $can_be_modified = $status_obj->can_be_modified($status); if (!$can_be_modified) { $modify_doc = false; } } } $mode_data = 'full'; if ($modify_doc) { $mode_data = 'form'; } foreach (array_keys($indexes) as $key) { $indexes[$key]['opt_index'] = true; if ($indexes[$key]['type_field'] == 'select') { for($i=0;$ishow_array($indexes); $detailsExport = ''; $detailsExport .= ''; $detailsExport .= "Maarch Details"; $detailsExport .= ""; ?>

' . _BACK . ''; }else{ echo '' . _BACK . ''; }*/ echo '' . _BACK . ''; } } ?>

<?php echo _VIEW_DOC;?> 

 

"._DETAILS_PRINT." : ".$s_id."

";?>

"._FILE_DATA."

";?>
"; ?> "; ?> "") { $folderTmp = $data[$key]['show_value']; $find1 = strpos($folderTmp, '('); $folder_id = substr($folderTmp, $find1, strlen($folderTmp)); $folder_id = str_replace("(", "", $folder_id); $folder_id = str_replace(")", "", $folder_id); } //$detailsExport .= ""; ?> "; $detailsExport .= ""; ?>  "; echo ''; } } $i++; } $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; ?>
"; ?> "; if ($folder_id <> "") { echo ""; ?> <?php echo $data[$key]['label'];?> <?php echo $data[$key]['label'];?> "; ?> : "; ?> ' .$data[$key]['show_value'] .''; } else { ?> ' .$data[$key]['show_value'] .''; } else if ($data[$key]['field_type'] == 'date') { ?>
"; ?>
 
"; $detailsExport .= _STATUS; $detailsExport .= ""; $detailsExport .= $res_status['LABEL']; $detailsExport .= ""; $detailsExport .= _CHRONO_NUMBER; $detailsExport .= ""; $detailsExport .= $chrono_number; $detailsExport .= "
<?php echo _STATUS.' : '.$res_status['LABEL'];?> : <?php echo _CHRONO_NUMBER; ?> :
<?php  echo _INITIATOR; ?> : <?php echo _TYPIST; ?> :
"; ?> is_module_loaded('tags') && ($core->test_service('tag_view', 'tags',false) == 1)) { include_once("modules".DIRECTORY_SEPARATOR."tags".DIRECTORY_SEPARATOR ."templates/details/index.php"); }*/ ?>
0) { ?>


"; ?> "; ?> "; ?> "; $detailsExport .= ""; ?>  "; echo ''; } } $i++; } ?>
"; ?> <?php echo $indexes[$key]['label'];?> "; ?> : "; ?> size="40" title="" alt="" /> "; ?>
 


'' ) { $path = $_SESSION['config']['coreurl'] . '/custom/' . $_SESSION['custom_override_id'] . '/apps/' . $_SESSION['config']['app_id']; } else {*/ $path = $_SESSION['config']['businessappurl']; //} ?> ', '_blank');" />
is_module_loaded('tags') && ($core->test_service('tag_view', 'tags', false) == 1)) { include_once('modules/tags/templates/details/index.php'); } } //PHOTO CAPTURE if ($core->test_service('photo_capture', 'photo_capture', false) === true){ require_once("modules".DIRECTORY_SEPARATOR."photo_capture" .DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR ."class_modules_tools.php"); $photo_capture = new photo_capture(); echo "

"._PHOTO_CAPTURE."

"; //Collection id, ressource Id (document or folder), can modifiy (false/true) echo $photo_capture->showPhoto($coll_id, $s_id, $modify_doc); } ?>
execute_app_services($_SESSION['app_services'], 'details.php'); $detailsExport .= "

"._NOTES."

"; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= "
"; $detailsExport .= "

"._NOTES_1."

"; $detailsExport .= "
"; $detailsExport .= " "; $detailsExport .= "
"; $detailsExport .= "

"._NOTES_2."

"; $detailsExport .= "
"; $detailsExport .= " "; $detailsExport .= "
"; $detailsExport .= "

"._NOTES_3."

"; $detailsExport .= "
"; $detailsExport .= " "; $detailsExport .= "
"; if ($core->is_module_loaded('entities')) { $detailsExport .= "

"._DIFF_LIST."

"; ?>

get_listinstance($s_id, false, $coll_id); $_SESSION['details']['difflist_type'] = $diff_list->get_difflist_type($_SESSION['details']['diff_list']['difflist_type']); # Include display of list $roles = $diff_list->list_difflist_roles(); $difflist = $_SESSION['details']['diff_list']; require_once 'modules/entities/difflist_display.php'; //if (($core->test_service('update_list_diff_in_details', 'entities', false)) && (!$core->test_service('add_copy_in_process', 'entities', false))) { if ($core->test_service('update_list_diff_in_details', 'entities', false)) { echo ''._UPDATE_LIST_DIFF.''._UPDATE_LIST_DIFF.''; } //}else if($core->test_service('update_list_diff_in_details', 'entities', false) ){ //echo ''._UPDATE_LIST_DIFF.''._UPDATE_LIST_DIFF.''; //} //print details if ( isset($_SESSION['details']['diff_list']['dest']['users'][0]['user_id']) && !empty($_SESSION['details']['diff_list']['dest']['users'][0]['user_id']) ) { $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= "
"._RECIPIENT.""._TO_CC."
- " . $_SESSION['details']['diff_list']['dest']['users'][0]['firstname']. " " . $_SESSION['details']['diff_list']['dest']['users'][0]['lastname'] . ""; for ($i=0;$i"; } for ($i=0;$i"; } $detailsExport .= "
"; } ?>
"._PROCESS.""; $nb_attach = ''; if ($core->is_module_loaded('attachments')) { $req = new dbquery; $req->connect(); $countAttachments = "select res_id, creation_date, title, format from " . $_SESSION['tablename']['attach_res_attachments'] . " where res_id_master = " . $_SESSION['doc_id'] . " and coll_id ='" . $_SESSION['collection_id_choice'] . "' and status <> 'DEL'"; $req->query($countAttachments); if ($req->nb_result() > 0) { $nb_attach = '(' . ($req->nb_result()). ')'; } } ?>
"; $detailsExport .= "";*/ $answer_type = ""; if ($process_data['simple_mail'] == true) { $answer_type .= _SIMPLE_MAIL.', '; } if ($process_data['registered_mail'] == true) { $answer_type .= _REGISTERED_MAIL.', '; } if ($process_data['direct_contact'] == true) { $answer_type .= _DIRECT_CONTACT.', '; } if ($process_data['email'] == true) { $answer_type .= _EMAIL.', '; } if ($process_data['fax'] == true) { $answer_type .= _FAX.', '; } if ($process_data['no_answer'] == true) { $answer_type = _NO_ANSWER.', '; } if ($process_data['other'] == true) { $answer_type .= " ".$process_data['other_answer_desc']."".', '; } $answer_type = preg_replace('/, $/', '', $answer_type); //$detailsExport .= $answer_type.""; ?> "; $detailsExport .= ""; $detailsExport .= $db->show_string($process_data['process_notes'])."";*/ ?> "; $detailsExport .= ""; $detailsExport .= $closing_date."";*/ ?> "; ?>
"; $detailsExport .= "
is_module_loaded('attachments')) { $detailsExport .= "

"._ATTACHED_DOC." :

"; $selectAttachments = "select res_id, creation_date, title, format from ".$_SESSION['tablename']['attach_res_attachments']." where res_id_master = ".$_SESSION['doc_id']." and coll_id ='".$_SESSION['collection_id_choice']."' and status <> 'DEL'"; $dbAttachments = new dbquery(); $dbAttachments->connect(); $dbAttachments->query($selectAttachments); /*$detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; while($resAttachments = $dbAttachments->fetch_object()) { $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; $detailsExport .= ""; } $detailsExport .= "
"._ID.""._DATE.""._TITLE.""._FORMAT."
".$resAttachments->res_id."".$resAttachments->creation_date."".$resAttachments->title."".$resAttachments->format."
";*/ ?>


"; ?>
is_module_loaded('notes')) { require_once "modules" . DIRECTORY_SEPARATOR . "notes" . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . "class_modules_tools.php"; $notes_tools = new notes(); //Count notes $nbr_notes = $notes_tools->countUserNotes($s_id, $coll_id); if ($nbr_notes > 0 ) $nbr_notes = ' ('.$nbr_notes.')'; else $nbr_notes = ''; //Notes iframe ?>
is_module_loaded('cases') == true) { ?>
test_service('join_res_case', 'cases',false) == 1) { ?>
test_service('sendmail', 'sendmail', false) === true) { require_once "modules" . DIRECTORY_SEPARATOR . "sendmail" . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . "class_modules_tools.php"; $sendmail_tools = new sendmail(); //Count mails $nbr_emails = $sendmail_tools->countUserEmails($s_id, $coll_id); if ($nbr_emails > 0 ) $nbr_emails = ' ('.$nbr_emails.')'; else $nbr_emails = ''; ?>
execute_modules_services( $_SESSION['modules_services'], 'details', 'frame', 'sendmail', 'sendmail' ); ?>
retrieve_version_table_from_coll_id( $coll_id ); $selectVersions = "select res_id from " . $versionTable . " where res_id_master = " . $s_id . " and status <> 'DEL' order by res_id desc"; $dbVersions = new dbquery(); $dbVersions->connect(); $dbVersions->query($selectVersions); $nb_versions_for_title = $dbVersions->nb_result(); $lineLastVersion = $dbVersions->fetch_object(); $lastVersion = $lineLastVersion->res_id; if ($lastVersion <> '') { $objectId = $lastVersion; $objectTable = $versionTable; } else { $objectTable = $security->retrieve_table_from_coll( $coll_id ); $objectId = $s_id; $_SESSION['cm']['objectId4List'] = $s_id; } if ($nb_versions_for_title == 0) { $extend_title_for_versions = '0'; } else { $extend_title_for_versions = $nb_versions_for_title; } $_SESSION['cm']['resMaster'] = ''; ?>
' . $extend_title_for_versions . ')'; ?>
<?php echo _VIEW_ORIGINAL;?>   | 
test
nbDirectLink( $_SESSION['doc_id'], $_SESSION['collection_id_choice'], 'all' ); $Links = ''; //if ($nbLink > 0) { $Links .= '
'; $Links .= _LINK_TAB; $Links .= ' ('; $Links .= $nbLink; $Links .= ')'; $Links .= '
'; $Links .= '
'; // $Links .= '

'; // $Links .= _LINK_TAB; // $Links .= '

'; $Links .= ''; if ($core->test_service('add_links', 'apps', false)) { include_once 'apps/'.$_SESSION['config']['app_id'].'/add_links.php'; } $Links .= '
'; //} echo $Links; ?>
"; $_SESSION['doc_convert'] = array(); $_SESSION['doc_convert']['details_result'] = $detailsExport; $core = new core_tools(); if ($printDetails) { $Fnm = $_SESSION['config']['tmppath']. '/export_details_' . $_SESSION['user']['UserId'] . '_export.html'; if (file_exists($Fnm)) { unlink($Fnm); } $inF = fopen($Fnm,"w"); fwrite($inF, $detailsExport); fclose($inF); }