Skip to content

Commit

Permalink
Merge branch 'release/v3.0.20' into support/v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
enfoqueNativo committed Mar 7, 2018
2 parents d90ac5a + b1b2124 commit 753114e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

[CURRENT](https://github.com/SIU-Toba/framework/compare/master...develop)

[3.0.19](https://github.com/SIU-Toba/framework/releases/tag/v3.0.18) (2018-02-26):
[3.0.20](https://github.com/SIU-Toba/framework/releases/tag/v3.0.20) (2018-03-07):
- Se corrige un bug en ef_upload que afectaba su uso en formularios_ml
- Se desactiva el log de WS durante el testing via phpunit

[3.0.19](https://github.com/SIU-Toba/framework/releases/tag/v3.0.19) (2018-02-26):
- Se corrige notice en toba_solicitud para pedidos rest
- Se corrige problema de transacciones anidadas al usar la utilidad de recordatorio de password

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.19
3.0.20
22 changes: 11 additions & 11 deletions php/nucleo/componentes/interface/efs/toba_ef_upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
*/
class toba_ef_upload extends toba_ef
{
protected $archivo_cargado = false; //Se cargo un archivo en la etapa anterior?
protected $archivo_subido = false; //Se subio un archivo en esta etapa
protected $archivo_cargado = array(); //Se cargo un archivo en la etapa anterior?
protected $archivo_subido = array(); //Se subio un archivo en esta etapa
protected $extensiones_validas = null;
protected $clase_css = 'ef-upload';

Expand Down Expand Up @@ -85,11 +85,11 @@ function get_estado_input()

function cargar_estado_post()
{
$this->archivo_cargado = toba::memoria()->get_dato_sincronizado($this->id_form."_cargado");
$this->archivo_subido = false;
$this->archivo_cargado[$this->id_form] = toba::memoria()->get_dato_sincronizado($this->id_form."_cargado");
$this->archivo_subido[$this->id_form] = false;
if (isset($_FILES[$this->id_form])) {
if (isset($_POST[$this->id_form."_check"])) {
$this->archivo_subido = true;
$this->archivo_subido[$this->id_form] = true;
$this->estado = $_FILES[$this->id_form];
}
}
Expand All @@ -102,8 +102,8 @@ function es_archivo_vacio()

function tiene_estado()
{
return $this->archivo_cargado ||
($this->archivo_subido && !$this->es_archivo_vacio());
return (isset($this->archivo_cargado[$this->id_form]) && $this->archivo_cargado[$this->id_form]) ||
(isset($this->archivo_subido[$this->id_form]) && $this->archivo_subido[$this->id_form] && !$this->es_archivo_vacio());
}

/**
Expand All @@ -117,7 +117,7 @@ function validar_estado()
if ($padre !== true) {
return $padre;
}
if ($this->archivo_subido) {
if (isset($this->archivo_subido[$this->id_form]) && $this->archivo_subido[$this->id_form]) {
$id = $this->estado['error'];
switch($id){
case UPLOAD_ERR_OK:
Expand All @@ -128,20 +128,20 @@ function validar_estado()
return "Se supero el limite expresado en el FORM";
case UPLOAD_ERR_NO_FILE:
//Este caso lo maneja el obligatorio
$this->archivo_subido = false;
$this->archivo_subido[$this->id_form] = false;
break;
case UPLOAD_ERR_CANT_WRITE:
return "No tiene permisos sobre la carpeta de upload";
default:
return "Ha ocurrido un error cargando el archivo ($id)";
}

if (!$this->solo_lectura_modificacion && isset($this->extensiones_validas) && $this->archivo_subido && !$this->es_archivo_vacio()) {
if (!$this->solo_lectura_modificacion && isset($this->extensiones_validas) && $this->archivo_subido[$this->id_form] && !$this->es_archivo_vacio()) {
$rep = $_FILES[$this->id_form]['name'];
$ext = substr($rep, strrpos($rep, '.') + 1);
if (! in_array(strtolower($ext), $this->extensiones_validas)) {
$extensiones = implode(', ', $this->extensiones_validas);
$this->archivo_subido = false;
$this->archivo_subido[$this->id_form] = false;
$this->estado = null;
return "No esta permitido subir este tipo de archivo. Solo se permiten extensiones $extensiones";
}
Expand Down
5 changes: 3 additions & 2 deletions php/nucleo/lib/rest/rest_test_case.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ protected function setupRest()
if(!isset($this->app)){
$tr = new \toba_rest();
$app = $tr->instanciar_libreria_rest();
$tr->configurar_libreria_rest($app);
$tr->configurar_libreria_rest($app);
$this->app = $app;
$this->app->logger->desactivar();
}
return $this->app;
}
Expand Down Expand Up @@ -77,4 +78,4 @@ protected function mock_vista_no_escribir(rest $app)
->will($this->returnValue(''));
$app->vista = $vista;
}
}
}

0 comments on commit 753114e

Please sign in to comment.