示例#1
0
function sql_rel($idTema, $i)
{
    if ($i < 10) {
        // Para evitar bucle infinito en caso de error por relaciones recursivas. max= 10
        $sql = SQLbucleArriba($idTema);
        if ($sql[cant] == 0) {
            $datos = ARRAYverTerminoBasico($idTema);
            if ($i == 0) {
                $enlace .= '#' . $datos[titTema] . ' ';
            } else {
                $enlace .= '#<a title="' . LABEL_verDetalle . $datos[titTema] . '" href="' . $PHP_SELF . '?tema=' . $datos[idTema] . '">' . $datos[titTema] . '</a>';
            }
            return $enlace;
        } else {
            return ver_txt($sql[datos], $i);
        }
    }
}
 function fetchTermDetailsBrief($tema_id)
 {
     $array = ARRAYverTerminoBasico($tema_id);
     if (is_array($array)) {
         $result["result"]["term"]["term_id"] = $array["idTema"];
         $result["result"]["term"]["tema_id"] = $array["idTema"];
         $result["result"]["term"]["code"] = $array["code"];
         $result["result"]["term"]["lang"] = $array["idioma"];
         $result["result"]["term"]["string"] = $array["titTema"];
         $result["result"]["term"]["isMetaTerm"] = $array["isMetaTerm"];
         $result["result"]["term"][date_create] = $array[cuando];
         $result["result"]["term"][date_mod] = $array[cuando_final] ? $array[cuando_final] : $array[cuando];
     }
     return $result;
 }
