*/
require 'core/class/class_request.php';
require 'apps/' . $_SESSION['config']['app_id'] . '/class/class_list_show.php';
require_once 'core/class/class_security.php';
require_once 'core/class/class_history.php';
require_once 'core/manage_bitmask.php';
require_once "apps" . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
. DIRECTORY_SEPARATOR . "security_bitmask.php";
require_once "apps" . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
. DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR
. "class_indexing_searching_app.php";
require_once "apps" . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
. DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR . "class_types.php";
$core = new core_tools();
$core->test_user();
$core->load_lang();
$resId = '';
if (isset($_REQUEST['value']) && !empty($_REQUEST['value'])) {
$resId = $_REQUEST['value'];
}
$hist = new history();
$security = new security();
$func = new functions();
$request = new request;
$type = new types();
//$_SESSION['req'] ='details';
//$_SESSION['indexing'] = array();
$is = new indexing_searching_app();
$table = '';
$isView = false;
if (isset($_SESSION['collection_id_choice'])
&& ! empty($_SESSION['collection_id_choice'])
) {
$collId = $_SESSION['collection_id_choice'];
} else {
$collId = $_SESSION['user']['collections'][0];
}
if ($collId == 'letterbox_coll') {
if (file_exists(
$_SESSION['config']['corepath'] . 'custom'. DIRECTORY_SEPARATOR
. $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'apps'
. DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR
. 'definition_mail_categories.php'
)
) {
$path = $_SESSION['config']['corepath'] . 'custom'. DIRECTORY_SEPARATOR
. $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'apps'
. DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
. DIRECTORY_SEPARATOR . 'definition_mail_categories.php';
} else {
$path = 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
. DIRECTORY_SEPARATOR . 'definition_mail_categories.php';
}
}
include_once $path;
$table = $security->retrieve_view_from_coll_id($collId);
$isView = true;
if (empty($table)) {
$table = $security->retrieve_table_from_coll($collId);
$isView = false;
}
$_SESSION['id_to_view'] = $resId;
$_SESSION['doc_id'] = $resId;
$right = $security->test_right_doc($collId, $resId);
if (! $right && $resId <> '') {
include('apps/'.$_SESSION['config']['app_id'].'/no_right.php');
exit;
}
if ($resId == '') {
echo '
rowCount() == 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_project' => true
);
$res = $stmt->fetchObject();
$typeId = $res->type_id;
$typist = $res->typist;
$format = $res->format;
$filesize = $res->filesize;
$creationDate = functions::format_date_db($res->creation_date, false);
$fingerprint = $res->fingerprint;
$workBatch = $res->work_batch;
$pageCount = $res->page_count;
$isPaper = $res->is_paper;
$scanDate = functions::format_date_db($res->scan_date);
$scanUser = $res->scan_user;
$scanLocation = $res->scan_location;
$scanWkstation = $res->scan_wkstation;
$scanBatch = $res->scan_batch;
$docLanguage = $res->doc_language;
$closingDate = functions::format_date_db($res->closing_date, false);
$indexes = $type->get_indexes($typeId, $collId);
if ($core->is_module_loaded('cases') == true) {
require_once 'modules/cases/class/class_modules_tools.php';
$case = new cases();
if ($res->case_id <> '') {
$caseProperties = $case->get_case_info($res->case_id);
}
}
foreach (array_keys($indexes) as $key) {
if (preg_match('/^custom/', $key)) {
$tmp = 'doc_' . $key;
} else {
$tmp = $key;
}
if ($indexes[$key]['type'] == "date") {
$res->{$tmp} = functions::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'] = functions::show_string($res->{$tmp});
} else if ($indexes[$key]['type'] == "date") {
$indexes[$key]['show_value'] = functions::format_date_db($res->{$tmp}, true);
}
}
// $processData = $is->get_process_data($collId, $resId);
$status = $res->status;
if (! empty($status)) {
require_once 'core/class/class_manage_status.php';
$statusObj = new manage_status();
$resStatus = $statusObj->get_status_data($status);
if ($modifyDoc) {
$canBeModified = $statusObj->can_be_modified($status);
if (! $canBeModified) {
$modifyDoc = false;
}
}
}
$dataMode = 'full';
if ($modifyDoc) {
$dataMode = 'form';
}
foreach (array_keys($indexes) as $key) {
$indexes[$key]['opt_index'] = true;
if ($indexes[$key]['type_field'] == 'select') {
for ($i = 0; $i < count($indexes[$key]['values']); $i ++) {
if ($indexes[$key]['values'][$i]['id'] == $indexes[$key]['value']) {
$indexes[$key]['show_value'] = $indexes[$key]['values'][$i]['label'] ;
break;
}
}
}
if (! $modifyDoc) {
$indexes[$key]['readonly'] = true;
$indexes[$key]['type_field'] = 'input';
} else {
$indexes[$key]['readonly'] = false;
}
}
$data = get_general_data($collId, $resId, $dataMode, $paramData);
?>
load_js();
?>