Exemplo n.º 1
0
#   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
#
###############################################################################################################
#
// Preparado de datos para el formulario ///
$arrayLang = array();
foreach ($idiomas_disponibles as $key => $value) {
    array_push($arrayLang, "{$value['2']}#{$value['0']}");
}
$si = LABEL_SI;
$no = LABEL_NO;
if ($_GET[vocabulario_id] > 0) {
    $sql_vocabulario = SQLdatosVocabulario($_GET[vocabulario_id]);
    $array_vocabulario = mysqli_fetch_array($sql_vocabulario[datos]);
    $fecha_crea = do_fecha($array_vocabulario[cuando]);
} else {
    $array_vocabulario[vocabulario_id] = 'NEW';
}
if ($array_vocabulario[vocabulario_id] == 1) {
    $titulo_formulario = LABEL_vocabulario_principal;
} else {
    $titulo_formulario = LABEL_vocabulario_referencia;
}
$array_ano = do_intervalDate("1998", date(Y), FORM_LABEL_FechaAno);
$array_dia = do_intervalDate("1", "31", FORM_LABEL_FechaDia);
$array_mes = do_intervalDate("1", "12", FORM_LABEL_FechaMes);
?>
<h1><?php 
 function fetchVocabularyData($vocabulary_id)
 {
     $sql = SQLdatosVocabulario($vocabulary_id);
     $array = $sql->FetchRow();
     $arrayResponse["result"][vocabulary_id] = $array[vocabulario_id];
     $arrayResponse["result"][title] = $array[titulo];
     $arrayResponse["result"][author] = $array[autor];
     $arrayResponse["result"][lang] = $array[idioma];
     $arrayResponse["result"][scope] = $array[cobertura];
     $arrayResponse["result"][keywords] = $array[keywords];
     $arrayResponse["result"][uri] = $array[url_base];
     $arrayResponse["result"][createDate] = $array[cuando];
     $arrayResponse["result"][lastMod] = fetchlastMod();
     $ARRAYfetchValues = ARRAYfetchValues('METADATA');
     $ARRAYfetchContactMail = ARRAYfetchValue('CONTACT_MAIL');
     $arrayResponse["result"]["contributor"] = $ARRAYfetchValues["dc:contributor"]["value"];
     $arrayResponse["result"]["adminEmail"] = $ARRAYfetchContactMail["value"];
     $arrayResponse["result"]["publisher"] = $ARRAYfetchValues["dc:publisher"]["value"];
     $arrayResponse["result"]["rights"] = $ARRAYfetchValues["dc:rights"]["value"];
     $cant_term = ARRAYcantTerms4Thes("1");
     $arrayResponse["result"]["cant_terms"] = $cant_term["cant"];
     return $arrayResponse;
 }
