*/
require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
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_types.php");
require_once("modules".DIRECTORY_SEPARATOR."postindexing".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_modules_tools.php");
$security = new security();
$func = new functions();
$type = new types();
$postindexing = new postindexing();
$db = new dbquery();
$core_tools = new core_tools();
$core_tools->load_lang();
if (preg_match("/MSIE 6.0/", $_SERVER["HTTP_USER_AGENT"])) {
$ieBrowser = true;
$display_value = 'block';
} else if (preg_match('/msie/i', $_SERVER["HTTP_USER_AGENT"])
&& ! preg_match('/opera/i', $_SERVER["HTTP_USER_AGENT"])
) {
$ieBrowser = true;
$display_value = 'block';
} else {
$ieBrowser = false;
$display_value = 'table-row';
}
$coll_id = $_SESSION['tablename']['postindexing_collection'];
$view= $security->retrieve_view_from_coll_id($coll_id);
$table = $security->retrieve_table_from_coll($coll_id);
$_SESSION['collection_id_choice'] = $coll_id;
$right = false;
$basket_id = $_SESSION['current_basket']['id'];
$id_action = $_SESSION['current_basket']['default_action'];
if(isset($_REQUEST['action']) && !empty($_REQUEST['action']))
{
$_SESSION['postindexing']['action'] = $_REQUEST['action'];
}
if (empty($_SESSION['postindexing']['action']))
{
$_SESSION['postindexing']['action'] = $_SESSION['current_basket']['default_action'];
}
$func->configPosition("index_video.php");
$core_tools->load_html();
$core_tools->load_header();
$time = $core_tools->get_session_time_expire();
//$func->show_array($_SESSION['current_basket']);
//include('modules'.DIRECTORY_SEPARATOR.'postindexing'.DIRECTORY_SEPARATOR.'definition_mail_categories_postindexing.php');
include_once 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']. DIRECTORY_SEPARATOR . 'definition_mail_categories.php';
//$func->show_array($_ENV['categories']);
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 dbquery();
$db->connect();
$db->query("select category_id from ".$view." where res_id = ".$res_id);
$res = $db->fetch_object();
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 (".$res_id.", '".$_SESSION['coll_categories']['letterbox_coll']['default_category']."')");
//$db->show();
}
}
//$func->show_array($_SESSION['user']['redirect_groupbasket']);
//Close postindexing windows and return to document list
$closeAndReturn = false;
//He we go!!!
if (count($_SESSION['postindexing']['docs']) > 0)
{
//On verifie si la session n'a pas expirée
if (count($postindexing->get_user_reserved_doc($table)) == 0)
{
//Unlock folder
$postindexing->unlock_current_folder();
$_SESSION['error'] .= _RESERVATION_TIME_EXPIRED.'
';
$closeAndReturn = true;
}
else
{
//par defaut on se positionne au début du tableau
if(!isset($_SESSION['postindexing']['resid_pointeur']) || empty($_SESSION['postindexing']['resid_pointeur']))
{
$_SESSION['postindexing']['resid_pointeur'] = 0;
}
//On positionne le pointeur sur un enregistrement
$_SESSION['postindexing']['res_actif'] = $_SESSION['postindexing']['docs'][$_SESSION['postindexing']['resid_pointeur']];
//echo $_SESSION['postindexing']['res_actif']; exit;
//On test les droits sur le document
$right = $security->test_right_doc($_SESSION['collection_id_choice'], $_SESSION['postindexing']['res_actif']);
//Si ok on recup les infos
if(!$right)
{
$_SESSION['error'] .= _NO_DOC_OR_NO_RIGHTS.'
';
$closeAndReturn = true;
}
else
{
$today = date('d-m-Y');
//Recuperer la liste des types
$doctypes = array();
if($_SESSION['features']['show_types_tree'] == 'true')
{
$doctypes = $type->getArrayStructTypes($coll_id);
}
else
{
$doctypes = $type->getArrayTypes($coll_id);
}
//Entities
if($core_tools->is_module_loaded('entities'))
{
require_once("modules".DIRECTORY_SEPARATOR."entities".DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_manage_listdiff.php');
$diff_list = new diffusion_list();
$services = array();
if(!empty($_SESSION['user']['redirect_groupbasket'][$_SESSION['current_basket']['id']][$_SESSION['postindexing']['action']]['entities']))
{
$db->query("select entity_id, short_label from ".$_SESSION['tablename']['ent_entities']." where entity_id in (".$_SESSION['user']['redirect_groupbasket'][$_SESSION['current_basket']['id']][$_SESSION['postindexing']['action']]['entities'].") and enabled= 'Y' order by entity_label");
while($res = $db->fetch_object())
{
array_push($services, array( 'ID' => $res->entity_id, 'LABEL' => $db->show_string($res->short_label)));
}
}
$load_listmodel = true;
$db->query("select res_id from ".$_SESSION['tablename']['ent_listinstance']." where res_id = ".$_SESSION['postindexing']['res_actif']);
if($db->nb_result() > 0)
{
$load_listmodel = false;
$_SESSION['indexing']['diff_list'] = $diff_list->get_listinstance($_SESSION['postindexing']['res_actif']);
}
}
//Physical archive
if($core_tools->is_module_loaded('physical_archive'))
{
$boxes = array();
$db->query("select arbox_id, title from ".$_SESSION['tablename']['ar_boxes']." where status = 'NEW' order by title");
while($res = $db->fetch_object())
{
array_push($boxes, array( 'ID' => $res->arbox_id, 'LABEL' => $db->show_string($res->title)));
}
}
//Get actual status
$db->query("select status from ".$table." where res_id = ".$_SESSION['postindexing']['res_actif']);
$res = $db->fetch_object();
$_SESSION['postindexing']['actual_status'] = $res->status;
//Category
check_category($coll_id, $_SESSION['postindexing']['res_actif']);
$data = get_general_data($coll_id, $_SESSION['postindexing']['res_actif'], 'minimal');
//$func->show_array($data);
}
}
}
else
{
$_SESSION['error'] .= _VIDEO_NO_RES.'
';
$closeAndReturn = true;
}
?>
|
show_info();
$postindexing->show_navigation();
$postindexing->show_add_edit_note($basket_id, $coll_id);
?>
|