. */ /** * @brief Action : indexing a file * * Open a modal box to displays the indexing form, make the form checks and loads * the result in database. Used by the core (manage_action.php page). * * @file * @author Claire Figueras * @date $date$ * @version $Revision$ * @ingroup apps */ //$_SESSION['validStep'] = "ko"; include_once 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR . 'definition_mail_categories.php'; require_once 'core' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_security.php'; require_once 'core/core_tables.php'; require_once 'core' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_request.php'; require_once 'core' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_resource.php'; require_once 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_business_app_tools.php'; require_once 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_types.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_indexing_searching_app.php'; require_once 'core' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'docservers_controler.php'; require_once 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_chrono.php'; require_once 'core' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_history.php'; $core = new core_tools(); if ($core->is_module_loaded('entities')) { require_once 'modules/entities/entities_tables.php'; } if ($core->is_module_loaded('folder')) { require_once 'modules/folder/folder_tables.php'; } if ($core->is_module_loaded('physical_archive')) { require_once 'modules' . DIRECTORY_SEPARATOR . 'physical_archive' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_modules_tools.php'; require_once 'modules/physical_archive/physical_archive_tables.php'; } require_once 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR . 'apps_tables.php'; /** * $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'; /** * Returns the indexing form text * * @param $values Array Not used here * @param $pathManageAction String Path to the PHP file called in Ajax * @param $actionId String Action identifier * @param $table String Table * @param $module String Origin of the action * @param $collId String Collection identifier * @param $mode String Action mode 'mass' or 'page' * @return String The form content text **/ function get_form_txt($values, $pathManageAction, $actionId, $table, $module, $collId, $mode ) { if (preg_match("/MSIE 6.0/", $_SERVER["HTTP_USER_AGENT"])) { $ieBrowser = true; $displayValue = 'block'; } else if (preg_match('/msie/i', $_SERVER["HTTP_USER_AGENT"]) && ! preg_match('/opera/i', $_SERVER["HTTP_USER_AGENT"]) ) { $ieBrowser = true; $displayValue = 'block'; } else { $ieBrowser = false; $displayValue = 'table-row'; } $_SESSION['req'] = "action"; $resId = $values[0]; $frmStr = ''; $type = new types(); $sec = new security(); $b = new basket(); $core = new core_tools(); $business = new business_app_tools(); if ($_SESSION['features']['show_types_tree'] == 'true') { $doctypes = $type->getArrayStructTypes($collId); } else { $doctypes = $type->getArrayTypes($collId); } $today = date('d-m-Y'); $tmp = $business->get_titles(); $titles = $tmp['titles']; $defaultTitle = $tmp['default_title']; if ($core->is_module_loaded('entities')) { $EntitiesIdExclusion = array(); $db = new dbquery(); $db->connect(); /* if (count($_SESSION['user']['redirect_groupbasket'][$_SESSION['current_basket']['id']][$actionId]['entities']) > 0) { $db->query( "select entity_id, entity_label, short_label from " . ENT_ENTITIES . " where entity_id in (" . $_SESSION['user']['redirect_groupbasket'][$_SESSION['current_basket']['id']][$actionId]['entities'] //. ") and enabled= 'Y' order by entity_label" . ") and enabled= 'Y' order by short_label" ); while ($res = $db->fetch_object()) { array_push( $services, array( 'ID' => $res->entity_id, 'LABEL' => $db->show_string($res->entity_label), 'SHORT_LABEL' => $db->show_string($res->short_label), ) ); } } */ if (count($_SESSION['user']['redirect_groupbasket'][$_SESSION['current_basket']['id']][$actionId]['entities']) > 0) { $db->query( "select entity_id from " . ENT_ENTITIES . " where entity_id not in (" . $_SESSION['user']['redirect_groupbasket'][$_SESSION['current_basket']['id']][$actionId]['entities'] . ") and enabled= 'Y' order by entity_id" ); //$db->show(); while ($res = $db->fetch_object()) { array_push($EntitiesIdExclusion, $res->entity_id); } } } //var_dump($EntitiesIdExclusion); require_once 'modules' . DIRECTORY_SEPARATOR . 'entities' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'class_manage_entities.php'; $ent = new entity(); $allEntitiesTree= array(); $allEntitiesTree = $ent->getShortEntityTreeAdvanced( $allEntitiesTree, 'all', '', $EntitiesIdExclusion, 'all' ); /* echo '
';
    print_r($allEntitiesTree);
    echo '
';exit; */ if ($core->is_module_loaded('physical_archive')) { $boxes = array(); $db = new dbquery(); $db->connect(); $db->query( "select arbox_id, title from " . PA_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), ) ); } } // exit(); // Select statuses from groupbasket $statuses = array(); $db = new dbquery(); $db->connect(); /* Basket of ABS users */ if($_SESSION['current_basket']['abs_basket']=='1'){ $query="SELECT group_id FROM usergroup_content WHERE user_id='".$_SESSION['current_basket']['basket_owner']."' AND primary_group='Y'"; $db->query($query); $grp_status=$db->fetch_object(); $owner_usr_grp=$grp_status->group_id; $owner_basket_id=str_replace("_".$_SESSION['current_basket']['basket_owner'], "", $_SESSION['current_basket']['id']); }else{ $owner_usr_grp=$_SESSION['user']['primarygroup']; $owner_basket_id=$_SESSION['current_basket']['id']; } $query = "SELECT status_id, label_status FROM " . GROUPBASKET_STATUS . " left join " . $_SESSION['tablename']['status'] . " on status_id = id " . " where basket_id= '" . $owner_basket_id . "' and group_id = '" . $owner_usr_grp . "' and action_id = " . $actionId; $db->query($query); if($db->nb_result() > 0) { while($status = $db->fetch_object()) { $statuses[] = array( 'ID' => $status->status_id, 'LABEL' => $db->show_string($status->label_status) ); } } $frmStr .= '
'; $frmStr .= '