Exemplo n.º 3
0
function HTMLformAltaEquivalenciaTermino($ARRAYTermino)
{
    $LabelEE = id_EQ . '#' . LABEL_termino_equivalente;
    $LabelIE = id_EQ_PARCIAL . '#' . LABEL_termino_parcial_equivalente;
    $LabelNE = id_EQ_NO . '#' . LABEL_termino_no_equivalente;
    $sql = SQLdatosVocabulario();
    $rows = '<div id="bodyText">';
    $rows .= '<a class="topOfPage" href="javascript: history.go(-1);">' . LABEL_Anterior . '</a>';
    $rows .= '<h1>' . LABEL_EditorTermino . '</h1>';
    $rows .= '  <fieldset>';
    $rows .= '    <legend>' . LABEL_relacion_vocabulario . ' <a href="index.php?tema=' . $ARRAYTermino[idTema] . '">' . $ARRAYTermino[titTema] . '</a></legend>';
    if ($sql[cant] == '1') {
        //No hay vocabularios de referencia, solo vocabulario principal
        $rows .= '<p class="error">' . ucfirst(LABEL_NO_vocabulario_referencia) . '</p>';
    } else {
        //Hay vobularios de referencia
        $array_vocabularios = array();
        while ($array = mysqli_fetch_array($sql[datos])) {
            if ($array[vocabulario_id] !== '1') {
                //vocabularios que no sean el vocabulario principal
                array_push($array_vocabularios, $array[vocabulario_id] . '#' . $array[titulo]);
            }
        }
        $rows .= '<form class="formdiv" name="alta_t" action="index.php" method="post" onsubmit="return checkrequired(this)">';
        $rows .= LABEL_Termino . ':<br/>';
        $rows .= '<textarea rows="2" cols="50" name="' . FORM_LABEL_termino . '" id="' . FORM_LABEL_termino . '"></textarea>';
        $rows .= '<label for="ref_vocabulario_id" accesskey="t">';
        $rows .= FORM_LABEL_nombre_vocabulario . '*</label>';
        $rows .= '<select id="ref_vocabulario_id" name="ref_vocabulario_id">';
        $rows .= '<optgroup label="' . FORM_LABEL_nombre_vocabulario . '">';
        $rows .= doSelectForm($array_vocabularios, "");
        $rows .= '</optgroup>';
        $rows .= '</select><br/>';
        $rows .= '<label for="tipo_equivalencia" accesskey="e">';
        $rows .= FORM_LABEL_tipo_equivalencia . '*</label>';
        $rows .= '<select id="tipo_equivalencia" name="tipo_equivalencia">';
        $rows .= '<optgroup label="' . FORM_LABEL_tipo_equivalencia . '">';
        $rows .= doSelectForm(array("{$LabelEE}", "{$LabelIE}", "{$LabelNE}"), "");
        $rows .= '</optgroup>';
        $rows .= '</select><br/>';
        $rows .= '<div class="submit_form" align="center">';
        $rows .= '<input type="submit"  name="boton" value="' . LABEL_Enviar . '"/>';
        $rows .= ' | <input type="button"  name="cancelar" type="button" onClick="location.href=\'index.php?tema=' . $ARRAYTermino[idTema] . '\'" value="' . ucfirst(LABEL_Cancelar) . '"/>';
        $rows .= '<INPUT TYPE="HIDDEN"  name="id_termino_eq" value="' . $ARRAYTermino[idTema] . '" />';
        $rows .= '</div>';
        $rows .= '</form>';
    }
    $rows .= '  </fieldset>';
    $rows .= '</div>';
    return $rows;
}
Exemplo n.º 4
0
function HTMLlistaVocabularios()
{
    $sql = SQLdatosVocabulario();
    $rows .= '<table cellpadding="0" cellspacing="0" summary="' . LABEL_lcConfig . '" >';
    $rows .= '<thead>';
    $rows .= '<tr>';
    $rows .= '<th class="izq" colspan="3">' . LABEL_lcConfig . ' &middot; [<a href="admin.php?vocabulario_id=0" title="' . MENU_NuevoVocabularioReferencia . '">' . LABEL_Agregar . ' ' . LABEL_vocabulario_referencia . '</a>]</th>';
    $rows .= '</tr>';
    $rows .= '<tr>';
    $rows .= '<th>' . ucfirst(LABEL_Titulo) . '</th>';
    $rows .= '<th>' . ucfirst(LABEL_Autor) . '</th>';
    $rows .= '<th>' . ucfirst(LABEL_tipo_vocabulario) . '</th>';
    $rows .= '</tr>';
    $rows .= '</thead>';
    $rows .= '<tbody>';
    while ($array = mysqli_fetch_array($sql[datos])) {
        $fecha_alta = do_fecha($listaUsers[cuando]);
        $rows .= '<tr>';
        $rows .= '<td class="izq"><a href="admin.php?vocabulario_id=' . $array[vocabulario_id] . '" title="' . MENU_DatosTesauro . ' ' . $array[titulo] . '">' . $array[titulo] . '</a> / ' . $array[idioma] . '</td>';
        $rows .= '<td class="izq">' . $array[autor] . '</td>';
        if ($array[vocabulario_id] == '1') {
            $rows .= '<td>' . LABEL_vocabulario_principal . '</td>';
        } else {
            $rows .= '<td>' . LABEL_vocabulario_referencia . '</td>';
        }
        $rows .= '</tr>';
    }
    $rows .= '</tbody>';
    $rows .= '<tfoot>';
    $rows .= '<tr>';
    $rows .= '<td colspan="3">' . $sql[cant] . '</td>';
    $rows .= '</tr>';
    $rows .= '</tfoot>';
    $rows .= '</table>        ';
    return $rows;
}
function HTMLlistaVocabularios()
{
    $sql = SQLdatosVocabulario();
    $rows .= '<div class="table-responsive"> ';
    $rows .= '<h3>' . ucfirst(LABEL_lcConfig) . ' &middot; <a class="btn btn-primary btn-xs" href="admin.php?vocabulario_id=0" title="' . MENU_NuevoVocabularioReferencia . '">' . ucfirst(LABEL_Agregar . ' ' . LABEL_vocabulario_referencia) . '</a></h3>';
    $rows .= '<table class="table table-striped table-bordered table-condensed table-hover"  summary="' . LABEL_lcConfig . '">';
    $rows .= '<thead>';
    $rows .= '<tr>';
    $rows .= '<th>' . ucfirst(LABEL_Titulo) . '</th>';
    $rows .= '<th>' . ucfirst(LABEL_Autor) . '</th>';
    $rows .= '<th>' . ucfirst(LABEL_tipo_vocabulario) . '</th>';
    $rows .= '</tr>';
    $rows .= '</thead>';
    $rows .= '<tbody>';
    while ($array = $sql->FetchRow()) {
        $fecha_alta = do_fecha($listaUsers[cuando]);
        $rows .= '<tr>';
        $rows .= '<td class="izq"><a href="admin.php?vocabulario_id=' . $array[vocabulario_id] . '" title="' . MENU_DatosTesauro . ' ' . $array[titulo] . '">' . $array[titulo] . '</a> / ' . $array[idioma] . '</td>';
        $rows .= '<td class="izq">' . $array[autor] . '</td>';
        if ($array[vocabulario_id] == '1') {
            $rows .= '<td>' . LABEL_vocabulario_principal . '</td>';
        } else {
            $rows .= '<td>' . LABEL_vocabulario_referencia . '</td>';
        }
        $rows .= '</tr>';
    }
    $rows .= '</tbody>';
    $rows .= '<tfoot>';
    $rows .= '<tr>';
    $rows .= '<td colspan="3">' . SQLcount($sql) . '</td>';
    $rows .= '</tr>';
    $rows .= '</tfoot>';
    $rows .= '</table>  </div>      ';
    return $rows;
}
function HTMLformAltaEquivalenciaTermino($ARRAYTermino)
{
    $LabelEE = id_EQ . '#' . LABEL_termino_equivalente;
    $LabelIE = id_EQ_PARCIAL . '#' . LABEL_termino_parcial_equivalente;
    $LabelNE = id_EQ_NO . '#' . LABEL_termino_no_equivalente;
    $sql = SQLdatosVocabulario();
    //SEND_KEY to prevent duplicated
    session_start();
    $_SESSION['SEND_KEY'] = md5(uniqid(rand(), true));
    $rows = '<div class="container" id="bodyText">';
    $rows .= '<script type="text/javascript">$("#form-tvocab").validate({});</script>';
    $rows .= '<a class="topOfPage" href="index.php?tema=' . $ARRAYtermino["idTema"] . '" title="' . LABEL_Anterior . '">' . LABEL_Anterior . '</a>';
    if (SQLcount($sql) == '1') {
        //No hay vocabularios de referencia, solo vocabulario principal
        $rows .= HTMLalertNoTargetVocabulary();
    } else {
        //Hay vobularios de referencia
        $array_vocabularios = array();
        while ($array = $sql->FetchRow()) {
            if ($array[vocabulario_id] !== '1') {
                //vocabularios que no sean el vocabulario principal
                array_push($array_vocabularios, $array[vocabulario_id] . '#' . $array[titulo]);
            }
        }
        $rows .= '<form class="" role="form"  name="alta_eqt" id="alta_eqt" action="index.php" method="post">';
        $rows .= '	<div class="row">
			    <div class="col-sm-12">
			        <legend>' . ucfirst(LABEL_relacion_vocabulario) . ' <a href="index.php?tema=' . $ARRAYTermino["idTema"] . '">' . $ARRAYTermino["titTema"] . '</a></legend>
			    </div>
			    <!-- panel  -->

			    <div class="col-lg-7">
			        <div class="panel panel-default">
			            <div class="panel-body form-horizontal">

			            <div class="form-group">
			            <label for="' . ref_vocabulario_id . '" accesskey="v" class="col-sm-3 control-label">' . ucfirst(FORM_LABEL_nombre_vocabulario) . '</label>
			                <div class="col-sm-9">
			                    <select class="form-control" id="ref_vocabulario_id" name="ref_vocabulario_id">
			                    ' . doSelectForm($array_vocabularios, $_GET["tvocab_id"]) . '
			                    </select>
			                </div>
			            </div>
			                <div class="form-group">
			                    <label class="col-sm-3 control-label" for="' . FORM_LABEL_termino . '" accesskey="t">' . ucfirst(LABEL_Termino) . '</label>
			                    <div class="col-sm-9">
			                        <input type="text" class="form-control" required name="' . FORM_LABEL_termino . '" id="' . FORM_LABEL_termino . '"/>
			                    </div>
			                </div>

											<div class="form-group">
					            <label for="tipo_equivalencia" accesskey="q" class="col-sm-3 control-label">' . ucfirst(FORM_LABEL_tipo_equivalencia) . '</label>
					                <div class="col-sm-9">
					                    <select class="form-control" id="tipo_equivalencia" name="tipo_equivalencia">
					                    ' . doSelectForm(array("{$LabelEE}", "{$LabelIE}", "{$LabelNE}"), "") . '
					                    </select>
					                </div>
					            </div>
			                <div class="form-group">
			                    <div class="col-sm-12 text-right">
			                     <button type="submit" class="btn btn-primary" value="' . LABEL_Enviar . '"/>' . ucfirst(LABEL_Enviar) . '</button>
			                      <button type="button" class="btn btn" name="cancelar" type="button" onClick="location.href=\'index.php?tema=' . $ARRAYTermino["idTema"] . '\'" value="' . ucfirst(LABEL_Cancelar) . '"/>' . ucfirst(LABEL_Cancelar) . '</button>
			                    </div>
			                </div>
			            </div>
			        </div>
			    </div> <!-- / panel  -->';
        $rows .= '<input type="hidden"  name="id_termino_eq" value="' . $ARRAYTermino["idTema"] . '" />';
        $rows .= '<input type="hidden"  name="ks" id="ks" value="' . $_SESSION["SEND_KEY"] . '"/>';
        $rows .= '</form>';
        $rows .= '<script id="tvocab_script" type="text/javascript">
			$(document).ready(function() {
				var validator = $("#alta_eqt").validate({
					rules: {\'' . FORM_LABEL_termino . '\':  {required: true},
				},
				debug: true,
				errorElement: "label",
				submitHandler: function(form) {
					form.submit();
				}

			});
		});
		</script>	';
    }
    $rows .= '</div>';
    return $rows;
}
Exemplo n.º 7
0
 function fetchVocabularyData($vocabulary_id)
 {
     $sql = SQLdatosVocabulario($vocabulary_id);
     $array = mysqli_fetch_array($sql[datos]);
     $arrayResponse["result"][vocabulary_id] = $array[vocabulario_id];
     $arrayResponse["result"][title] = $array[titulo];
     $arrayResponse["result"][author] = $array[autor];
     $arrayResponse["result"][lang] = $array[idioma];
     $arrayResponse["result"][scope] = $array[cobertura];
     $arrayResponse["result"][keywords] = $array[keywords];
     $arrayResponse["result"][uri] = $array[url_base];
     return $arrayResponse;
 }