Esempio n. 1
0
$date = CMbDT::date("-1 month");
$user = CMediusers::get();
$user->loadRefFunction()->loadRefGroup();
$entry = new CSearchThesaurusEntry();
$entry->user_id = "{$user->_id}";
$thesaurus = $entry->loadMatchingList();
foreach ($thesaurus as $_thesaurus) {
    /** @var $_thesaurus  CSearchThesaurusEntry */
    $_thesaurus->loadRefsTargets();
}
$types = array();
$group = CGroups::loadCurrent();
if (CAppUI::conf("search active_handler active_handler_search_types", $group)) {
    $types = explode("|", CAppUI::conf("search active_handler active_handler_search_types", $group));
}
$log = new CSearchLog();
$log->testConnection($group);
$contextes = $log->loadContextes();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("date", $date);
$smarty->assign("start", 0);
$smarty->assign("results", array());
$smarty->assign("time", 0);
$smarty->assign("nbresult", 0);
$smarty->assign("thesaurus", $thesaurus);
$smarty->assign("entry", $entry);
$smarty->assign("types", $types);
$smarty->assign("user", $user);
$smarty->assign("contextes", $contextes);
$smarty->display("vw_search_thesaurus.tpl");
Esempio n. 2
0
<?php

/**
 * $Id$
 *
 * @category Search
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
$types = array();
$group = CGroups::loadCurrent();
if (CAppUI::conf("search active_handler active_handler_search_types", $group)) {
    $types = explode("|", CAppUI::conf("search active_handler active_handler_search_types", $group));
}
$log = new CSearchLog();
$contextes = $log->loadContextes();
$test_search = new CSearch();
$test_search->testConnection($group);
$smarty = new CSmartyDP();
$smarty->assign("types", $types);
$smarty->assign("contextes", $contextes);
$smarty->display("vw_search_log.tpl");
<?php

/**
 * $Id$
 *  
 * @category Search
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @link     http://www.mediboard.org */
CCanDo::checkAdmin();
$date = CValue::get("date");
$user_id = CValue::get("user_id");
$type = CValue::get("type");
$words = CValue::get("words");
$client_index = new CSearchLog();
$client_index->createClient();
$date = CMbDT::format($date, "%Y/%m/%d");
$words .= " date:[" . $date . " TO " . "{$date}] user_id:(" . $user_id . ")";
$array_results = array();
$array_highlights = array();
$authors = array();
$author_ids = array();
$time = 0;
$nbresult = 0;
try {
    $results_query = $client_index->searchQueryLogDetails('AND', $words, array($type));
    $results = $results_query->getResults();
    $time = $results_query->getTotalTime();
    $nbresult = $results_query->getTotalHits();
    foreach ($results as $result) {
 * @category Search
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @link     http://www.mediboard.org */
$date = CValue::get("date");
$user_id = CValue::get("user_id", null);
$words = html_entity_decode(CValue::get("words"));
$object_ref_id = CValue::get("object_ref_id");
$object_ref_class = CValue::get("object_ref_class");
$fuzzy_search = CValue::get("fuzzy_search", null);
$fuzzy_search = CValue::get("fuzzy_search", null);
$types = CValue::get("types", array());
// Recherche par aggreg pour les logs
if ($date || $user_id) {
    $client_index = new CSearchLog();
    $client_index->createClient();
    $client_index->loadIndex($client_index->loadNameIndex());
    $date = CMbDT::format($date, "%Y/%m/%d");
    $words .= "date:[" . $date . " TO " . "{$date}] user_id:(" . $user_id . ")";
    $agregation = array();
    $tabActive = "";
    if (!$types) {
        $types = $client_index->loadContextes();
    }
} else {
    $client_index = new CSearch();
    $client_index->createClient();
    $client_index->loadIndex();
    $words .= " object_ref_class:" . $object_ref_class . " " . "object_ref_id:" . $object_ref_id;
    $results = $client_index->queryByType($words, null, $types);
Esempio n. 5
0
 *  
 * @category Search
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @link     http://www.mediboard.org */
CCanDo::checkRead();
$_min_date = CValue::get("_min_date", "*");
$_max_date = CValue::get("_max_date", "*");
$_date = CValue::get("_date", null);
$specific_user = CValue::get("user_id");
$start = (int) CValue::get("start", 0);
$words = " ";
// Données nécessaires pour la recherche
new CSearch();
$client_index = new CSearchLog();
$client_index->createClient();
$words = $client_index->constructWordsWithDate($_date, $_min_date, $_max_date);
$words = $client_index->constructWordsWithUser($words, CMediusers::get()->_id);
// Recherche fulltext
$time = 0;
$nbresult = 0;
$array_results = array();
try {
    $results_query = $client_index->searchQueryString('AND', $words, $start, 20, null, null);
    $results = $results_query->getResults();
    $time = $results_query->getTotalTime();
    $nbresult = $results_query->getTotalHits();
    // traitement des résultats
    foreach ($results as $result) {
        $var = $result->getHit();
Esempio n. 6
0
$_date = CValue::get("_date");
$specific_user = CValue::get("user_id");
$start = (int) CValue::get("start", 0);
$names_types = CValue::get("names_types", array());
$aggregate = CValue::get("aggregate");
$fuzzy_search = CValue::get("fuzzy", null);
$sejour_id = CValue::get("sejour_id", null);
$contexte = CValue::get("contexte");
$user = CMediusers::get();
if (in_array("CPrescriptionLineMedicament", $names_types)) {
    $names_types[] = "CPrescriptionLineMix";
    $names_types[] = "CPrescriptionLineElement";
}
// Données nécessaires pour la recherche
$client_index = new CSearch();
$client_log = new CSearchLog();
$client_index->createClient();
$client_log->createClient();
// Journalisation de la recherche
$group = CGroups::loadCurrent();
if ($words && CAppUI::conf("search indexing active_indexing_log", $group)) {
    try {
        $client_log->log($names_types, $contexte, $user->_id, $words, $aggregate);
    } catch (Exception $e) {
        CAppUI::displayAjaxMsg("La requête ne peut pas être journalisée", UI_MSG_WARNING);
        mbLog($e->getMessage());
    }
}
// Recherche fulltext
$time = 0;
$nbresult = 0;
Esempio n. 7
0
 * @link     http://www.mediboard.org
 */
$user = CMediusers::get();
$user->loadRefFunction()->loadRefGroup();
$start = (int) CValue::get("start_thesaurus", 0);
$choose = CValue::get("_choose");
$entry = new CSearchThesaurusEntry();
$ds = $entry->getDS();
$where = array();
$types = array();
$group = CGroups::loadCurrent();
if (CAppUI::conf("search active_handler active_handler_search_types", $group)) {
    $types = explode("|", CAppUI::conf("search active_handler active_handler_search_types", $group));
}
$contextes = CValue::get("contextes");
$contextes = $contextes ? $contextes : CSearchLog::loadContextes();
$where["contextes"] = $entry->_spec->ds->prepareIn($contextes);
if ($choose) {
    $select_choose = explode(" ", $choose);
    $chaine = " = {$select_choose['1']}";
    $data = $ds->prepare($chaine);
    switch ($select_choose[0]) {
        case "user_id":
            $where["user_id"] = $data;
            break;
        case "function_id":
            $where["function_id"] = $data;
            break;
        case "group_id":
            $where["group_id"] = $data;
            break;
CCanDo::checkAdmin();
$group = CGroups::loadCurrent();
$test_search = new CSearch();
$test_search->testConnection($group);
try {
    // récupération du client
    $client_index = new CSearch();
    $client_index->createClient();
    $infos_index = $client_index->loadCartoInfos();
} catch (Exception $e) {
    $infos_index = array();
    CAppUI::displayAjaxMsg("Le serveur de recherche n'est pas connecté", UI_MSG_WARNING);
}
try {
    // récupération des données pour les journaux utilisateurs
    $client_log = new CSearchLog();
    $client_log->createClient();
    $infos_log = $client_log->loadCartoInfos();
} catch (Exception $e) {
    $infos_log = array();
    CAppUI::displayAjaxMsg("Le serveur de recherche de journaux n'est pas connecté", UI_MSG_WARNING);
}
try {
    // récupération des données pour les journaux utilisateurs
    $wrapper = new CSearchFileWrapper(null, null);
    $infos_tika = $wrapper->loadTikaInfos();
} catch (Exception $e) {
    mbLog($e);
    $infos_tika = "";
    CAppUI::displayAjaxMsg("Le serveur d'extraction de fichiers n'est pas connecté", UI_MSG_WARNING);
}
Esempio n. 9
0
        foreach ($queries as $query) {
            $ds->exec($query);
        }
    }
    CAppUI::displayAjaxMsg("l'opération en base s'est déroulée avec succès ", UI_MSG_OK);
}
// Création du mapping pour l'index principal
try {
    if ($mapping) {
        $client_index = new CSearch();
        //create a client
        $client_index->createClient();
        $index = $client_index->getIndex(CAppUI::conf("db std dbname"))->exists();
        $client_index->firstIndexingMapping($names_types, $index);
        CAppUI::displayAjaxMsg("L'index " . CAppUI::conf("db std dbname") . " s'est correctement créé", UI_MSG_OK);
    }
} catch (Exception $e) {
    mbLog($e);
    CAppUI::displayAjaxMsg("L'index " . CAppUI::conf("db std dbname") . " existe déjà", UI_MSG_ERROR);
    $error = "mapping";
}
if ($log) {
    $client_index = new CSearchLog();
    //create a client
    $client_index->createClient();
    $index = $client_index->getIndex(CAppUI::conf("db std dbname") . "_log")->exists();
    $client_index->createLogMapping($index);
}
$smarty = new CSmartyDP();
$smarty->assign("error", $error);
$smarty->display("inc_configure_es.tpl");
Esempio n. 10
0
$words = CValue::get("words");
$_min_date = CValue::get("_min_date", "*");
$_max_date = CValue::get("_max_date", "*");
$_date = CValue::get("_date");
$specific_user = CValue::get("user_id");
$start = (int) CValue::get("start", 0);
$names_types = CValue::get("names_types", array());
$contextes = CValue::get("contextes", array());
$aggregate = CValue::get("aggregate");
if (in_array("CPrescriptionLineMedicament", $names_types)) {
    $names_types[] = "CPrescriptionLineMix";
    $names_types[] = "CPrescriptionLineElement";
}
// Données nécessaires pour la recherche
new CSearch();
$client_index = new CSearchLog();
$client_index->createClient();
$words .= $client_index->constructWordsWithDate($_date, $_min_date, $_max_date);
$words = $client_index->constructWordsWithType($words, $names_types);
$words = $client_index->constructWordsWithUser($words, $specific_user);
// Recherche fulltext
$time = 0;
$nbresult = 0;
$array_results = array();
$array_highlights = array();
$array_aggregation = array();
$objects_refs = array();
$authors = array();
$author_ids = array();
try {
    $results_query = $client_index->searchQueryString('AND', $words, $start, 30, $contextes, $aggregate);