Cambio de naming en labels

This commit is contained in:
Ignacio Martinez Navajas
2025-07-22 22:53:07 +02:00
parent 9ed397e9ad
commit 065903be2f
4 changed files with 3 additions and 55 deletions

View File

@ -1779,58 +1779,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
} }
public function upload_files_old()
{
$model = model('App\Models\Presupuestos\PresupuestoFicheroModel');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$presupuesto_id = $_POST['presupuesto_id'];
$old_files = json_decode($_POST['oldFiles']);
$ftp = new SafekatFtpClient();
// Comprobar si se han subido archivos
if (!empty($_FILES['file']) || !empty($old_files)) {
// Borrar los archivos existentes del presupuesto
$ftp->removeFiles($presupuesto_id);
$model->deleteFiles($presupuesto_id, $old_files);
if (!empty($_FILES['file'])) {
$files = $_FILES['file'];
// Iterar sobre los archivos
for ($i = 0; $i < count($files['name']); $i++) {
// Aquí puedes acceder a las propiedades del archivo
$name = $files['name'][$i];
$extension = explode('.', $files['name'][$i])[1];
$tmp_name = $files['tmp_name'][$i];
$new_name = $model->saveFileInBBDD($presupuesto_id, $name, $extension, auth()->id());
// Se sube el fichero
// Pero primero se comprueba que la carpeta presupuestos exista
if (!is_dir(WRITEPATH . 'uploads/presupuestos')) {
mkdir(WRITEPATH . 'uploads/presupuestos', 0777, true);
}
if (!is_null($new_name)) {
$path = WRITEPATH . 'uploads/presupuestos/' . $new_name;
move_uploaded_file($tmp_name, $path);
}
}
$ftp->uploadFilePresupuesto($presupuesto_id);
}
} else {
// Borrar los archivos existentes del presupuesto
$ftp->removeFiles($presupuesto_id);
$model->deleteFiles($presupuesto_id);
}
}
return json_encode(['message' => 'Archivos subidos correctamente']);
}
public function upload_files() public function upload_files()
{ {

View File

@ -34,7 +34,7 @@ return [
"global_prev" => "Anterior", "global_prev" => "Anterior",
"global_next" => "Siguiente", "global_next" => "Siguiente",
"global_save_file" => "Guardar ficheros", "global_save_file" => "Guardar ficheros",
"global_upload_files" => "Subir ficheros", "global_select_files" => "Seleccionar ficheros",
"global_download_files" => "Descargar ficheros", "global_download_files" => "Descargar ficheros",
"global_all" => "Todos", "global_all" => "Todos",
// LOGIN - Index // LOGIN - Index

View File

@ -24,7 +24,7 @@
</div> </div>
<div class="col-md-12 gap-2"> <div class="col-md-12 gap-2">
<button id="<?= $id ?>_btnUploadFiles" class="btn mt-3 btn-sm btn-primary waves-effect waves-light ml-2 "> <button id="<?= $id ?>_btnUploadFiles" class="btn mt-3 btn-sm btn-primary waves-effect waves-light ml-2 ">
<span class="align-middle d-sm-inline-block d-none me-sm-1"><?= lang('App.global_upload_files') ?></span> <span class="align-middle d-sm-inline-block d-none me-sm-1"><?= lang('App.global_select_files') ?></span>
<i class="ti ti-upload ti-xs"></i> <i class="ti ti-upload ti-xs"></i>
</button> </button>
<button id="<?= $id ?>_btnSubmitFiles" class="btn mt-3 btn-success btn-sm waves-effect waves-light ml-2"> <button id="<?= $id ?>_btnSubmitFiles" class="btn mt-3 btn-success btn-sm waves-effect waves-light ml-2">

View File

@ -206,7 +206,7 @@
</div> </div>
</div> </div>
<button id="btnUploadFile" class="btn mt-3 btn-primary btn-submit waves-effect waves-light ml-2 "> <button id="btnUploadFile" class="btn mt-3 btn-primary btn-submit waves-effect waves-light ml-2 ">
<span class="align-middle d-sm-inline-block d-none me-sm-1"><?= lang('App.global_upload_files') ?></span> <span class="align-middle d-sm-inline-block d-none me-sm-1"><?= lang('App.global_select_files') ?></span>
<i class="ti ti-upload ti-xs"></i> <i class="ti ti-upload ti-xs"></i>
</button> </button>
<button id="submit-all-files" class="btn mt-3 btn-success btn-submit waves-effect waves-light ml-2"> <button id="submit-all-files" class="btn mt-3 btn-success btn-submit waves-effect waves-light ml-2">