function ARRAYmyTopTerm($term_id, $index = "1")
{
    $myIndex = ARRAYIndexTema($term_id);
    $arrayMyIndex = explode('|', $myIndex["indice"]);
    $arrayTerm = ARRAYverTerminoBasico($arrayMyIndex[$index]);
    return $arrayTerm;
}
function txt4term($tema_id, $params = array())
{
    $arrayTema = ARRAYverTerminoBasico($tema_id);
    $txt .= "\n" . $arrayTema[tema] . "\r\n";
    $label_target_vocabulary = '';
    $txt .= $params["includeCreatedDate"] == 1 ? LABEL_fecha_creacion . ': ' . $arrayTema[cuando] . "\r\n" : '';
    if ($arrayTema[cuando_final] > $arrayTema[cuando] && $params["includeModDate"] == 1) {
        $txt .= LABEL_fecha_modificacion . ': ' . $arrayTema[cuando_final] . "\r\n";
    }
    //Notas
    $sqlNotas = SQLdatosTerminoNotas($arrayTema[tema_id]);
    while ($arrayNotas = $sqlNotas->FetchRow()) {
        $arrayNotas[label_tipo_nota] = in_array($arrayNotas[ntype_id], array(8, 9, 10, 11, 15)) ? arrayReplace(array(8, 9, 10, 11, 15), array(LABEL_NA, LABEL_NH, LABEL_NB, LABEL_NP, LABEL_NC), $arrayNotas[ntype_id]) : $arrayNotas[ntype_code];
        if ($arrayNotas[tipo_nota] !== 'NP' && in_array($arrayNotas[tipo_nota], $params["includeNote"])) {
            $txt .= '	' . $arrayNotas[label_tipo_nota] . ': ' . html2txt($arrayNotas[nota]) . "\r\n";
        }
    }
    //Relaciones
    $sqlRelaciones = SQLverTerminoRelaciones($arrayTema[tema_id]);
    $arrayRelacionesVisibles = array(2, 3, 4, 5, 6, 7);
    // TG/TE/UP/TR
    while ($arrayRelaciones = $sqlRelaciones->FetchRow()) {
        if (in_array($arrayRelaciones[t_relacion], $arrayRelacionesVisibles)) {
            $acronimo = arrayReplace($arrayRelacionesVisibles, array(TR_acronimo, TG_acronimo, UP_acronimo, EQP_acronimo, EQ_acronimo, NEQ_acronimo), $arrayRelaciones[t_relacion]);
            if (in_array($arrayRelaciones[t_relacion], array(5, 6, 7))) {
                //términos equivalentes .. se concatenan después de los TE/NT
                $label_target_vocabulary .= '	' . $acronimo . ': ' . $arrayRelaciones[tema] . ' (' . $arrayRelaciones[titulo] . ')' . "\r\n";
            } else {
                $txt .= '	' . $acronimo . $arrayRelaciones[rr_code] . ': ' . $arrayRelaciones[tema] . "\r\n";
            }
        }
    }
    //Terminos especificos
    $SQLTerminosE = SQLverTerminosE($arrayTema[tema_id]);
    while ($arrayTE = $SQLTerminosE->FetchRow()) {
        $txt .= '	' . TE_acronimo . $arrayTE[rr_code] . ': ' . $arrayTE[tema] . "\r\n";
    }
    $txt .= $label_target_vocabulary;
    //Terminos equivalentes web services
    $SQLtargetTerms = SQLtargetTerms($arrayTema[tema_id]);
    while ($arrayTT = $SQLtargetTerms->FetchRow()) {
        $txt .= '	' . FixEncoding(ucfirst($arrayTT[tvocab_label])) . ': ' . FixEncoding($arrayTT[tterm_string]) . "\r\n";
    }
    return $txt;
}
示例#5
0
                    // ERROR
                    header("HTTP/1.1 406 Not Acceptable");
                    echo ' ' . $_POST[code_tema] . ': ' . MSG_ERROR_CODE . ' (' . LABEL_Termino . ' ' . $task[tema] . ')';
                    break;
            }
        }
    }
    //gestión de codigo de tema
    if ($_POST["edit_tema_id"]) {
        $tema_id = str_replace("edit_tema", "", $_POST["edit_tema_id"]);
        //additional secure check
        $string_term = secure_data($_POST["edit_tema"], "sql");
        if (is_numeric($tema_id) && strlen($string_term) > 0) {
            $task = abm_tema('mod', $string_term, $tema_id);
        }
        $arrayTerm = ARRAYverTerminoBasico($tema_id);
        echo $arrayTerm[tema];
    }
}
$searchq = $_GET['q'];
if (!$searchq) {
    return;
}
if (strlen($searchq) >= CFG_MIN_SEARCH_SIZE) {
    $getRecord_sql = $_GET[t] == 'e' ? SQLSimpleSearchTrueTerms($searchq, "15") : SQLbuscaTerminosSimple($searchq, "15");
    // ---------------------------------------------------------------- //
    // AJAX Response													//
    // ---------------------------------------------------------------- //
    if ($getRecord_sql[cant] > 0) {
        while ($row = mysqli_fetch_array($getRecord_sql[datos])) {
            $tema = $CFG["_CHAR_ENCODE"] == 'utf-8' ? $row[tema] : FixEncoding($row[tema]);
示例#6
0
<?php 
#   TemaTres : aplicación para la gestión de lenguajes documentales #       #
#                                                                        #
#   Copyright (C) 2004-2008 Diego Ferreyra tematres@r020.com.ar
#   Distribuido bajo Licencia GNU Public License, versión 2 (de junio de 1.991) Free Software Foundation
#
###############################################################################################################
# Formulario de alta de notas #
#
$ARRAYTermino = ARRAYverTerminoBasico($_GET[tema]);
$hidden = '<input type="hidden"  name="idTema" value="' . $ARRAYTermino[idTema] . '" />';
if ($editNota) {
    $arrayNota = ARRAYdatosNota($editNota);
    if ($arrayNota[idNota]) {
        //Edicion
        $hidden .= '<input type="hidden" name="idNota" value="' . $arrayNota[idNota] . '" />';
        $hidden .= '<input type="hidden" name="modNota" value="1" />';
        $hidden .= '<input type="submit"  name="guardarCambioNota" value="' . LABEL_Cambiar . '"/>';
        $hidden .= ' | <input type="submit"  name="eliminarNota" value="' . LABEL_EliminarNota . '"/>';
        $hidden .= ' | <input type="button"  name="cancelar" type="button" onClick="location.href=\'index.php?tema=' . $ARRAYTermino[idTema] . '\'" value="' . ucfirst(LABEL_Cancelar) . '"/>';
    } else {
        $hidden .= '<input type="hidden" name="altaNota" value="1" />';
        $hidden .= '<input type="submit"  name="boton" value="' . LABEL_Enviar . '"/>';
        $hidden .= ' | <input type="button"  name="cancelar" type="button" onClick="location.href=\'index.php?tema=' . $ARRAYTermino[idTema] . '\'" value="' . ucfirst(LABEL_Cancelar) . '"/>';
    }
}
$LabelNB = 'NB#' . LABEL_NB;
$LabelNH = 'NH#' . LABEL_NH;
$LabelNA = 'NA#' . LABEL_NA;
$LabelNP = 'NP#' . LABEL_NP;
示例#7
0
 function fetchTermDetailsBrief($tema_id)
 {
     $array = ARRAYverTerminoBasico($tema_id);
     if (is_array($array)) {
         $result["result"]["term"][tema_id] = $array[idTema];
         $result["result"]["term"][string] = $array[titTema];
         $result["result"]["term"][date_create] = $array[cuando];
         $result["result"]["term"][date_mod] = $array[cuando_final] ? $array[cuando_final] : $array[cuando];
     }
     return $result;
 }