. */ /** * File : details_business.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 ($_REQUEST['coll_id'] == 'letterbox_coll') { // $definitionCategories = 'definition_mail_categories'; //} elseif ($_REQUEST['coll_id'] == 'business_coll') { $definitionCategories = 'definition_mail_categories_business'; //} $_REQUEST['coll_id'] = 'business_coll'; $_SESSION['current_basket']['coll_id'] = 'business_coll'; if (file_exists( $_SESSION['config']['corepath'] . 'custom/apps/' . $_SESSION['config']['app_id'] . '/' . $definitionCategories . '.php') ) { $path = $_SESSION['config']['corepath'] . 'custom/apps/' . $_SESSION['config']['app_id'] . '/' . $definitionCategories . '.php'; } else { $path = 'apps/' . $_SESSION['config']['app_id'] . '/' . $definitionCategories . '.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 view doc history $viewDocHistory = false; if ($core->test_service('view_doc_history', 'apps', false)) { $viewDocHistory = 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(); /****************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_business&dir=indexing_searching&coll_id=' . $_REQUEST['coll_id'] . '&id=' . $_REQUEST['id']; $page_label = _DETAILS; $page_id = 'details_business'; $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_business'; $_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; } $extTable = $security->retrieve_extension_table_from_coll_id($coll_id); } $_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 " . $extTable . " 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'); $diff_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*/ $diff_list->save_listinstance( $_SESSION['details']['diff_list'], $_SESSION['details']['diff_list']['object_type'], $coll_id, $s_id, $_SESSION['user']['UserId'] ); $_SESSION['details']['diff_list']['key_value'] = md5($res_id); } $is->update_business($_POST, 'POST', $s_id, $coll_id); if ($core->is_module_loaded('tags')) { include_once('modules/tags/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;$iquery( "select * from " . $table . " where res_id = " . $s_id ); //$db->show(); } ?>

(retrieve_coll_label_from_coll_id($coll_id); ?>)







nb_result() == 0) { ?>


.


true, 'img_type_id' => true, 'img_subject' => true, 'img_contact_id' => true, 'img_identifier' => true, 'img_doc_date' => true, 'img_currency' => true, 'img_net_sum' => true, 'img_tax_sum' => true, 'img_total_sum' => true, 'img_process_limit_date' => true, 'img_destination' => 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); $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; //$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); $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($data); ?>

' . _BACK . ''; } } ?>

<?php echo _VIEW_DOC;?> 

 


"") { $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); } ?>  '; } } $i++; } ?>
"") { 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') { ?>
<?php echo _STATUS.' : '.$res_status['LABEL'];?> : <?php  echo _INITIATOR; ?> :
0) { ?>


 '; } } $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']; //} ?>
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'); if ($core->is_module_loaded('entities')) { ?>


get_listinstance($s_id, false, $coll_id); $_SESSION['details']['difflist_type'] = $diff_list->get_difflist_type($_SESSION['details']['diff_list']['object_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)) { echo ''._UPDATE_LIST_DIFF.''._UPDATE_LIST_DIFF.''; } ?>
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(); } else { $nb_attach = 0; } ?>
' . $nb_attach . ')';?>
is_module_loaded('attachments')) { require 'modules/templates/class/templates_controler.php'; $templatesControler = new templates_controler(); $templates = array(); $templates = $templatesControler->getAllTemplatesForProcess($data['destination']['value']); $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); ?>

is_module_loaded('templates') && (!isset($_SESSION['current_basket']['id']) && $core->test_service('edit_attachments_from_detail', 'attachments', false)) || isset($_SESSION['current_basket']['id'])) { $objectTable = $security->retrieve_table_from_coll($coll_id); echo _GENERATE_ATTACHMENT_FROM;?>
 | 
 
is_module_loaded('notes')) { require_once 'modules/notes/class/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 = ''; $nbr_notes = ' ('.$nbr_notes.')'; //Notes iframe ?>
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' ); ?>
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; //TAGS ?>
is_module_loaded('tags') && ($core->test_service('tag_view', 'tags', false) == 1)) { include_once('modules/tags/templates/details/index.php'); } ?>