From 3249cc4559829006b614f6376b0d0b66bb66a0ca Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 4 Aug 2022 22:05:28 +0200 Subject: [PATCH] toast al caricamento immagini in ckeditor fix minori --- actions.php | 39 ++++++++++++++++++++++------- modules/articoli/edit.php | 6 +++-- modules/interventi/ajax_tecnici.php | 2 +- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/actions.php b/actions.php index f904a10bf..d8777dcf6 100755 --- a/actions.php +++ b/actions.php @@ -57,18 +57,21 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') { //UPLOAD PER CKEDITOR if (filter('op') == 'aggiungi-allegato' && !empty($_FILES) && !empty($_FILES['upload']['name'])) { - $CKEditor = $_GET['CKEditor']; - $funcNum = $_GET['CKEditorFuncNum']; + $CKEditor = get('CKEditor'); + $funcNum = get('CKEditorFuncNum'); $allowed_extension = array( "png","jpg","jpeg" - ); + ); + + //Maximum file limit (unit: byte) + $max_size='2097152'; //2MB // Get image file extension $file_extension = pathinfo($_FILES["upload"]["name"], PATHINFO_EXTENSION); - if(in_array(strtolower($file_extension),$allowed_extension)){ + if(in_array(strtolower($file_extension),$allowed_extension) && $_FILES["upload"]['size']<$max_size){ $upload = Uploads::upload($_FILES['upload'], [ 'name' => filter('nome_allegato'), @@ -77,24 +80,42 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') { 'id_record' => $id_record, ]); + + echo ' + '; + + + echo ' + '; + + // Creazione file fisico if (!empty($upload)) { - flash()->info(tr('File caricato correttamente!')); + //flash()->info(tr('File caricato correttamente!')); $id_allegato = $dbo->lastInsertedID(); $upload = Upload::find($id_allegato); - echo ''; + echo ' + '; + } else { - flash()->error(tr('Errore durante il caricamento del file!')); + + //flash()->error(tr('Errore durante il caricamento del file!')); + echo ''; + } }else{ //flash()->error(tr('Estensione non permessa!')); - //toastr["error"]("'.tr('Estensione non permessa').'"); - echo ''; + echo ''; } diff --git a/modules/articoli/edit.php b/modules/articoli/edit.php index 87df104fe..719a8ef7c 100755 --- a/modules/articoli/edit.php +++ b/modules/articoli/edit.php @@ -106,7 +106,7 @@ use Modules\Iva\Aliquota;
- {[ "type": "number", "label": "", "name": "qta", "required": 1, "value": "$qta$", "readonly": 1, "decimals": "qta", "min-value": "undefined" ]} + {[ "type": "number", "label": "", "name": "qta", "required": 1, "value": "$qta$", "readonly": 1, "decimals": "qta", "min-value": "undefined", "icon-after": "" ]}
@@ -125,7 +125,9 @@ use Modules\Iva\Aliquota;
-

. .

+

. Modules::link('Movimenti', null, tr('Movimenti')) + ]); ?>.

+