From aa337d41641673834cbfa972f9e5dabad013ba73 Mon Sep 17 00:00:00 2001 From: Dasc3er Date: Mon, 20 Sep 2021 12:06:30 +0200 Subject: [PATCH] Correzioni minori JS e stile del codice --- ajax.php | 2 +- assets/src/js/base/datatables-buttons.js | 2 +- assets/src/js/functions/allegati.js | 2 +- assets/src/js/functions/datatables.js | 2 +- assets/src/js/functions/form.js | 2 +- assets/src/js/functions/hooks.js | 8 ++--- include/init/configuration.php | 2 +- modules/aggiornamenti/edit.php | 2 +- modules/anagrafiche/edit.php | 2 +- modules/banche/edit.php | 4 +-- modules/categorie_articoli/add.php | 5 ++- modules/causali_movimenti/actions.php | 4 +-- modules/contratti/row-list.php | 2 +- modules/ddt/actions.php | 2 +- modules/ddt/row-list.php | 2 +- modules/fatture/add.php | 10 +++--- modules/fatture/edit.php | 2 +- modules/fatture/row-list.php | 2 +- modules/fatture/src/Gestori/Scadenze.php | 7 ++-- modules/import/add.php | 2 +- modules/import/edit.php | 2 +- modules/interventi/ajax_tecnici.php | 4 +-- modules/interventi/row-list.php | 2 +- modules/iva/actions.php | 2 +- modules/movimenti/add.php | 25 +++++++-------- modules/ordini/actions.php | 2 +- modules/ordini/row-list.php | 2 +- modules/partitario/edit.php | 4 +-- modules/preventivi/actions.php | 2 +- modules/preventivi/row-list.php | 2 +- modules/ritenute/actions.php | 2 +- modules/ritenute_contributi/actions.php | 2 +- modules/rivalse/actions.php | 2 +- modules/scadenzario/edit.php | 32 +++++++++---------- modules/scadenzario/src/Gruppo.php | 7 ++-- modules/statistiche/js/stat.js | 2 +- modules/stato_email/bulk.php | 2 +- .../widgets/spazio_utilizzato.php | 2 +- modules/viste/edit.php | 2 +- plugins/exportFE/edit.php | 6 ++-- plugins/exportFE/notifiche.php | 4 +-- plugins/importFE/buttons.php | 4 +-- plugins/importFE/edit.php | 6 ++-- plugins/importFE/generate.php | 4 +-- plugins/importFE/list.php | 6 ++-- plugins/receiptFE/edit.php | 4 +-- plugins/receiptFE/list.php | 6 ++-- src/HTMLBuilder/Wrapper/HTMLWrapper.php | 2 +- src/Util/Query.php | 7 ++-- 49 files changed, 107 insertions(+), 108 deletions(-) diff --git a/ajax.php b/ajax.php index dddbd7290..52e141e48 100755 --- a/ajax.php +++ b/ajax.php @@ -79,7 +79,7 @@ switch (filter('op')) { case 'active_users': $posizione = get('id_module'); if (isset($id_record)) { - $has_access = \Util\Query::checkAccess($id_record); + $has_access = \Util\Query::checkAccess($id_record); $posizione .= ', '.get('id_record'); } diff --git a/assets/src/js/base/datatables-buttons.js b/assets/src/js/base/datatables-buttons.js index 9838dd939..dd5bf0946 100644 --- a/assets/src/js/base/datatables-buttons.js +++ b/assets/src/js/base/datatables-buttons.js @@ -64,7 +64,7 @@ $(document).ready(function () { url: table.ajax.url(), data: params, type: 'GET', - dataType: "json", + dataType: "JSON", success: function (response) { var row_ids = response.data.map(function (a) { return a.id; diff --git a/assets/src/js/functions/allegati.js b/assets/src/js/functions/allegati.js index a565c67a4..d062c278b 100644 --- a/assets/src/js/functions/allegati.js +++ b/assets/src/js/functions/allegati.js @@ -141,7 +141,7 @@ function aggiungiAllegato(gestione) { form.ajaxSubmit({ url: globals.rootdir + "/actions.php", data: data, - type: "post", + type: "POST", uploadProgress: function (event, position, total, percentComplete) { $(id + " #upload").prop("disabled", true).html(percentComplete + "%").removeClass("btn-success").addClass("btn-info"); }, diff --git a/assets/src/js/functions/datatables.js b/assets/src/js/functions/datatables.js index c5a153506..56f94c448 100755 --- a/assets/src/js/functions/datatables.js +++ b/assets/src/js/functions/datatables.js @@ -491,7 +491,7 @@ function getTable(selector) { return $.ajax({ url: globals.rootdir + "/ajax.php", type: "POST", - dataType: "json", + dataType: "JSON", data: { id_module: this.id_module, id_plugin: this.id_plugin, diff --git a/assets/src/js/functions/form.js b/assets/src/js/functions/form.js index a415454f2..ea882ccb0 100644 --- a/assets/src/js/functions/form.js +++ b/assets/src/js/functions/form.js @@ -50,7 +50,7 @@ function submitAjax(form, data, callback, errorCallback) { $(form).ajaxSubmit({ url: globals.rootdir + "/actions.php", data: data, - type: "post", + type: "POST", success: function (data) { let response = data.trim(); diff --git a/assets/src/js/functions/hooks.js b/assets/src/js/functions/hooks.js index df3fa0902..239132c73 100755 --- a/assets/src/js/functions/hooks.js +++ b/assets/src/js/functions/hooks.js @@ -22,7 +22,7 @@ function startHooks() { $.ajax({ url: globals.rootdir + "/ajax.php", - type: "get", + type: "GET", data: { op: "hooks", }, @@ -58,7 +58,7 @@ function startHooks() { function startHook(hook, init) { $.ajax({ url: globals.rootdir + "/ajax.php", - type: "get", + type: "GET", data: { op: "hook-lock", id: hook.id, @@ -94,7 +94,7 @@ function startHook(hook, init) { function executeHook(hook, token) { $.ajax({ url: globals.rootdir + "/ajax.php", - type: "get", + type: "GET", data: { op: "hook-execute", id: hook.id, @@ -127,7 +127,7 @@ function executeHook(hook, token) { function updateHook(hook) { $.ajax({ url: globals.rootdir + "/ajax.php", - type: "get", + type: "GET", data: { op: "hook-response", id: hook.id, diff --git a/include/init/configuration.php b/include/init/configuration.php index dc5084c19..598e06923 100755 --- a/include/init/configuration.php +++ b/include/init/configuration.php @@ -299,7 +299,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) { data: { test: 1, }, - type: "post", + type: "POST", success: function(data){ data = parseFloat(data.trim()); diff --git a/modules/aggiornamenti/edit.php b/modules/aggiornamenti/edit.php index 05ad7b7e6..6c9a4d6bb 100755 --- a/modules/aggiornamenti/edit.php +++ b/modules/aggiornamenti/edit.php @@ -165,7 +165,7 @@ function search(button) { $.ajax({ url: globals.rootdir + "/actions.php", - type: "post", + type: "POST", data: { id_module: globals.id_module, op: "check", diff --git a/modules/anagrafiche/edit.php b/modules/anagrafiche/edit.php index 3f965b6d5..322b1dc87 100755 --- a/modules/anagrafiche/edit.php +++ b/modules/anagrafiche/edit.php @@ -378,7 +378,7 @@ echo ' $.ajax({ url: globals.rootdir + "/actions.php", type: "POST", - dataType: "json", + dataType: "JSON", data: { id_module: globals.id_module, id_record: globals.id_record, diff --git a/modules/banche/edit.php b/modules/banche/edit.php index 4e947c6fb..387871eca 100644 --- a/modules/banche/edit.php +++ b/modules/banche/edit.php @@ -187,7 +187,7 @@ if (!empty($numero_documenti)) { iban: iban.get(), }, type: 'GET', - dataType: "json", + dataType: "JSON", success: function (response) { compilaCampi(response); }, @@ -221,7 +221,7 @@ if (!empty($numero_documenti)) { id_nazione: id_nazione.get(), }, type: 'GET', - dataType: "json", + dataType: "JSON", success: function (response) { compilaCampi(response); }, diff --git a/modules/categorie_articoli/add.php b/modules/categorie_articoli/add.php index b8a887bd3..2688ea7fb 100755 --- a/modules/categorie_articoli/add.php +++ b/modules/categorie_articoli/add.php @@ -31,7 +31,7 @@ if (isset($id_original)) { echo base_path().'/controller.php?id_module='.$id_module; if (isset($id_record)) { - $has_access = \Util\Query::checkAccess($id_record); + $has_access = \Util\Query::checkAccess($id_record); echo '&id_record='.$id_record; } } @@ -61,8 +61,7 @@ if (isset($id_original)) {
+ $has_access = \Util\Query::checkAccess($id_record); ?> update('mg_causali_movimenti', [ 'nome' => post('nome'), 'tipo_movimento' => post('tipo_movimento'), @@ -48,7 +48,7 @@ switch (filter('op')) { case 'delete': if (isset($id_record)) { - $has_access = \Util\Query::checkAccess($id_record); + $has_access = \Util\Query::checkAccess($id_record); $dbo->query('DELETE FROM `mg_causali_movimenti` WHERE `id`='.prepare($id_record)); flash()->info(tr('Tipologia di _TYPE_ eliminata con successo!', [ diff --git a/modules/contratti/row-list.php b/modules/contratti/row-list.php index 1b1fc178a..b53e682a0 100755 --- a/modules/contratti/row-list.php +++ b/modules/contratti/row-list.php @@ -280,7 +280,7 @@ function rimuoviRiga(button) { $.ajax({ url: globals.rootdir + "/actions.php", type: "POST", - dataType: "json", + dataType: "JSON", data: { id_module: globals.id_module, id_record: globals.id_record, diff --git a/modules/ddt/actions.php b/modules/ddt/actions.php index 4f9e360f4..a2c84b836 100755 --- a/modules/ddt/actions.php +++ b/modules/ddt/actions.php @@ -62,7 +62,7 @@ switch (filter('op')) { case 'update': if (isset($id_record)) { - $has_access = \Util\Query::checkAccess($id_record); + $has_access = \Util\Query::checkAccess($id_record); $idstatoddt = post('idstatoddt'); $idpagamento = post('idpagamento'); $numero_esterno = post('numero_esterno'); diff --git a/modules/ddt/row-list.php b/modules/ddt/row-list.php index d0b100412..36dedcb3a 100755 --- a/modules/ddt/row-list.php +++ b/modules/ddt/row-list.php @@ -338,7 +338,7 @@ function rimuoviRiga(button) { $.ajax({ url: globals.rootdir + "/actions.php", type: "POST", - dataType: "json", + dataType: "JSON", data: { id_module: globals.id_module, id_record: globals.id_record, diff --git a/modules/fatture/add.php b/modules/fatture/add.php index 4a6973f18..d430ff19e 100755 --- a/modules/fatture/add.php +++ b/modules/fatture/add.php @@ -74,12 +74,12 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [ {[ "type": "select", "label": "", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module='' ORDER BY name", "value": "" ]}
- +