/common/include/fun.html_forms.php
PHP | 2889 lines | 2502 code | 235 blank | 152 comment | 184 complexity | ec18625ddca6123ad7e5f8cb0ca9005d MD5 | raw file
Possible License(s): LGPL-2.1, MIT, CC-BY-3.0
Large files files are truncated, but you can click here to view the full file
- <?php
- if ((stristr($_SERVER['REQUEST_URI'], "session.php") ) || ( !defined('T3_ABSPATH') )) {
- die("no access");
- }
- // TemaTres : aplicación para la gestión de vocabularios controlados# #
- // TemaTres : web application to manage controlled vocabularies
- //
- // Copyright (C) 2004-2021 Diego Ferreyra tematres@r020.com.ar
- // Distribuido bajo Licencia GNU Public License, versión 2 (de junio de 1.991) Free Software Foundation
- //
- //
- // Funciones para presentar formularios HTML. #
- //
- function HTMLformAssociateFreeTerms($ARRAYterm_id = array(), $taskterm = "")
- {
- if (count($ARRAYterm_id)==0) {
- return HTMLformVerTerminosLibres();
- }
- //list terms_id
- foreach ($ARRAYterm_id as $term_id) {
- if (is_numeric($term_id)) {
- $tema_id_list.=$term_id.',';
- }
- }
- //fetch free terms
- $sqlTerms=SQLlistaTema_id($tema_id_list);
- $cantFreeTerms=SQLcount($sqlTerms);
- if ($cantFreeTerms==0) {
- return HTMLformVerTerminosLibres();
- }
- while ($arrayFreeTerms=$sqlTerms->FetchRow()) {
- $freeTerms.=HTMLlinkTerm($arrayFreeTerms).', ';
- $freeTermsHiddenTag.= '<input type="hidden" name="freeTerms_id[]" id="freeTerm_'.$arrayFreeTerms["tema_id"].'" value="'.$arrayFreeTerms["tema_id"].'" />';
- }
- $HTMLfreeTerms=substr($freeTerms, 0, -2);
- if (doValue($_POST, FORM_LABEL_buscarTermino)) {
- $expresBusca=doValue($_POST, FORM_LABEL_buscarTermino);
- //seleccionar SQL adecuado a la operacion
- $sql_busca=SQLsearchPrefTermsNotInList($tema_id_list, $expresBusca);
- $cant_result=SQLcount($sql_busca);
- $search_leyenda='<h3>'.$cant_result.' '.MSG_ResultBusca.' <i>'.$expresBusca.'</i>.</h3>'."\n\r";
- if ($cant_result>0) {
- $rows_busca.='<div><input id="filter" type="text" class="form-control" placeholder="'.ucfirst(LABEL_type2filter).'"></div>';
- $rows_busca.='<form role="form" class="form-inline" role="form" name="addRelations" id="addRelations" action="index.php?taskrelations=freeTermsAssoc" method="post">';
- $rows_busca.='<div class="table-responsive"> ';
- $rows_busca.='<table class="table table-striped table-bordered table-condensed table-hover"">';
- $rows_busca.='<thead> <tr><th>';
- $rows_busca.='</th><th>'.ucfirst(LABEL_Termino).'</th><th>'.ucfirst(LABEL_Fecha).'</th> </tr></thead> <tbody class="searchable">';
- while ($resulta_busca=$sql_busca->FetchRow()) {
- $css_class_MT=($resulta_busca["isMetaTerm"]==1) ? ' class="metaTerm" ' : '';
- $alert_MT=($resulta_busca["isMetaTerm"]==1) ? ' ('.LABEL_meta_term.') ' : '';
- $rows_busca.= '<tr>';
- $rows_busca.= ' <td align="center"><input type="radio" name="rema_id" id="rema_'.$resulta_busca["tema_id"].'" title="'.$resulta_busca["tema"].'" value="'.$resulta_busca["tema_id"].'" /> </td>';
- $rows_busca.= ' <td><label for="rema_'.$resulta_busca["tema_id"].'" '.$css_class_MT.'> '.$resulta_busca["tema"].'</label> '.$alert_MT.' </td>';
- $rows_busca.= ' <td>'.$resulta_busca["cuando"].'</td>';
- $rows_busca.= '</tr>';
- }
- $rows_busca.=' </tbody>';
- $rows_busca.='<tfoot>
- <tr>
- <td colspan=3>';
- $rows_busca.=' <input type="hidden" name="taskterm" id="taskterm" value="aaa"/> ';
- $rows_busca.=' <input type="hidden" name="taskrelations" id="taskrelations" value="'.$taskterm.'"/> ';
- $rows_busca.=$freeTermsHiddenTag;
- $rows_busca.= ' </td>
- </tr>
- </tfoot>
- </table> </div>';
- //no es subordinar término y hay resultados
- if ($cant_result>0) {
- $rows_busca.='<div class="form-group"><label for="rel_free_term" accesskey="r">'.ucfirst(LABEL_selectRelation).' ';
- $rows_busca.='<select class="form-control" id="rel_free_term" name="rel_free_term">';
- $rows_busca.=doSelectForm(array('2#'.ucfirst(TR_termino),'3#'.ucfirst(TE_termino),'4#'.ucfirst(UP_termino)), "");
- $rows_busca.='</select>';
- $rows_busca.=' <button type="submit" class="btn btn-primary">'.LABEL_Enviar.'</button>';
- $rows_busca.='</div>';
- }
- $rows_busca.='</form>';
- }//if cant
- $rows_busca.='</div>';
- };//fin de if buscar
- $rows.='<div class="container" id="bodyText">
- <a class="topOfPage" href="'.URL_BASE.'index.php?verT=L" title="'.LABEL_Anterior.'">'.LABEL_Anterior.'</a>
- <h3>'.LABEL_EditorTermino.'</h3>';
- if ($new_relacion["log"]==true) {
- $rows.='<p class="success">'.ucfirst(LABEL_saved).'</p>';
- }
- $rows.=' <form class="form-inline" role="form" name="busca_rel" action="index.php?verT=LA" method="post">';
- $rows.=' <fieldset> <legend>'.$nombre_pantalla.'</legend>';
- $rows.='<div class="well">'.ucfirst(LABEL_associateFreeTerms).' ('.$cantFreeTerms.'): '.$HTMLfreeTerms.'. <p class="bg-warning">'.ucfirst(MSG_associateFreeTerms).'</p></div>';
- $rows.='<input class="form-inline input_ln form-control" name="'.FORM_LABEL_buscarTermino.'" type="search" id="addExistTerm" maxlength="50"/>
- <button type="submit" class="btn btn-primary">'.LABEL_Buscar.'</button>
- <button type="button" class="btn btn-default" onClick="location.href=\'index.php?verT=L\'">'.ucfirst(LABEL_Cancelar).'</button>';
- $rows.=$freeTermsHiddenTag;
- $rows.='</form>';
- $rows.='</fieldset>';
- $rows.=$search_leyenda;
- $rows.=$rows_busca;
- $rows.=' </div>';
- return $rows;
- }
- function HTMLformAssociateExistTerms($taskterm, $ARRAYtermino, $term_id = "0")
- {
- global $new_relacion;
- $link_term=HTMLlinkTerm(array("tema_id"=>$ARRAYtermino["tema_id"],"tema"=>$ARRAYtermino["titTema"]));
- switch ($taskterm) {
- case 'addRT':
- $nombre_pantalla=ucfirst(LABEL_AgregarRTexist).$link_term;
- break;
- case 'addBT':
- $nombre_pantalla=sprintf(LABEL_AgregarTG, $link_term);
- break;
- case 'addFreeUF':
- $nombre_pantalla=sprintf(LABEL_existAgregarUP, $link_term);
- break;
- case 'addFreeNT':
- $nombre_pantalla=sprintf(LABEL_existAgregarTE, $link_term);
- break;
- case 'addNT':
- $nombre_pantalla=sprintf(MENU_selectExistTerm, $link_term);
- break;
- default:
- '';
- }
- if (in_array($_GET["showTerms"], array('free','nt','tt'))) {
- if ($_GET["showTerms"]=="free") {
- $sql_busca=SQLverTerminosLibres();
- $cant_result=SQLcount($sql_busca);
- $search_leyenda='<h3>'.$cant_result.' '.LABEL_terminosLibres.'</h3>'."\n\r";
- }//seleccionar SQL adecuado a la operacion
- if (($_GET["showTerms"]=='tt') && (in_array($taskterm, array('addBT','addFreeNT')))) {
- $sql_busca=SQLverTopTerm();
- $cant_result=SQLcount($sql_busca);
- $search_leyenda='<h3>'.$cant_result.' '.LABEL_TTTerms.'</h3>'."\n\r";
- }
- } else {
- if ((doValue($_POST, FORM_LABEL_buscarTermino))) {
- $expresBusca=doValue($_POST, FORM_LABEL_buscarTermino);
- $expresBusca=trim($expresBusca);
- if (($taskterm=='addFreeNT') || ($taskterm=='addFreeUF')) {
- //if enable polijerarquia
- //$sql_busca = ($array_vocabulario["polijerarquia"]==1) ? SQLsearchTerms4NT($expresBusca, $ARRAYtermino["idTema"]) : SQLsearchFreeTerms($expresBusca, $ARRAYtermino["idTema"]);
- $sql_busca = SQLsearchTerms4NT($expresBusca, $ARRAYtermino["idTema"],$_SESSION["CFGPolijerarquia"]);
- $cant_result=SQLcount($sql_busca);
- $search_leyenda='<h3>'.$cant_result.' '.MSG_ResultBusca.' <i>'.$expresBusca.'</i>.</h3>'."\n\r";
- } else {
- $sql_busca=SQLbuscaTR($ARRAYtermino["idTema"], "$expresBusca");
- $cant_result=SQLcount($sql_busca);
- $search_leyenda='<h3>'.$cant_result.' '.MSG_ResultBusca.' <i>'.$expresBusca.'</i>.</h3>'."\n\r";
- }
- }
- }
- if ($cant_result>0) {
- $rows_busca.='<div><input id="filter" type="text" class="form-control" placeholder="'.ucfirst(LABEL_type2filter).'"></div>';
- $rows_busca.='<form role="form" class="form-inline" role="form" name="addRelations" id="addRelations" action="index.php" method="get" >';
- $rows_busca.='<div class="table-responsive"> ';
- $rows_busca.='<table class="table table-striped table-bordered table-condensed table-hover"">';
- $rows_busca.='<thead>
- <tr><th>';
- $rows_busca.='</th><th>'.ucfirst(LABEL_Termino).'</th>
- <th>'.ucfirst(LABEL_Fecha).'</th>
- </tr>
- </thead>
- <tbody class="searchable">';
- while ($resulta_busca=$sql_busca->FetchRow()) {
- $css_class_MT=($resulta_busca["isMetaTerm"]==1) ? ' class="metaTerm" ' : '';
- $alert_MT=($resulta_busca["isMetaTerm"]==1) ? ' ('.LABEL_meta_term.') ' : '';
- //prevenir que no seleccione el mismo término que esta mirando
- if ($resulta_busca["tema_id"]!==$ARRAYtermino["idTema"]) {
- if ($taskterm=='addBT') {
- $rows_busca.= '<tr>';
- $rows_busca.= ' <td align="center"><input type="radio" name="rema_id" id="rema_'.$resulta_busca["tema_id"].'" title="'.$resulta_busca["tema"].'" value="'.$resulta_busca["tema_id"].'" /> </td>';
- $rows_busca.= ' <td><label for="rema_'.$resulta_busca["tema_id"].'" '.$css_class_MT.'> '.$resulta_busca["tema"].'</label> '.$alert_MT.' </td>';
- $rows_busca.= ' <td>'.$resulta_busca["cuando"].'</td>';
- $rows_busca.= ' </tr>';
- } else {
- $rows_busca.= '<tr>';
- $rows_busca.= ' <td align="center"><input type="checkbox" name="rema_id[]" id="rema_'.$resulta_busca["tema_id"].'" title="'.$resulta_busca["tema"].'" value="'.$resulta_busca["tema_id"].'" /> </td>';
- $rows_busca.= ' <td><label class="check_label" for="rema_'.$resulta_busca["tema_id"].'" '.$css_class_MT.'> '.$resulta_busca["tema"].'</label> '.$alert_MT.' </td>';
- $rows_busca.= ' <td>'.$resulta_busca["cuando"].'</td>';
- $rows_busca.= ' </tr>';
- }
- };
- }
- $rows_busca.=' </tbody>';
- $rows_busca.='<tfoot>
- <tr>
- <td colspan=3>';
- $rows_busca.=' <input type="hidden" name="tema" id="tema" value="'.$ARRAYtermino["idTema"].'"/>';
- $rows_busca.=' <input type="hidden" name="taskterm" id="taskterm" value="'.$taskterm.'"/> ';
- $rows_busca.=' <input type="hidden" name="taskrelations" id="taskrelations" value="'.$taskterm.'"/> ';
- $rows_busca.= ' </td>
- </tr>
- </tfoot>
- </table> </div>';
- //no es subordinar término y hay resultados
- if ($cant_result>0) {
- $rows_busca.='<div class="submit_form" align="center">';
- $rows_busca.=' <button type="submit" class="btn btn-primary">'.LABEL_Agregar.'</button>';
- $rows_busca.='</div>';
- }
- $rows_busca.='</form>';
- }//if cant
- $rows_busca.='</div>';
- $rows_busca.='<script type="text/javascript">
- $(document).ready(function(){
- //Checkbox
- $("input[name=checktodos]").change(function(){
- $("input[type=checkbox]").each( function() {
- if($("input[name=checktodos]:checked").length == 1){
- this.checked = true;
- } else {
- this.checked = false;
- }
- });
- });
- });
- </script>';
- $rows.='<div class="container" id="bodyText">
- <a class="topOfPage" href="'.URL_BASE.'index.php?tema='.$ARRAYtermino["idTema"].'" title="'.LABEL_Anterior.' ('.$ARRAYtermino["tema"].')">'.LABEL_Anterior.'</a>
- <h3>'.LABEL_EditorTermino.'</h3>';
- if ($new_relacion["log"]==true) {
- $rows.='<p class="success">'.ucfirst(LABEL_saved).'</p>';
- }
- $rows.=' <form class="form-inline" role="form" name="busca_rel" action="index.php?taskterm='.$taskterm.'&tema='.$ARRAYtermino["idTema"].'" method="post">';
- $rows.=' <fieldset>
- <legend>'.$nombre_pantalla.'</legend>
- <input class="form-inline input_ln form-control" name="'.FORM_LABEL_buscarTermino.'" type="search" id="addExistTerm" maxlength="50"/>
- <button type="submit" class="btn btn-primary">'.LABEL_Buscar.'</button>
- <button type="button" class="btn btn-info" onClick="location.href=\'index.php?tema='.$ARRAYtermino["idTema"].'&taskterm='.$taskterm.'&showTerms=free\'"/>'.ucfirst(LABEL_showFreeTerms).'</button>';
- if (in_array($taskterm, array('addBT','addFreeNT'))) {
- $rows.=' <button type="button" class="btn btn-info" onClick="location.href=\'index.php?tema='.$ARRAYtermino["idTema"].'&taskterm='.$taskterm.'&showTerms=tt\'"/>'.ucfirst(LABEL_TTTerms).'</button>';
- }
- $rows.=' <button type="button" class="btn btn-default" onClick="location.href=\'index.php?tema='.$ARRAYtermino["idTema"].'\'">'.ucfirst(LABEL_Cancelar).'</button>
- <input type="hidden" name="tema" value="'.$ARRAYtermino["idTema"].'"/>
- <input type="hidden" name="taskterm" value="'.$taskterm.'"/>
- </form>';
- //if(in_array($taskterm, array("addFreeUF","addFreeNT"))) $rows.='<p class="text-warning">'.LABEL_helpSearchFreeTerms.'</p>';
- $rows.='</fieldset>';
- $rows.=$search_leyenda;
- $rows.=$rows_busca;
- $rows.=' </div>';
- return $rows;
- }
- /*
- * Form for edit or add terms
- 3 casos:
- - Alta y edici�n de un t�rmino nuevo.
- - Alta de un t�rmino no preferido de un t�rmino preferido.
- - Alta de un t�rmino subordinado a un t�rmino.
- *
- */
- function HTMLformEditTerms($taskterm, $ARRAYtermino = "0")
- {
- //SEND_KEY to prevent duplicated
- session_start();
- $_SESSION['SEND_KEY']=md5(uniqid(rand(), true));
- switch ($taskterm) {
- case 'addTerm':// add term
- $nombre_pantalla=LABEL_AgregarT;
- $hidden='<input type="hidden" name="alta_t" value="new" />';
- $hidden.='<div><input type="checkbox" name="estado_id" id="estado_id" value="12" alt="'.ucfirst(LABEL_Candidato).'" /> <label for="estado_id" accesskey="e">'.ucfirst(LABEL_Candidato).'</label></div>';
- $hidden.='<div><input type="checkbox" name="isMetaTerm" id="isMetaTerm" value="1" alt="'.ucfirst(LABEL_meta_term).'" /> <label for="isMetaTerm" accesskey="e">'.ucfirst(LABEL_meta_term).'</label>
- <div class="alert alert-info" role="alert">'.NOTE_isMetaTermNote.'</div>
- </div>';
- $help_rows='<p class="text-primary">'.HELP_variosTerminos.'</p>';
- $extra_button='<a class="btn btn-second btn-xs" role="button" href="'.URL_BASE.'index.php?taskterm=addTermSuggested" title="'.ucfirst(LABEL__getForRecomendation).'">'.ucfirst(LABEL__getForRecomendation).'</a>';
- break;
- case 'editTerm'://Edici�n de un t�rmino $edit_id
- $nombre_pantalla=LABEL_editT.HTMLlinkTerm(array("tema_id"=>$ARRAYtermino["idTema"],"tema"=>$ARRAYtermino["titTema"]));
- $vista_titulo_tema=$ARRAYtermino["titTema"];
- $vista_desc_tema=$ARRAYtermino["descTema"];
- $hidden='<input type="hidden" name="edit_id_tema" value="'.$ARRAYtermino["idTema"].'" />';
- break;
- case 'addNT':// add narowwer term
- $nombre_pantalla=LABEL_AgregarTE.HTMLlinkTerm(array("tema_id"=>$ARRAYtermino["idTema"],"tema"=>$ARRAYtermino["titTema"]));
- $hidden.='<input type="hidden" name="id_termino_sub" value="'.$ARRAYtermino["idTema"].'" />';
- $help_rows='<p class="text-primary">'.HELP_variosTerminos.'</p>';
- $extra_button='<a class="btn btn-second btn-xs" role="button" href="'.URL_BASE.'index.php?taskterm=addFreeNT&tema='.$ARRAYtermino["idTema"].'" title="'.ucfirst(MENU_selectExistTerm).'">'.ucfirst(MENU_selectExistTerm).'</a>';
- $extra_button.=' <a class="btn btn-second btn-xs" role="button" href="'.URL_BASE.'index.php?taskterm=findSuggestionTargetTerm&tema='.$ARRAYtermino["idTema"].'&t_relation=3" title="'.ucfirst(LABEL__getForRecomendation).'">'.ucfirst(LABEL__getForRecomendation).'</a>';
- $t_relation='3';
- break;
- case 'addUF'://Alta de un t�rmino no preferido a $id_uf
- $nombre_pantalla=LABEL_AgregarUP.HTMLlinkTerm(array("tema_id"=>$ARRAYtermino["idTema"],"tema"=>$ARRAYtermino["titTema"]));
- $hidden='<input type="hidden" name="id_termino_uf" value="'.$ARRAYtermino["idTema"].'" />';
- $help_rows='<p class="text-primary">'.HELP_variosTerminos.'</p>';
- $extra_button='<a class="btn btn-second btn-xs" role="button" href="'.URL_BASE.'index.php?taskterm=addFreeUF&tema='.$ARRAYtermino["idTema"].'" title="'.ucfirst(MENU_AgregarUPexist).'">'.ucfirst(MENU_AgregarUPexist).'</a>';
- $extra_button.=' <a class="btn btn-second btn-xs" role="button" href="'.URL_BASE.'index.php?taskterm=findSuggestionTargetTerm&tema='.$ARRAYtermino["idTema"].'&t_relation=4" title="'.ucfirst(LABEL__getForRecomendation).'">'.ucfirst(LABEL__getForRecomendation).'</a>';
- $t_relation='4';
- break;
- case 'addRTnw'://Alta de un término RT
- $nombre_pantalla=LABEL_AgregarTR.HTMLlinkTerm(array("tema_id"=>$ARRAYtermino["idTema"],"tema"=>$ARRAYtermino["titTema"]));
- $hidden='<input type="hidden" name="id_termino_rt" value="'.$ARRAYtermino["idTema"].'" />';
- $help_rows='<p class="text-primary">'.HELP_variosTerminos.'</p>';
- $extra_button='<a class="btn btn-second btn-xs" role="button" href="'.URL_BASE.'index.php?taskterm=addRT&tema='.$ARRAYtermino["idTema"].'" title="'.ucfirst(MENU_selectExistTerm).'">'.ucfirst(MENU_selectExistTerm).'</a>';
- $extra_button.=' <a class="btn btn-second btn-xs" role="button" href="'.URL_BASE.'index.php?taskterm=findSuggestionTargetTerm&tema='.$ARRAYtermino["idTema"].'&t_relation=2" title="'.ucfirst(LABEL__getForRecomendation).'">'.ucfirst(LABEL__getForRecomendation).'</a>';
- $t_relation='2';
- break;
- };
- $rows.='<div class="container" id="bodyText">';
- $rows.='<div class="row">';
- $rows.='<a class="topOfPage" href="'.URL_BASE.'index.php?tema='.$ARRAYtermino["idTema"].'" title="'.LABEL_Anterior.'">'.LABEL_Anterior.'</a>
- <h3>'.LABEL_EditorTermino .'</h3>';
- $rows.='<form class="form-horizontal col-xs-12 col-md-8" role="form" id="alta_t" name="alta_t" action="index.php" method="post">
- <fieldset>
- <legend>'.$nombre_pantalla.'</legend>
- <div class="form-group form-group-chk">
- <label for="'.FORM_LABEL_termino .'" accesskey="t">'.LABEL_Termino.'</label>
- '.$extra_button.'
- <textarea class="form-control" type="text" required autofocus rows="2" cols="60" name="'.FORM_LABEL_termino.'" id="addTerms">'.$vista_titulo_tema.'</textarea>';
- $rows.=$help_rows;
- $rows.=$extra_tag;
- $rows.='</div>';
- if (in_array($t_relation, array(2,3,4))) {
- $SQLtypeRelations=SQLtypeRelations($t_relation);
- if (SQLcount($SQLtypeRelations)>0) {
- while ($ARRAYtypeRelations=$SQLtypeRelations->FetchRow()) {
- $arraySelectTypeRelations[]=$ARRAYtypeRelations["rel_rel_id"].'#'.$ARRAYtypeRelations["rr_value"];
- $neutralLabel=LABELrelTypeSYS($ARRAYtypeRelations["t_relation"]);
- }
- $rows.='<div class="form-group"><label for="rel_rel_id" accesskey="r">'.ucfirst(LABEL_relationSubType).'<span class="small">('.LABEL_optative.')</span></label>';
- $rows.='<select class="form-control" id="t_rel_rel_id" name="t_rel_rel_id"><option>'.ucfirst(LABEL_seleccionar).'</option>';
- $rows.=doSelectForm($arraySelectTypeRelations, "");
- $rows.='</select>';
- $rows.='</div>';
- }
- }
- $rows.='<div class="text-center">';
- $rows.='<input type="submit" class="btn btn-primary" role="button" name="boton" value="'.LABEL_Enviar.'"/>';
- $rows.=' <input type="button" class="btn btn-default" role="button" name="cancelar" type="button" onClick="location.href=\'index.php?tema='.$ARRAYtermino["idTema"].'\'" value="'.ucfirst(LABEL_Cancelar).'"/>';
- $rows.='</div>';
- $rows.=$hidden;
- $rows.='<input type="hidden" name="ks" id="ks" value="'.$_SESSION["SEND_KEY"].'"/>';
- $rows.=' </fieldset>';
- $rows.='</form>';
- $rows.=' </div>';//row
- $rows.='</div>';//container
- return $rows;
- }
- /*
- * Form for edit or add terms
- 1 caso:
- - Alta de un t�rmino nuevo.
- *
- */
- function HTMLformSuggestTerms($ARRAYtargetVocabulary = array())
- {
- global $CFG;
- //SEND_KEY to prevent duplicated
- session_start();
- $_SESSION['SEND_KEY']=md5(uniqid(rand(), true));
- $sql=SQLtargetVocabulary("1");
- $rows='<div class="container" id="bodyText">';
- $rows.='<a class="topOfPage" href="'.URL_BASE.'index.php?taskterm=addTerm" title="'.LABEL_Anterior.'">'.LABEL_Anterior.'</a>';
- if (SQLcount($sql)=='0') {
- //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["tvocab_id"].'#'.FixEncoding($array["tvocab_label"].' - '.$CFG["ISO639-1"][$array["tvocab_lang"]][1]));
- }
- };
- $searchType=(!$_GET["tvocab_id"]) ? 1 : $_GET["searchType"];
- $string2search = XSSprevent(trim($_GET["string2search"]));
- $rows.='<form class="" role="form" name="alta_tt" id="alta_tt" action="index.php#suggestResult" method="get">';
- $rows.=' <div class="row">
- <div>
- <legend>'.ucfirst(LABEL_EditorTermino).'</legend>
- </div>
- <!-- panel -->
- <div class="col-lg-10">
- <h4>'.ucfirst(LABEL__getForRecomendation).'</h4>
- <div class="panel panel-default">
- <div class="panel-body form-horizontal">
- <div class="form-group">
- <label for="tvocab_id" class="col-sm-3 control-label">'.ucfirst(FORM_LABEL_nombre_vocabulario).'</label>
- <div class="col-sm-9">
- <select class="form-control" id="tvocab_id" name="tvocab_id">
- '.doSelectForm($array_vocabularios, $_GET["tvocab_id"]).'
- </select>
- </div>
- </div>
- <div class="form-group">
- <label for="string2search" class="col-sm-3 control-label">'.ucfirst(LABEL_Buscar).'</label>
- <div class="col-sm-9">
- <input type="text" class="form-control" required autofocus type="search" id="string2search" name="string2search" value="">
- </div>
- </div>
- <div class="col-sm-3 control-label">
- <label for="searchType">'.ucfirst(LABEL_esFraseExacta).'</label>
- </div>
- <div class="class="col-sm-9" form-group">
- <input type="checkbox" name="searchType" id="searchType" value="1" alt="'.ucfirst(LABEL_esFraseExacta).'" '.do_check(1, $searchType, 'checked').' />
- </div>
- <div class="form-group">
- <div class="col-sm-12 text-right">
- <button type="submit" class="btn btn-primary" value="'.LABEL_Buscar.'"/>'.ucfirst(LABEL_Buscar).'</button>
- <button type="button" class="btn btn" name="cancelar" type="button" onClick="location.href=\'index.php?taskterm=addTerm&tema=0\'" value="'.ucfirst(LABEL_Cancelar).'"/>'.ucfirst(LABEL_Cancelar).'</button>
- </div>
- </div>
- </div>
- </div>
- </div> <!-- / panel -->';
- $rows.='<input type="hidden" name="taskterm" value="addTermSuggested"/>';
- $rows.='</form>';
- }
- if (($string2search) && ($_GET["tvocab_id"])) {
- include_once T3_ABSPATH . 'common/include/vocabularyservices.php' ;
- $arrayVocab=ARRAYtargetVocabulary($_GET["tvocab_id"]);
- $task=($_GET["searchType"]==1) ? 'fetch' : 'search';
- $dataTterm=getURLdata($arrayVocab["tvocab_uri_service"].'?task='.$task.'&arg='.urlencode($string2search));
- if ($dataTterm->resume->cant_result > "0") {
- $arrayTtermData = array();
- foreach ($dataTterm->result->term as $value) {
- $i=++$i;
- $term_id=(int) $value->term_id;
- $string=(string) $value->string;
- $source_date= ($value->date_mod>0) ? $value->date_mod : $value->date_create ;
- $arrayTtermData[$term_id]=array("term_id"=>$term_id,
- "string"=>$string,
- "source_string"=>$string,
- "source_term_id"=>$term_id,
- "source_date"=> $source_date
- );
- };
- }
- //null for t_relation
- $t_relation=0;
- $rows.=' </div>';//row
- $rows.=HTMLformTargetVocabularySuggested($arrayTtermData, $t_relation, $string2search, $arrayVocab, $ARRAYtermino["idTema"]);
- };//fin de if buscar
- $rows.=' </div>';//container
- return $rows;
- }
- /*
- * Form for edit or add terms
- 3 casos:
- - Alta y edici�n de un t�rmino relacionado.
- - Alta de un t�rmino no preferido de un t�rmino preferido.
- - Alta de un t�rmino subordinado a un t�rmino.
- *
- */
- function HTMLformSuggestTermsXRelations($ARRAYtermino, $ARRAYtargetVocabulary = array())
- {
- //SEND_KEY to prevent duplicated
- session_start();
-
- $_SESSION['SEND_KEY']=md5(uniqid(rand(), true));
-
- $rows='<div class="container" id="bodyText">';
- $rows.='<a class="topOfPage" href="'.URL_BASE.'index.php?tema='.$ARRAYtermino["idTema"].'" title="'.LABEL_Anterior.'">'.LABEL_Anterior.'</a>';
- $rows.='<h3>'.HTMLlinkTerm(array("tema_id"=>$ARRAYtermino["idTema"],"tema"=>$ARRAYtermino["titTema"])).'</h3>';
- $sql=SQLtargetVocabulary("1");
- if (SQLcount($sql)=='0') {
- //No hay vocabularios de referencia, solo vocabulario principal
- $rows.=HTMLalertNoTargetVocabulary();
- } else {
- //Hay vobularios de referencia
- while ($array=$sql->FetchRow()) {
- if ($array["vocabulario_id"]!=='1') {
- //vocabularios que no sean el vocabulario principal
- $array_vocabularios[]=$array["tvocab_id"].'#'.FixEncoding($array["tvocab_label"]);
- }
- };
- //Configurar opcion búsqueda por código
- $arrayOptions= array('3#'.ucfirst(TE_termino),'4#'.ucfirst(UP_termino),'2#'.ucfirst(TR_termino));
- $string2search = ($_GET["string2search"]) ? XSSprevent(trim($_GET["string2search"])) : $ARRAYtermino["titTema"];
- $searchType=(!$_GET["tvocab_id"]) ? 1 : $_GET["searchType"];
- $rows.='<form class="" role="form" name="alta_tt" id="alta_tt" action="index.php#suggestResult" method="get">';
- $rows.=' <div class="row">
- <div class="col-sm-12">
- <legend>'.ucfirst(LABEL_EditorTermino).'</legend>
- </div>
- <!-- panel -->
- <div class="col-lg-7">
- <h4>'.ucfirst(LABEL__getForRecomendation).'</h4>
- <div class="panel panel-default">
- <div class="panel-body form-horizontal">
- <div class="form-group">
- <label for="tvocab_id" class="col-sm-3 control-label">'.ucfirst(FORM_LABEL_nombre_vocabulario).'</label>
- <div class="col-sm-9">
- <select class="form-control" id="tvocab_id" name="tvocab_id">
- '.doSelectForm($array_vocabularios, $_GET["tvocab_id"]).'
- </select>
- </div>
- </div>
- <div class="form-group">
- <label for="t_relation" class="col-sm-3 control-label">'.ucfirst(LABEL_relationSubType).'</label>
- <div class="col-sm-9">
- <select class="form-control" id="t_relation" name="t_relation">
- '.doSelectForm($arrayOptions, $_GET["t_relation"]).'
- </select>
- </div>
- </div>
- <div class="form-group">
- <label for="string2search" class="col-sm-3 control-label">'.ucfirst(LABEL_Buscar).'</label>
- <div class="col-sm-9">
- <input type="text" class="form-control" type="search" required autofocus id="string2search" name="string2search" value="'.$ARRAYtermino["titTema"].'">
- </div>
- </div>
- <div class="form-group">
- <input type="checkbox" name="searchType" id="searchType" value="1" alt="'.ucfirst(LABEL_esFraseExacta).'" '.do_check(1, $searchType, 'checked').' />
- <div class="col-sm-4">
- <label for="searchType">'.ucfirst(LABEL_esFraseExacta).'</label>
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-12 text-right">
- <button type="submit" class="btn btn-primary" value="'.LABEL_Buscar.'"/>'.ucfirst(LABEL_Buscar).'</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="tema" value="'.$ARRAYtermino["idTema"].'"/>';
- $rows.='<input type="hidden" name="taskterm" value="findSuggestionTargetTerm"/>';
- $rows.='</form>';
- }
- $rows.='</div>';
- $t_relation=(in_array($_GET["t_relation"], array("4","3","2","0"))) ? $_GET["t_relation"] : '';
- if (($string2search) && ($_GET["tvocab_id"])) {
- include_once T3_ABSPATH . 'common/include/vocabularyservices.php' ;
- $arrayVocab=ARRAYtargetVocabulary($_GET["tvocab_id"]);
- $task=($_GET["searchType"]==1) ? 'fetch' : 'search';
- $dataTterm=getURLdata($arrayVocab["tvocab_uri_service"].'?task='.$task.'&arg='.urlencode($string2search));
- if ($dataTterm->resume->cant_result > "0") {
- foreach ($dataTterm->result->term as $value) {
- $array_terms[]=array("term_id"=>(int) $value->term_id,"string"=>(string) $value->string);
- $tterms_id.=(int) $value->term_id.',';
- };
- }
- switch ($t_relation) {
- case '2'://RT
- $arrayTterm=getForeingStrings($arrayVocab["tvocab_uri_service"], 'fetchRelated', $array_terms);
- break;
- case '3'://BT/NT
- $arrayTterm=getForeingStrings($arrayVocab["tvocab_uri_service"], 'fetchDown', $array_terms);
- break;
- case '4'://UF
- $arrayTterm=getForeingStrings($arrayVocab["tvocab_uri_service"], 'fetchAlt', $array_terms);
- break;
- default:
- break;
- }
- $rows.=HTMLformTargetVocabularySuggested($arrayTterm, $t_relation, $string2search, $arrayVocab, $ARRAYtermino["idTema"]);
- };//fin de if buscar
- $rows.=' </div>';
- return $rows;
- }
- /*
- Advanced search form
- *
- */
- function HTMLformAdvancedSearch($array)
- {
- global $CFG;
- $array=XSSpreventArray($array);
- $rows.='<div class="row">';
- $rows.=' <div class="col-md-6 col-md-offset-3">';
- $rows.=' <h3>'.ucfirst(LABEL_BusquedaAvanzada).'</h3>';
- $rows.='<form class="col-xs-8 form-horizontal" role="form" name="advancedsearch" action="index.php#xstring" method="get">';
- $rows.='<fieldset>';
- $arrayWS=array('t#'.ucfirst(LABEL_Termino),'mt#'.ucfirst(LABEL_meta_term));
- $arrayVocabStats=ARRAYresumen($_SESSION["id_tesa"], "G", "");
- if ($arrayVocabStats["cant_up"]>0) {
- array_push($arrayWS, 'uf#'.ucfirst(LABEL_esNoPreferido));
- }
- if ($arrayVocabStats["cant_notas"]>0) {
- array_push($arrayWS, 'n#'.ucfirst(LABEL_nota));
- }
- if ($CFG["_SHOW_CODE"]=='1') {
- array_push($arrayWS, 'c#'.ucfirst(LABEL_CODE));
- }
- if ($arrayVocabStats["cant_term2tterm"]) {
- array_push($arrayWS, 'tgt#'.ucfirst(LABEL_TargetTerm));
- }
- /*
- solo si hay m�s de un opci�n
- */
- if (count($arrayWS)>1) {
- $rows.='<div class="form-group"><label class="label_ttl control-label" for="ws" accesskey="f">'.ucfirst(LABEL_QueBuscar).'</label>';
- $rows.='<select class="select_ttl form-control" id="ws" name="ws">';
- $rows.=doSelectForm($arrayWS, $_GET["ws"]);
- $rows.='</select>';
- $rows.='</div>';
- }
- $rows.='<div class="form-group"><label class="label_ln control-label" for="xstring" accesskey="s">'.ucfirst(LABEL_BuscaTermino).'</label>';
- $rows.='<input name="xstring" class="input_ln form-control" required type="search" id="xstring" size="25" maxlength="50" value=""/>';
- $rows.=' <div class="checkbox-inline" ><label class="btn btn-default" for="isExactMatch" accesskey="f">';
- $rows.=' <input name="isExactMatch" type="checkbox" id="isExactMatch" value="1" '.do_check('1', $_GET["isExactMatch"], "checked").'/>'.ucfirst(LABEL_esFraseExacta).'</label>';
- $rows.=' </div>';
- $rows.='</div>';
- $rows.='<div class="collapse" id="masOpcionesBusqueda">';
- //Evaluar si hay top terms
- $sqlTopTerm=SQLverTopTerm();
- if (SQLcount($sqlTopTerm)>0) {
- while ($arrayTopTerms=$sqlTopTerm->FetchRow()) {
- $formSelectTopTerms[]=$arrayTopTerms["tema_id"].'#'.$arrayTopTerms["tema"];
- }
- $rows.='<div class="form-group"><label class="label_ttl control-label" for="hasTopTerm" accesskey="t">'.ucfirst(LABEL_TopTerm).'</label>';
- $rows.='<select class="select_ttl form-control" id="hasTopTerm" name="hasTopTerm">';
- $rows.='<option value="">'.ucfirst(LABEL_Todos).'</option>';
- $rows.=doSelectForm($formSelectTopTerms, $_GET["hasTopTerm"]);
- $rows.='</select>';
- $rows.='</div>';
- }
- //Evaluar si hay notas
- if (is_array($arrayVocabStats["cant_notas"])) {
- $LabelNB='NB#'.LABEL_NB;
- $LabelNH='NH#'.LABEL_NH;
- $LabelNA='NA#'.LABEL_NA;
- $LabelNP='NP#'.LABEL_NP;
- $LabelNC='NC#'.LABEL_NC;
- $sqlNoteType=SQLcantNotas();
- while ($arrayNotes=$sqlNoteType->FetchRow()) {
- if ($arrayNotes["cant"]>0) {
- //nota privada no
- if (($_SESSION[$_SESSION["CFGURL"]]["ssuser_nivel"]) || ($arrayNotes["value_id"]!=='11')) {
- $varNoteType=(in_array($arrayNotes["value_id"], array(8,9,10,11,15))) ? arrayReplace(array(8,9,10,11,15), array($LabelNA,$LabelNH,$LabelNB,$LabelNP,$LabelNC), $arrayNotes["value_id"]) : $arrayNotes["value_code"].'#'.$arrayNotes["value"];
- $varNoteType.=' ('.$arrayNotes["cant"].')';
- $arrayNoteType[]=$varNoteType;
- }
- }
- };
- /*
- Si hay m�s de un tipo de nota
- */
- if (count($arrayVocabStats["cant_notas"])>0) {
- $rows.='<div class="form-group"><label class="label_ttl control-label" for="hasNote" accesskey="n">'.ucfirst(LABEL_tipoNota).'</label>';
- $rows.='<select class="select_ttl form-control" id="hasNote" name="hasNote">';
- $rows.='<option value="">'.ucfirst(LABEL_Todos).'</option>';
- $rows.=doSelectForm($arrayNoteType, $_GET["hasNote"]);
- $rows.='</select>';
- $rows.='</div>';
- }
- }
- //Evaluar si hay terminos
- $sqlTermsByDates=SQLtermsByDate();
- if (SQLcount($sqlTermsByDates)>0) {
- global $MONTHS;
- while ($arrayTermsByDates=$sqlTermsByDates->FetchRow()) {
- //normalizacion de fechas
- $arrayTermsByDates["months"]=(strlen($arrayTermsByDates["months"])==1) ? '0'.$arrayTermsByDates["months"] : $arrayTermsByDates["months"];
- $formSelectByDate[]=$arrayTermsByDates["years"].'-'.$arrayTermsByDates["months"].'#'.$MONTHS["$arrayTermsByDates[months]"].'/'.$arrayTermsByDates["years"].' ('.$arrayTermsByDates["cant"].')';
- }
- $rows.='<div class="form-group"><label class="label_ttl control-label" for="fromDate" accesskey="d">'.ucfirst(LABEL_DesdeFecha).'</label>';
- $rows.='<select class="select_ttl form-control" id="fromDate" name="fromDate">';
- $rows.='<option value="">'.ucfirst(LABEL_Todos).'</option>';
- $rows.=doSelectForm($formSelectByDate, $_GET["fromDate"]);
- $rows.='</select>';
- $rows.='</div>';
- };
- //terms by deep
- $sqlTermsByDeep=SQLTermDeep();
- if (SQLcount($sqlTermsByDeep)>1) {
- while ($arrayTermsByDeep=$sqlTermsByDeep->FetchRow()) {
- $formSelectByDeep[]=$arrayTermsByDeep["tdeep"].'#'.$arrayTermsByDeep["tdeep"].' ('.$arrayTermsByDeep["cant"].')';
- }
- $rows.='<div class="form-group"><label class="label_ttl control-label" for="termDeep" accesskey="e">'.ucfirst(LABEL_ProfundidadTermino).'</label>';
- $rows.='<select class="select_ttl form-control" id="termDeep" name="termDeep">';
- $rows.='<option value="">'.ucfirst(LABEL_Todos).'</option>';
- $rows.=doSelectForm($formSelectByDeep, $_GET["termDeep"]);
- $rows.='</select>';
- $rows.='</div>';
- };
- $rows.='</div>';//hide div
- $rows.='<div class="btn-group">';
- $rows.='<input type="submit" id="boton" name="boton" class="btn btn-primary" value="'.LABEL_Enviar.'"/>';
- $rows.=' <button class="btn btn-default" type="button" data-toggle="collapse" data-target="#masOpcionesBusqueda" aria-expanded="false" aria-controls="masOpcionesBusqueda">'.ucfirst(LABEL_Opciones).'</button>';
- $rows.='</div>';
- $rows.='<input type="hidden" name="xsearch" id="xsearch" value="1"/>';
- $rows.=' </fieldset>';
- $rows.='</form>';
- $rows.='</div>';//div row
- $rows.='</div>';//div col
- $rows.='<div class="push"></div>';
- if ($_GET["boton"]==LABEL_Enviar) {
- $rows.=HTMLadvancedSearchResult($array);
- }
- return $rows;
- }
- /*
- Term Report form
- *
- */
- function HTMLformAdvancedTermReport($array)
- {
- global $CFG;
- $LABEL_Termino=ucfirst(LABEL_Termino);
- $LABEL_esNoPreferido=ucfirst(LABEL_esNoPreferido);
- $LABEL_CODE=ucfirst(LABEL_CODE);
- $LABEL_NOTE=ucfirst(LABEL_nota);
- $LABEL_TARGET_TERM=ucfirst(LABEL_TargetTerm);
- $LABEL_haveEQ=LABEL_haveEQ;
- $LABEL_nohaveEQ=LABEL_nohaveEQ;
- $LABEL_start=LABEL_start;
- $LABEL_end=LABEL_end;
- $LABEL_equalThisWord=LABEL_equalThisWord;
- $arrayVocabStats=ARRAYresumen($_SESSION["id_tesa"], "G", "");
- $arrayWS=array("t#$LABEL_Termino");
- if ($arrayVocabStats["cant_up"]>0) {
- array_push($arrayWS, "uf#$LABEL_esNoPreferido");
- }
- //Notes
- if ($arrayVocabStats["cant_notas"]>0) {
- array_push($arrayWS, "n#$LABEL_NOTE");
- $LabelNB='NB#'.LABEL_NB;
- $LabelNH='NH#'.LABEL_NH;
- $LabelNA='NA#'.LABEL_NA;
- $LabelNP='NP#'.LABEL_NP;
- $LabelNC='NC#'.LABEL_NC;
- $sqlNoteType=SQLcantNotas();
- $arrayNoteType=array();
- while ($array=$sqlNoteType->FetchRow()) {
- $varNoteType=(in_array($array["value_id"], array(8,9,10,11,15))) ? arrayReplace(array(8,9,10,11,15), array($LabelNA,$LabelNH,$LabelNB,$LabelNP,$LabelNC), $array["value_id"]) : $array["value_code"].'#'.$array["value"];
- if ($array["cant"]>0) {
- $varNoteType.=' ('.$array["cant"].')';
- array_push($arrayNoteType, $varNoteType);
- }
- };
- }
- //target vocabularies
- if ($arrayVocabStats["cant_term2tterm"]) {
- $sql=SQLtargetVocabulary("1");
- $array_vocabularios=array();
- while ($array=$sql->FetchRow()) {
- //vocabularios que no sean el vocabulario principal
- array_push($array_vocabularios, $array["tvocab_id"].'#'.FixEncoding($array["tvocab_label"]));
- };
- }
- //Evaluar si hay top terms
- $sqlTopTerm=SQLverTopTerm();
- if (SQLcount($sqlTopTerm)>0) {
- while ($arrayTopTerms=$sqlTopTerm->FetchRow()) {
- $formSelectTopTerms[]=$arrayTopTerms["tema_id"].'#'.$arrayTopTerms["tema"];
- }
- }
- //Evaluar si hay terminos
- $sqlTermsByDates=SQLtermsByDate();
- if (SQLcount($sqlTermsByDates)>0) {
- global $MONTHS;
- while ($arrayTermsByDates=$sqlTermsByDates->FetchRow()) {
- //normalizacion de fechas
- $arrayTermsByDates["months"]=(strlen($arrayTermsByDates["months"])==1) ? '0'.$arrayTermsByDates["months"] : $arrayTermsByDates["months"];
- $formSelectByDate[]=$arrayTermsByDates["years"].'-'.$arrayTermsByDates["months"].'#'.$MONTHS["$arrayTermsByDates[months]"].'/'.$arrayTermsByDates["years"].' ('.$arrayTermsByDates["cant"].')';
- }
- };
- //internal reference vocabularies
- $sql=SQLdatosVocabulario();
- if (SQLcount($sql)>'1') {
- //Hay vobularios de referencia
- $array_ivocabularios=array();
- while ($array=$sql->FetchRow()) {
- if ($array["vocabulario_id"]!=='1') {
- //vocabularios que no sean el vocabulario principal
- array_push($array_ivocabularios, $array["vocabulario_id"].'#'.$array["titulo"]);
- }
- };
- };
- $rows='<form class="form-horizontal" role="form" name="advancedreport" action="index.php#csv" method="get">
- <fieldset>
- <!-- Form Name -->
- <legend>'.ucfirst(LABEL_FORM_advancedReport).'</legend>';
- if (SQLcount($sqlTopTerm)>0) {
- $rows.='<!-- Select Basic -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="hasTopTerm">'.ucfirst(LABEL_TopTerm).'</label>
- <div class="col-md-5">
- <select id="hasTopTerm" name="hasTopTerm" class="form-control">
- <option value="">'.ucfirst(LABEL_FORM_nullValue).'</option>
- '.doSelectForm($formSelectTopTerms, $_GET["hasTopTerm"]).'
- </select>
- </div>
- </div>';
- };
- if ($arrayVocabStats["cant_notas"]>0) {
- $rows.='<!-- Select Basic -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="hasNote">'.ucfirst(LABEL_FORM_haveNoteType).'</label>
- <div class="col-md-4">
- <select id="hasNote" name="hasNote" class="form-control">
- <option value="">'.ucfirst(LABEL_FORM_nullValue).'</option>
- '.doSelectForm($arrayNoteType, $_GET["hasNote"]).'
- </select>
- </div>
- </div>';
- };
- $rows.='<!-- Select Basic -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="fromDate">'.ucfirst(LABEL_DesdeFecha).'</label>
- <div class="col-md-3">
- <select id="fromDate" name="fromDate" class="form-control">
- <option value="">'.ucfirst(LABEL_FORM_nullValue).'</option>
- '.doSelectForm($formSelectByDate, $_GET["fromDate"]).' </select>
- </div>
- </div>';
- //target vocabularies
- if ($arrayVocabStats["cant_term2tterm"]) {
- $rows.='<!-- Select Basic -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="csv_tvocab_id">'.ucfirst(LABEL_TargetTerms).'</label>
- <div class="col-md-3">
- <select id="csv_tvocab_id" name="csv_tvocab_id" class="form-control">
- <option value="">'.ucfirst(LABEL_FORM_nullValue).'</option>
- '.doSelectForm($array_vocabularios, $_GET["csv_tvocab_id"]).'
- </select>
- </div>
- <div class="col-md-3">
- <select id="mapped" name="mapped" class="form-control">
- '.doSelectForm(array("y#$LABEL_haveEQ","n#$LABEL_nohaveEQ"), $_GET["mapped"]).'
- </select>
- </div>
- </div>';
- };
- if (SQLcount($sql)>'1') {
- $rows.='<!-- Select Basic -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="csv_itvocab_id">'.ucfirst(LABEL_vocabulario_referencia).'</label>
- <div class="col-md-3">
- <select id="csv_itvocab_id" name="csv_itvocab_id" class="form-control">
- <option value="">'.ucfirst(LABEL_FORM_nullValue).'</option>
- '.doSelectForm($array_ivocabularios, $_GET["csv_itvocab_id"]).'
- </select>
- </div>
- <div class="col-md-3">
- <select id="int_mapped" name="int_mapped" class="form-control">
- '.doSelectForm(array("y#$LABEL_haveEQ","n#$LABEL_nohaveEQ"), $_GET["int_mapped"]).'
- </select>
- </div>
- </div>';
- };
- //only for admin
- if ($_SESSION[$_SESSION["CFGURL"]]["ssuser_nivel"]=='1') {
- $sqlUsers=SQLdatosUsuarios();
- if (SQLcount($sqlUsers)>1) {
- while ($arrayUsers=$sqlUsers->FetchRow()) {
- $formSelectUsers[]=$arrayUsers["id"].'#'.$arrayUsers["apellido"].', '.$arrayUsers["nombres"];
- }
- $rows.='<!-- Select Basic -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="byuser_id">'.ucfirst(MENU_Usuarios).'</label>
- <div class="col-md-4">
- <select id="user_id" name="byuser_id" class="form-control">
- <option value="">'.ucfirst(LABEL_FORM_nullValue).'</option>
- '.doSelectForm($formSelectUsers, $_GET["byuser_id"]).'
- </select>
- </div>
- </div>';
- }
- }
- $rows.='<div class="form-group">
- <label class="col-md-4 control-label" for="w_string">'.ucfirst(LABEL_haveWords).'</label>
- <div class="col-md-3">
- <select id="w_string" name="w_string" class="form-control">
- '.doSelectForm(array("x#$LABEL_equalThisWord","s#$LABEL_start","e#$LABEL_end"), $_GET["w_string"]).'
- </select>
- </div>
- <div class="col-md-3">
- <input id="csvstring" name="csvstring" class="form-control" placeholder="'.LABEL_haveWords.'" type="text">
- </div>
- </div>
- <!-- Checkboxes (inline) -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="csv_encodeAdvance">'.ucfirst(LABEL_encode).' latin1</label>
- <div class="col-md-4">
- <input name="csv_encode" id="csv_encodeAdvance" value="latin1" type="checkbox">
- </div>
- </div>
- <!-- Button -->
- <div class="form-group">
- <div class="text-center">
- <input type="submit" class="btn btn-primary" id="boton" name="boton" value="'.ucfirst(LABEL_Guardar).'"/>
- </div>
- </div>
- <input type="hidden" name="mod" id="mod" value="csv"/><input type="hidden" name="task" id="mod" value="csv1"/>
- </fieldset>
- </form>
- ';
- return $rows;
- }
- /*
- Simple Term report by
- */
- function HTMLformSimpleTermReport($array)
- {
- global $CFG;
- $arraySimpleReports=array('csv2#'.ucfirst(LABEL_terminosLibres),
- 'csv3#'.ucfirst(LABEL_terminosRepetidos),
- 'csv4#'.ucfirst(LABEL_poliBT),
- 'csv7#'.ucfirst(LABEL_termsxNTterms),
- 'csv8#'.ucfirst(LABEL_termsXcantWords),
- 'csv9#'.ucfirst(LABEL_meta_terms),
- 'csv13#'.ucfirst(LABEL_preferedTerms),
- 'csv10#'.ucfirst(LABEL_relatedTerms),
- 'csv11#'.ucfirst(LABEL_nonPreferedTerms),
- 'csv18#'.ucfirst(LABEL_sources4vocab),
- 'csv5#'.ucfirst(LABEL_Candidato),
- 'csv6#'.ucfirst(LABEL_Rechazado));
- //admin reports
- if (checkValidRol($_SESSION[$_SESSION["CFGURL"]]["user_data"], "adminReports")) {
- array_push($arraySimpleReports, 'csv15#'.ucfirst(LABEL_allTerms), 'csv16#'.ucfirst(LABEL_allRelations), 'csv17#'.ucfirst(LABEL_allNotes), 'csv19#'.ucfirst(LABEL_source4term));
- }
- $rows.='<form role="form" name="simprereport" id="simprereport" action="index.php" method="get">';
- $rows.=' <div class="row">
- <div class="col-sm-12">
- <legend>'.ucfirst(LABEL_FORM_simpleReport).'</legend>
- </div>
- <!-- panel -->
- <div class="col-lg-7">
- <div class="panel panel-default">
- <div class="panel-body form-horizontal">';
- $rows.='<div class="form-group">
- <label for="simpleReport" accesskey="s" class="col-sm-3 control-label">'.ucfirst(LABEL_seleccionar).'</label>';
- $rows.=' <div class="col-sm-9"><select class="form-control" id="task" name="task">';
- $rows.=' <option value="">'.ucfirst(LABEL_seleccionar).'</option>';
- $rows.=doSelectForm($arraySimpleReports, secure_data($_GET["task"], "int"));
- $rows.=' </select></div>';
- $rows.='</div>';
- if ($CFG["_CHAR_ENCODE"]=='utf-8') {
- $rows.='<div class="form-group">
- <input type="checkbox" name="csv_encode" id="csv_encodeSimple" value="latin1"/>
- <div class="col-sm-4">
- <label for="csv_encodeSimple">'.ucfirst(LABEL_encode).' latin1</label>
- </div>
- </div>';
- }
- $rows.='<div class="form-group">
- <div class="col-sm-12 text-center">
- <input type="submit" class="btn btn-primary" id="boton" name="boton" value="'.ucfirst(LABEL_Guardar).'"/>
- </div>
- </div>';
- $rows.=' </div>
- </div>
- </div>
- </div> <!-- / panel -->';
- $rows.='<input type="hidden" name="mod" id="mod" value="csv"/>';
- $rows.='</form>';
- return $rows;
- }
- /*
- Simple Term report for mapped terms
- */
- function HTMLformMappedTermReport($array)
- {
- global $CFG;
- $rows.='<form class="" role="form" name="mappedreport" id="mappedreport" action="index.php" method="get">';
- $rows.=' <div class="row">
- <div class="col-sm-12">
- <legend>'.ucfirst(LABEL_FORM_mappedTermReport).'</legend>
- </div>
- <!-- panel -->
- <div class="col-lg-7">
- <div class="panel panel-default">
- <div class="panel-body form-horizontal">';
- $SQLtvocabs=SQLtargetVocabulary();
- while ($ARRAYtvocabs=$SQLtvocabs->FetchRow()) {
- $i_tvocab=++$i_tvocab;
- $rows.='<div class="form-group">
- <input name="tvocabs[]" type="checkbox" id="tvocab_id'.$ARRAYtvocabs["tvocab_id"].'" value="'.$ARRAYtvocabs["tvocab_id"].'" />
- <div class="col-sm-4">
- <label for="tvocab_id'.$ARRA…
Large files files are truncated, but you can click here to view the full file