diff --git a/modules/aggiornamenti/edit.php b/modules/aggiornamenti/edit.php
index 5a8edd8a2..8acb70a5b 100755
--- a/modules/aggiornamenti/edit.php
+++ b/modules/aggiornamenti/edit.php
@@ -156,7 +156,7 @@ function database(button) {
}
function controlli(button) {
- openModal("'.tr('Controlli del gestionale').'", "'.$module->fileurl('controlli.php').'?id_module='.$id_module. '");
+ openModal("'.tr('Controlli del gestionale').'", "'.$module->fileurl('controlli.php').'?id_module='.$id_module.'");
}
function search(button) {
@@ -171,7 +171,7 @@ function search(button) {
},
success: function(data){
if (data === "none" || !data) {
- $("#update-search").html(" '.tr('Nessun aggiornamento disponibile'). '.");
+ $("#update-search").html(" '.tr('Nessun aggiornamento disponibile').'.");
} else {
let beta_warning = data.includes("beta") ? "
'.tr('Attenzione: la versione individuata è in fase sperimentale e potrebbe pertanto presentare diversi malfunzionamenti. Se ne sconsiglia l\'aggiornamento in installazioni di produzione').'." : "";
$("#update-search").html("'.tr("E' stato individuato un nuovo aggiornamento").': " + data + "." + beta_warning + "
'.tr('Scaricalo ora: _LINK_', [
diff --git a/modules/articoli/src/CausaleMovimento.php b/modules/articoli/src/CausaleMovimento.php
index 0c0fa79de..161414510 100644
--- a/modules/articoli/src/CausaleMovimento.php
+++ b/modules/articoli/src/CausaleMovimento.php
@@ -34,7 +34,6 @@ class CausaleMovimento extends Model
'title',
];
-
public function getModuleAttribute()
{
return 'Causali movimenti';
diff --git a/modules/attributi_combinazioni/actions.php b/modules/attributi_combinazioni/actions.php
index cef98440f..aa6e3d902 100644
--- a/modules/attributi_combinazioni/actions.php
+++ b/modules/attributi_combinazioni/actions.php
@@ -54,7 +54,7 @@ switch (filter('op')) {
$attributo->setTranslation('title', $title);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$attributo->name = $descrizione;
- }
+ }
$attributo->save();
flash()->info(tr('Attributo aggiornato correttamente!'));
diff --git a/modules/beni/actions.php b/modules/beni/actions.php
index 5423ae8bf..94dfd1ad4 100755
--- a/modules/beni/actions.php
+++ b/modules/beni/actions.php
@@ -30,7 +30,7 @@ switch (post('op')) {
$aspetto->setTranslation('title', $descrizione);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$aspetto->name = $descrizione;
- }
+ }
$aspetto->save();
flash()->info(tr('Salvataggio completato.'));
} else {
@@ -52,7 +52,7 @@ switch (post('op')) {
$aspetto->name = $descrizione;
}
$aspetto->save();
-
+
$id_record = $dbo->lastInsertedID();
$aspetto->setTranslation('title', $descrizione);
$aspetto->save();
diff --git a/modules/causali/actions.php b/modules/causali/actions.php
index 0afdd3d19..34d313a44 100755
--- a/modules/causali/actions.php
+++ b/modules/causali/actions.php
@@ -30,7 +30,7 @@ switch (filter('op')) {
$causale->setTranslation('title', $descrizione);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$causale->name = $descrizione;
- }
+ }
$causale->predefined = post('predefined');
$causale->is_importabile = filter('is_importabile');
$causale->reversed = filter('reversed');
@@ -56,7 +56,7 @@ switch (filter('op')) {
$causale->name = $descrizione;
}
$causale->save();
-
+
$id_record = $dbo->lastInsertedID();
$causale->setTranslation('title', $descrizione);
$causale->save();
diff --git a/modules/combinazioni_articoli/actions.php b/modules/combinazioni_articoli/actions.php
index 44ea8a745..b9877b9ad 100644
--- a/modules/combinazioni_articoli/actions.php
+++ b/modules/combinazioni_articoli/actions.php
@@ -24,8 +24,8 @@ switch (filter('op')) {
}
$combinazione->setTranslation('title', $nome);
$combinazione->codice = post('codice');
- $combinazione->id_categoria = post('id_categoria')?: null;
- $combinazione->id_sottocategoria = post('id_sottocategoria')?: null;
+ $combinazione->id_categoria = post('id_categoria') ?: null;
+ $combinazione->id_sottocategoria = post('id_sottocategoria') ?: null;
$combinazione->save();
$id_record = $combinazione->id;
diff --git a/modules/emails/actions.php b/modules/emails/actions.php
index 697d29173..7d4ab2ed6 100755
--- a/modules/emails/actions.php
+++ b/modules/emails/actions.php
@@ -59,7 +59,7 @@ switch (post('op')) {
$template->save();
$prints[] = post('prints');
-
+
foreach ($prints as $print) {
if (!empty($print)) {
$dbo->sync('em_print_template', ['id_template' => $id_record], ['id_print' => $print]);
@@ -72,7 +72,7 @@ switch (post('op')) {
$dbo->sync('em_mansioni_template', ['id_template' => $id_record], ['idmansione' => $mansione]);
}
}
-
+
flash()->info(tr('Informazioni salvate correttamente!'));
break;
diff --git a/modules/fasce_orarie/actions.php b/modules/fasce_orarie/actions.php
index dfa8c4d5a..60d4e30d1 100644
--- a/modules/fasce_orarie/actions.php
+++ b/modules/fasce_orarie/actions.php
@@ -66,7 +66,7 @@ switch (post('op')) {
$fascia_oraria->ora_inizio = $ora_inizio;
$fascia_oraria->ora_fine = $ora_fine;
$fascia_oraria->save();
-
+
$id_record = $dbo->lastInsertedID();
$fascia_oraria->setTranslation('title', $descrizione);
$fascia_oraria->save();
@@ -85,7 +85,7 @@ switch (post('op')) {
]);
}
}
-
+
if (isAjaxRequest()) {
echo json_encode(['id' => $id_record, 'text' => $nome]);
}
diff --git a/modules/fatture/init.php b/modules/fatture/init.php
index 1b717814d..705c8ccff 100755
--- a/modules/fatture/init.php
+++ b/modules/fatture/init.php
@@ -81,7 +81,7 @@ if (!empty($id_record)) {
$fattura_acquisto_originale = null;
if (!empty($fattura)) {
- $reverse_charge = $fattura->getRighe()->first(fn($item, $key) => $item->aliquota != null && $item->aliquota->codice_natura_fe !== null && substr($item->aliquota->codice_natura_fe, 0, 2) == 'N6')->id;
+ $reverse_charge = $fattura->getRighe()->first(fn ($item, $key) => $item->aliquota != null && $item->aliquota->codice_natura_fe !== null && substr($item->aliquota->codice_natura_fe, 0, 2) == 'N6')->id;
$autofattura_vendita = Fattura::find($fattura->id_autofattura);
$abilita_autofattura = (($fattura->anagrafica->nazione->iso2 != 'IT' && !empty($fattura->anagrafica->nazione->iso2)) || $reverse_charge) && $dir == 'uscita' && $fattura->id_autofattura == null;
diff --git a/modules/impianti/edit.php b/modules/impianti/edit.php
index 2267eed01..e55ad0aaf 100644
--- a/modules/impianti/edit.php
+++ b/modules/impianti/edit.php
@@ -21,7 +21,7 @@ include_once __DIR__.'/../../core.php';
use Models\Module;
$id_modulo_categorie_impianti = (new Module())->getByField('title', 'Categorie Impianti', Models\Locale::getPredefined()->id);
-$id_modulo_marca_impianti = (new Module())->getByField('title', 'Marche Impianti', Models\Locale::getPredefined()->id);
+$id_modulo_marca_impianti = (new Module())->getByField('title', 'Marche Impianti', Models\Locale::getPredefined()->id);
$img = null;
if (!empty($record['immagine'])) {
@@ -64,15 +64,15 @@ if (!empty($record['immagine'])) {
-
+
{[ "type": "select", "label": "", "name": "idanagrafica", "required": 1, "value": "$idanagrafica$", "extra": "", "ajax-source": "clienti" ]}
{[ "type": "select", "label": "'.tr('Sede').'", "name": "idsede", "value": "$idsede$", "required": "1", "ajax-source": "sedi", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica']]).', "placeholder": "'.tr('Sede legale').'" ]}
';
- ?>
+?>
{[ "type": "select", "label": "", "name": "idtecnico", "ajax-source": "tecnici", "value": "$idtecnico$" ]}
diff --git a/modules/iva/actions.php b/modules/iva/actions.php
index 88da4473d..abb04e59a 100755
--- a/modules/iva/actions.php
+++ b/modules/iva/actions.php
@@ -43,7 +43,7 @@ switch (filter('op')) {
$iva->setTranslation('title', $descrizione);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$iva->name = $descrizione;
- }
+ }
$iva->save();
// Messaggio di avvertenza
@@ -77,7 +77,7 @@ switch (filter('op')) {
$iva->setTranslation('title', $descrizione);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$iva->name = $descrizione;
- }
+ }
$iva->save();
flash()->info(tr('Aggiunta nuova tipologia di _TYPE_', [
diff --git a/modules/newsletter/init.php b/modules/newsletter/init.php
index e3655da99..9820fd6e1 100755
--- a/modules/newsletter/init.php
+++ b/modules/newsletter/init.php
@@ -22,7 +22,7 @@ use Modules\Newsletter\Newsletter;
include_once __DIR__.'/../../core.php';
-if (!empty(($id_record))) {
+if (!empty($id_record)) {
$newsletter = Newsletter::find($id_record);
$record = $newsletter->toArray();
diff --git a/modules/pagamenti/actions.php b/modules/pagamenti/actions.php
index baae3ad01..7e3538e5b 100755
--- a/modules/pagamenti/actions.php
+++ b/modules/pagamenti/actions.php
@@ -52,7 +52,7 @@ switch (filter('op')) {
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$pagamento->name = $descrizione;
- }
+ }
$pagamento->num_giorni = post('distanza')[$key];
$pagamento->giorno = $giorno;
$pagamento->prc = post('percentuale')[$key];
@@ -82,7 +82,7 @@ switch (filter('op')) {
$pagamento = Pagamento::build($codice_modalita_pagamento_fe);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$pagamento->name = $descrizione;
- }
+ }
$id_record = $dbo->lastInsertedID();
$pagamento->setTranslation('title', $descrizione);
$pagamento->save();
diff --git a/modules/porti/actions.php b/modules/porti/actions.php
index 2f3edbcb7..502a79c35 100755
--- a/modules/porti/actions.php
+++ b/modules/porti/actions.php
@@ -34,7 +34,7 @@ switch (filter('op')) {
}
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$porto->name = $descrizione;
- }
+ }
$porto->predefined = $predefined;
$porto->save();
flash()->info(tr('Salvataggio completato.'));
@@ -57,7 +57,7 @@ switch (filter('op')) {
$porto->name = $descrizione;
}
$porto->save();
-
+
$id_record = $dbo->lastInsertedID();
$porto->setTranslation('title', $descrizione);
$porto->save();
diff --git a/modules/porti/init.php b/modules/porti/init.php
index 4d59f66fc..1a4c3ca5b 100755
--- a/modules/porti/init.php
+++ b/modules/porti/init.php
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
- use Modules\DDT\Porto;
+use Modules\DDT\Porto;
include_once __DIR__.'/../../core.php';
diff --git a/modules/provenienze/actions.php b/modules/provenienze/actions.php
index f49f7209a..eb160632b 100644
--- a/modules/provenienze/actions.php
+++ b/modules/provenienze/actions.php
@@ -32,7 +32,7 @@ switch (filter('op')) {
$provenienza->setTranslation('title', $descrizione);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$provenienza->name = $descrizione;
- }
+ }
$provenienza->colore = $colore;
$provenienza->save();
flash()->info(tr('Salvataggio completato.'));
@@ -59,7 +59,7 @@ switch (filter('op')) {
}
$provenienza->colore = $colore;
$provenienza->save();
-
+
$id_record = $dbo->lastInsertedID();
$provenienza->setTranslation('title', $descrizione);
$provenienza->save();
diff --git a/modules/relazioni_anagrafiche/actions.php b/modules/relazioni_anagrafiche/actions.php
index 5c63baad7..d1f09bac3 100755
--- a/modules/relazioni_anagrafiche/actions.php
+++ b/modules/relazioni_anagrafiche/actions.php
@@ -33,7 +33,7 @@ switch (filter('op')) {
$relazione->setTranslation('title', $descrizione);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$relazione->name = $descrizione;
- }
+ }
$relazione->colore = $colore;
$relazione->is_bloccata = $is_bloccata;
$relazione->save();
diff --git a/modules/settori_merceologici/actions.php b/modules/settori_merceologici/actions.php
index 2afe67b37..374d780c1 100644
--- a/modules/settori_merceologici/actions.php
+++ b/modules/settori_merceologici/actions.php
@@ -31,7 +31,7 @@ switch (filter('op')) {
$settore->setTranslation('title', $descrizione);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$settore->name = $descrizione;
- }
+ }
$settore->save();
flash()->info(tr('Salvataggio completato.'));
} else {
@@ -58,7 +58,7 @@ switch (filter('op')) {
$id_record = $dbo->lastInsertedID();
$settore->setTranslation('title', $descrizione);
$settore->save();
-
+
if (isAjaxRequest()) {
echo json_encode(['id' => $id_record, 'text' => $descrizione]);
}
diff --git a/modules/spedizioni/actions.php b/modules/spedizioni/actions.php
index 89a03d199..29d186c6f 100755
--- a/modules/spedizioni/actions.php
+++ b/modules/spedizioni/actions.php
@@ -36,7 +36,7 @@ switch (filter('op')) {
}
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$spedizione->name = $descrizione;
- }
+ }
$spedizione->predefined = $predefined;
$spedizione->esterno = $vettore;
$spedizione->save();
@@ -59,7 +59,7 @@ switch (filter('op')) {
$spedizione->name = $descrizione;
}
$spedizione->save();
-
+
$id_record = $dbo->lastInsertedID();
$spedizione->setTranslation('title', $descrizione);
$spedizione->save();
diff --git a/modules/spedizioni/init.php b/modules/spedizioni/init.php
index 5317635e2..5db5b39a2 100755
--- a/modules/spedizioni/init.php
+++ b/modules/spedizioni/init.php
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
- use Modules\DDT\Spedizione;
+use Modules\DDT\Spedizione;
include_once __DIR__.'/../../core.php';
diff --git a/modules/stati_contratto/actions.php b/modules/stati_contratto/actions.php
index 8bba32c7d..cfcf3f507 100755
--- a/modules/stati_contratto/actions.php
+++ b/modules/stati_contratto/actions.php
@@ -31,7 +31,7 @@ switch (post('op')) {
} else {
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$stato->name = $descrizione;
- }
+ }
$stato->icona = post('icona');
$stato->colore = post('colore');
$stato->is_completato = post('is_completato');
@@ -61,7 +61,7 @@ switch (post('op')) {
$stato = Stato::build($icona, $colore, $is_completato, $is_fatturabile, $is_pianificabile);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$stato->name = $descrizione;
- }
+ }
$id_record = $dbo->lastInsertedID();
$stato->setTranslation('title', $descrizione);
$stato->save();
diff --git a/modules/stati_fattura/actions.php b/modules/stati_fattura/actions.php
index 3e7f122b5..680bd989c 100644
--- a/modules/stati_fattura/actions.php
+++ b/modules/stati_fattura/actions.php
@@ -30,7 +30,7 @@ switch (post('op')) {
} else {
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$stato->name = $descrizione;
- }
+ }
$stato->icona = post('icona');
$stato->colore = post('colore');
$stato->setTranslation('title', $descrizione);
diff --git a/modules/stati_preventivo/actions.php b/modules/stati_preventivo/actions.php
index 9aa85cadb..b9da8dc47 100755
--- a/modules/stati_preventivo/actions.php
+++ b/modules/stati_preventivo/actions.php
@@ -30,7 +30,7 @@ switch (post('op')) {
} else {
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$stato->name = $descrizione;
- }
+ }
$stato->icona = post('icona');
$stato->colore = post('colore');
$stato->is_completato = post('is_completato');
@@ -58,7 +58,7 @@ switch (post('op')) {
$stato = Stato::build($icona, $colore, $is_completato, $is_fatturabile, $is_pianificabile);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$stato->name = $descrizione;
- }
+ }
$id_record = $dbo->lastInsertedID();
$stato->setTranslation('title', $descrizione);
$stato->save();
diff --git a/modules/tipi_anagrafiche/actions.php b/modules/tipi_anagrafiche/actions.php
index b42514e7d..0ce8fc7b5 100755
--- a/modules/tipi_anagrafiche/actions.php
+++ b/modules/tipi_anagrafiche/actions.php
@@ -32,7 +32,7 @@ switch (post('op')) {
$tipo->setTranslation('title', $descrizione);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$tipo->name = $descrizione;
- }
+ }
$tipo->save();
flash()->info(tr('Informazioni salvate correttamente!'));
} else {
diff --git a/modules/tipi_documento/actions.php b/modules/tipi_documento/actions.php
index 2927fd44d..a190cfd3e 100644
--- a/modules/tipi_documento/actions.php
+++ b/modules/tipi_documento/actions.php
@@ -37,7 +37,7 @@ switch (filter('op')) {
}
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$tipo->name = $descrizione;
- }
+ }
$tipo->dir = $dir;
$tipo->codice_tipo_documento_fe = $codice_tipo_documento_fe;
$tipo->help = filter('help');
@@ -66,7 +66,7 @@ switch (filter('op')) {
$tipo = Tipo::build($dir, $codice_tipo_documento_fe);
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$tipo->name = $descrizione;
- }
+ }
$id_record = $dbo->lastInsertedID();
$tipo->setTranslation('title', $descrizione);
$tipo->save();
diff --git a/modules/tipi_scadenze/actions.php b/modules/tipi_scadenze/actions.php
index 52454c255..bb5384e49 100755
--- a/modules/tipi_scadenze/actions.php
+++ b/modules/tipi_scadenze/actions.php
@@ -75,12 +75,12 @@ switch (filter('op')) {
if (isset($nome)) {
// Se non esiste già un tipo di scadenza con lo stesso nome
if (empty(Tipo::where('id', '=', (new Tipo())->getByField('title', $descrizione))->where('id', '!=', $id_record)->first())) {
- $tipo = tipo::build();
+ $tipo = Tipo::build();
if (Models\Locale::getDefault()->id == Models\Locale::getPredefined()->id) {
$tipo->name = $nome;
}
$tipo->save();
-
+
$id_record = $dbo->lastInsertedID();
$tipo->setTranslation('title', $descrizione);
$tipo->save();
diff --git a/src/Database.php b/src/Database.php
index 4c53beee1..fe32b2ace 100755
--- a/src/Database.php
+++ b/src/Database.php
@@ -386,7 +386,6 @@ class Database extends Util\Singleton
return null;
}
-
/**
* Restituisce l'identificativo dell'ultimo elemento inserito.
*
diff --git a/templates/fatture/body.php b/templates/fatture/body.php
index 18dfa32a0..1f4f7d95b 100755
--- a/templates/fatture/body.php
+++ b/templates/fatture/body.php
@@ -95,7 +95,7 @@ foreach ($righe as $riga) {
if (in_array($riga->id, $riferimento)) {
if ($riga->id === $riferimento[0]) {
$riga_ordine = $database->fetchOne('SELECT numero_cliente, data_cliente FROM or_ordini WHERE id = '.prepare($riga->idordine));
- if (!(setting('Visualizza numero ordine cliente'))) {
+ if (!setting('Visualizza numero ordine cliente')) {
if (!empty($riga_ordine['numero_cliente']) && !empty($riga_ordine['data_cliente'])) {
$text = $text.'Ordine n. '.$riga_ordine['numero_cliente'].' del '.Translator::dateToLocale($riga_ordine['data_cliente']).'
';
}
diff --git a/update/2_5_1.php b/update/2_5_1.php
index f4578d43f..56400a8bb 100644
--- a/update/2_5_1.php
+++ b/update/2_5_1.php
@@ -16,13 +16,13 @@ if (empty($default)) {
$fk = $database->fetchArray('SELECT * FROM `zz_plugins` WHERE `directory` = "distinta_base"');
if (empty($fk)) {
// File e cartelle deprecate
- delete(realpath(base_dir() . '/plugins/distinta_base/'));
+ delete(realpath(base_dir().'/plugins/distinta_base/'));
}
// Controllo se è presente il campo name in an_provenienze
$has_name = database()->columnExists('an_provenienze', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `an_provenienze` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `an_provenienze` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `an_provenienze` SET `name` = (SELECT `name` FROM `an_provenienze_lang` WHERE `id_record` = `an_provenienze`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('an_provenienze_lang', 'name')) {
@@ -32,7 +32,7 @@ if (database()->columnExists('an_provenienze_lang', 'name')) {
// Controllo se è presente il campo name in an_regioni
$has_name = database()->columnExists('an_regioni', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `an_regioni` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `an_regioni` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `an_regioni` SET `name` = (SELECT `name` FROM `an_regioni_lang` WHERE `id_record` = `an_regioni`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('an_regioni_lang', 'name')) {
@@ -42,7 +42,7 @@ if (database()->columnExists('an_regioni_lang', 'name')) {
// Controllo se è presente il campo name in an_relazioni
$has_name = database()->columnExists('an_relazioni', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `an_relazioni` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `an_relazioni` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `an_relazioni` SET `name` = (SELECT `name` FROM `an_relazioni_lang` WHERE `id_record` = `an_relazioni`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('an_relazioni_lang', 'name')) {
@@ -52,7 +52,7 @@ if (database()->columnExists('an_relazioni_lang', 'name')) {
// Controllo se è presente il campo name in an_settori
$has_name = database()->columnExists('an_settori', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `an_settori` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `an_settori` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `an_settori` SET `name` = (SELECT `name` FROM `an_settori_lang` WHERE `id_record` = `an_settori`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('an_settori_lang', 'name')) {
@@ -62,7 +62,7 @@ if (database()->columnExists('an_settori_lang', 'name')) {
// Controllo se è presente il campo name in an_tipianagrafiche
$has_name = database()->columnExists('an_tipianagrafiche', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `an_tipianagrafiche` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `an_tipianagrafiche` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `an_tipianagrafiche` SET `name` = (SELECT `name` FROM `an_tipianagrafiche_lang` WHERE `id_record` = `an_tipianagrafiche`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('an_tipianagrafiche_lang', 'name')) {
@@ -72,7 +72,7 @@ if (database()->columnExists('an_tipianagrafiche_lang', 'name')) {
// Controllo se è presente il campo name in co_iva
$has_name = database()->columnExists('co_iva', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `co_iva` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `co_iva` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `co_iva` SET `name` = (SELECT `name` FROM `co_iva_lang` WHERE `id_record` = `co_iva`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('co_iva_lang', 'name')) {
@@ -82,7 +82,7 @@ if (database()->columnExists('co_iva_lang', 'name')) {
// Controllo se è presente il campo name in co_pagamenti
$has_name = database()->columnExists('co_pagamenti', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `co_pagamenti` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `co_pagamenti` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `co_pagamenti` SET `name` = (SELECT `name` FROM `co_pagamenti_lang` WHERE `id_record` = `co_pagamenti`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('co_pagamenti_lang', 'name')) {
@@ -92,7 +92,7 @@ if (database()->columnExists('co_pagamenti_lang', 'name')) {
// Controllo se è presente il campo name in co_staticontratti
$has_name = database()->columnExists('co_staticontratti', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `co_staticontratti` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `co_staticontratti` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `co_staticontratti` SET `name` = (SELECT `name` FROM `co_staticontratti_lang` WHERE `id_record` = `co_staticontratti`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('co_staticontratti_lang', 'name')) {
@@ -102,7 +102,7 @@ if (database()->columnExists('co_staticontratti_lang', 'name')) {
// Controllo se è presente il campo name in co_statidocumento
$has_name = database()->columnExists('co_statidocumento', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `co_statidocumento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `co_statidocumento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `co_statidocumento` SET `name` = (SELECT `name` FROM `co_statidocumento_lang` WHERE `id_record` = `co_statidocumento`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('co_statidocumento_lang', 'name')) {
@@ -112,7 +112,7 @@ if (database()->columnExists('co_statidocumento_lang', 'name')) {
// Controllo se è presente il campo name in co_statidocumento
$has_name = database()->columnExists('co_statipreventivi', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `co_statipreventivi` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `co_statipreventivi` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `co_statipreventivi` SET `name` = (SELECT `name` FROM `co_statipreventivi_lang` WHERE `id_record` = `co_statipreventivi`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('co_statipreventivi_lang', 'name')) {
@@ -122,7 +122,7 @@ if (database()->columnExists('co_statipreventivi_lang', 'name')) {
// Controllo se è presente il campo name in co_tipidocumento
$has_name = database()->columnExists('co_tipidocumento', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `co_tipidocumento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `co_tipidocumento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `co_tipidocumento` SET `name` = (SELECT `name` FROM `co_tipidocumento_lang` WHERE `id_record` = `co_tipidocumento`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('co_tipidocumento_lang', 'name')) {
@@ -132,7 +132,7 @@ if (database()->columnExists('co_tipidocumento_lang', 'name')) {
// Controllo se è presente il campo name in co_tipi_scadenze
$has_name = database()->columnExists('co_tipi_scadenze', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `co_tipi_scadenze` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `co_tipi_scadenze` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `co_tipi_scadenze` SET `name` = (SELECT `name` FROM `co_tipi_scadenze_lang` WHERE `id_record` = `co_tipi_scadenze`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('co_tipi_scadenze_lang', 'name')) {
@@ -145,7 +145,7 @@ if (database()->columnExists('co_tipi_scadenze_lang', 'description')) {
// Controllo se è presente il campo name in do_categorie
$has_name = database()->columnExists('do_categorie', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `do_categorie` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `do_categorie` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `do_categorie` SET `name` = (SELECT `name` FROM `do_categorie_lang` WHERE `id_record` = `do_categorie`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('do_categorie_lang', 'name')) {
@@ -155,7 +155,7 @@ if (database()->columnExists('do_categorie_lang', 'name')) {
// Controllo se è presente il campo name in dt_aspettobeni
$has_name = database()->columnExists('dt_aspettobeni', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `dt_aspettobeni` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `dt_aspettobeni` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `dt_aspettobeni` SET `name` = (SELECT `name` FROM `dt_aspettobeni_lang` WHERE `id_record` = `dt_aspettobeni`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('dt_aspettobeni_lang', 'name')) {
@@ -165,7 +165,7 @@ if (database()->columnExists('dt_aspettobeni_lang', 'name')) {
// Controllo se è presente il campo name in dt_causalet
$has_name = database()->columnExists('dt_causalet', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `dt_causalet` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `dt_causalet` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `dt_causalet` SET `name` = (SELECT `name` FROM `dt_causalet_lang` WHERE `id_record` = `dt_causalet`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('dt_causalet_lang', 'name')) {
@@ -175,7 +175,7 @@ if (database()->columnExists('dt_causalet_lang', 'name')) {
// Controllo se è presente il campo name in dt_porto
$has_name = database()->columnExists('dt_porto', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `dt_porto` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `dt_porto` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `dt_porto` SET `name` = (SELECT `name` FROM `dt_porto_lang` WHERE `id_record` = `dt_porto`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('dt_porto_lang', 'name')) {
@@ -185,7 +185,7 @@ if (database()->columnExists('dt_porto_lang', 'name')) {
// Controllo se è presente il campo name in dt_spedizione
$has_name = database()->columnExists('dt_spedizione', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `dt_spedizione` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `dt_spedizione` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `dt_spedizione` SET `name` = (SELECT `name` FROM `dt_spedizione_lang` WHERE `id_record` = `dt_spedizione`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('dt_spedizione_lang', 'name')) {
@@ -195,18 +195,17 @@ if (database()->columnExists('dt_spedizione_lang', 'name')) {
// Controllo se è presente il campo name in dt_statiddt
$has_name = database()->columnExists('dt_statiddt', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `dt_statiddt` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `dt_statiddt` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `dt_statiddt` SET `name` = (SELECT `name` FROM `dt_statiddt_lang` WHERE `id_record` = `dt_statiddt`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('dt_statiddt_lang', 'name')) {
$database->query('ALTER TABLE `dt_statiddt_lang` DROP `name`');
}
-
// Controllo se è presente il campo name in dt_tipiddt
$has_name = database()->columnExists('dt_tipiddt', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `dt_tipiddt` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `dt_tipiddt` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `dt_tipiddt` SET `name` = (SELECT `name` FROM `dt_tipiddt_lang` WHERE `id_record` = `dt_tipiddt`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('dt_tipiddt_lang', 'name')) {
@@ -216,18 +215,17 @@ if (database()->columnExists('dt_tipiddt_lang', 'name')) {
// Controllo se è presente il campo name in em_lists
$has_name = database()->columnExists('em_lists', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `em_lists` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `em_lists` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `em_lists` SET `name` = (SELECT `name` FROM `em_lists_lang` WHERE `id_record` = `em_lists`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('em_lists_lang', 'name')) {
$database->query('ALTER TABLE `em_lists_lang` DROP `name`');
}
-
// Controllo se è presente il campo name in em_templates
$has_name = database()->columnExists('em_templates', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `em_templates` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `em_templates` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `em_templates` SET `name` = (SELECT `name` FROM `em_templates_lang` WHERE `id_record` = `em_templates`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('em_templates_lang', 'name')) {
@@ -237,7 +235,7 @@ if (database()->columnExists('em_templates_lang', 'name')) {
// Controllo se è presente il campo name in fe_modalita_pagamento
$has_name = database()->columnExists('fe_modalita_pagamento', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `fe_modalita_pagamento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
+ $database->query('ALTER TABLE `fe_modalita_pagamento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
$database->query('UPDATE `fe_modalita_pagamento` SET `name` = (SELECT `name` FROM `fe_modalita_pagamento_lang` WHERE `id_record` = `fe_modalita_pagamento`.`codice` AND `id_lang` = 1)');
}
if (database()->columnExists('fe_modalita_pagamento_lang', 'name')) {
@@ -247,7 +245,7 @@ if (database()->columnExists('fe_modalita_pagamento_lang', 'name')) {
// Controllo se è presente il campo name in fe_natura
$has_name = database()->columnExists('fe_natura', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `fe_natura` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
+ $database->query('ALTER TABLE `fe_natura` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
$database->query('UPDATE `fe_natura` SET `name` = (SELECT `name` FROM `fe_natura_lang` WHERE `id_record` = `fe_natura`.`codice` AND `id_lang` = 1)');
}
if (database()->columnExists('fe_natura_lang', 'name')) {
@@ -257,7 +255,7 @@ if (database()->columnExists('fe_natura_lang', 'name')) {
// Controllo se è presente il campo name in fe_regime_fiscale
$has_name = database()->columnExists('fe_regime_fiscale', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `fe_regime_fiscale` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
+ $database->query('ALTER TABLE `fe_regime_fiscale` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
$database->query('UPDATE `fe_regime_fiscale` SET `name` = (SELECT `name` FROM `fe_regime_fiscale_lang` WHERE `id_record` = `fe_regime_fiscale`.`codice` AND `id_lang` = 1)');
}
if (database()->columnExists('fe_regime_fiscale_lang', 'name')) {
@@ -267,7 +265,7 @@ if (database()->columnExists('fe_regime_fiscale_lang', 'name')) {
// Controllo se è presente il campo name in fe_stati_documento
$has_name = database()->columnExists('fe_stati_documento', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `fe_stati_documento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
+ $database->query('ALTER TABLE `fe_stati_documento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
$database->query('UPDATE `fe_stati_documento` SET `name` = (SELECT `name` FROM `fe_stati_documento_lang` WHERE `id_record` = `fe_stati_documento`.`codice` AND `id_lang` = 1)');
}
if (database()->columnExists('fe_stati_documento_lang', 'name')) {
@@ -277,7 +275,7 @@ if (database()->columnExists('fe_stati_documento_lang', 'name')) {
// Controllo se è presente il campo name in fe_tipi_documento
$has_name = database()->columnExists('fe_tipi_documento', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `fe_tipi_documento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
+ $database->query('ALTER TABLE `fe_tipi_documento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
$database->query('UPDATE `fe_tipi_documento` SET `name` = (SELECT `name` FROM `fe_tipi_documento_lang` WHERE `id_record` = `fe_tipi_documento`.`codice` AND `id_lang` = 1)');
}
if (database()->columnExists('fe_tipi_documento_lang', 'name')) {
@@ -292,7 +290,7 @@ if (database()->columnExists('in_fasceorarie_lang', 'name')) {
// Controllo se è presente il campo name in in_statiintervento
$has_name = database()->columnExists('in_statiintervento', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `in_statiintervento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
+ $database->query('ALTER TABLE `in_statiintervento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
$database->query('UPDATE `in_statiintervento` SET `name` = (SELECT `name` FROM `in_statiintervento_lang` WHERE `id_record` = `in_statiintervento`.`codice` AND `id_lang` = 1)');
}
if (database()->columnExists('in_statiintervento_lang', 'name')) {
@@ -302,7 +300,7 @@ if (database()->columnExists('in_statiintervento_lang', 'name')) {
// Controllo se è presente il campo name in in_tipiintervento
$has_name = database()->columnExists('in_tipiintervento', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `in_tipiintervento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
+ $database->query('ALTER TABLE `in_tipiintervento` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `codice`');
$database->query('UPDATE `in_tipiintervento` SET `name` = (SELECT `name` FROM `in_tipiintervento_lang` WHERE `id_record` = `in_tipiintervento`.`codice` AND `id_lang` = 1)');
}
if (database()->columnExists('in_tipiintervento_lang', 'name')) {
@@ -312,7 +310,7 @@ if (database()->columnExists('in_tipiintervento_lang', 'name')) {
// Controllo se è presente il campo name in mg_articoli
$has_name = database()->columnExists('mg_articoli', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `mg_articoli` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `mg_articoli` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `mg_articoli` SET `name` = (SELECT `name` FROM `mg_articoli_lang` WHERE `id_record` = `mg_articoli`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('mg_articoli_lang', 'name')) {
@@ -329,7 +327,6 @@ if (database()->columnExists('mg_categorie_lang', 'name')) {
$database->query('ALTER TABLE `mg_categorie_lang` DROP `name`');
}
-
// Rimozione categoria 'Componenti' se non collegata ad articoli
$categoria = Categoria::find((new Categoria())->getByField('title', 'Componenti'));
$articoli_collegati = $categoria->articoli()->count();
@@ -355,7 +352,7 @@ if (database()->columnExists('my_impianti_categorie_lang', 'name')) {
// Controllo se è presente il campo name in or_statiordine
$has_name = database()->columnExists('or_statiordine', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `or_statiordine` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `or_statiordine` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `or_statiordine` SET `name` = (SELECT `name` FROM `or_statiordine_lang` WHERE `id_record` = `or_statiordine`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('or_statiordine_lang', 'name')) {
@@ -365,7 +362,7 @@ if (database()->columnExists('or_statiordine_lang', 'name')) {
// Controllo se è presente il campo name in or_tipiordine
$has_name = database()->columnExists('or_tipiordine', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `or_tipiordine` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `or_tipiordine` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `or_tipiordine` SET `name` = (SELECT `name` FROM `or_tipiordine_lang` WHERE `id_record` = `or_tipiordine`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('or_tipiordine_lang', 'name')) {
@@ -375,7 +372,7 @@ if (database()->columnExists('or_tipiordine_lang', 'name')) {
// Controllo se è presente il campo name in zz_cache
$has_name = database()->columnExists('zz_cache', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_cache` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_cache` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_cache` SET `name` = (SELECT `name` FROM `zz_cache_lang` WHERE `id_record` = `zz_cache`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_cache_lang', 'name')) {
@@ -390,7 +387,7 @@ if (database()->columnExists('zz_currencies_lang', 'name')) {
// Controllo se è presente il campo name in zz_groups
$has_name = database()->columnExists('zz_groups', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_groups` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_groups` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_groups` SET `name` = (SELECT `name` FROM `zz_groups_lang` WHERE `id_record` = `zz_groups`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_groups_lang', 'name')) {
@@ -400,7 +397,7 @@ if (database()->columnExists('zz_groups_lang', 'name')) {
// Controllo se è presente il campo name in zz_group_module
$has_name = database()->columnExists('zz_group_module', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_group_module` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_group_module` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_group_module` SET `name` = (SELECT `name` FROM `zz_group_module_lang` WHERE `id_record` = `zz_group_module`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_group_module_lang', 'name')) {
@@ -410,7 +407,7 @@ if (database()->columnExists('zz_group_module_lang', 'name')) {
// Controllo se è presente il campo name in zz_hooks
$has_name = database()->columnExists('zz_hooks', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_hooks` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_hooks` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_hooks` SET `name` = (SELECT `name` FROM `zz_hooks_lang` WHERE `id_record` = `zz_hooks`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_hooks_lang', 'name')) {
@@ -420,7 +417,7 @@ if (database()->columnExists('zz_hooks_lang', 'name')) {
// Controllo se è presente il campo name in zz_imports
$has_name = database()->columnExists('zz_imports', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_imports` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_imports` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_imports` SET `name` = (SELECT `name` FROM `zz_imports_lang` WHERE `id_record` = `zz_imports`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_imports_lang', 'name')) {
@@ -430,7 +427,7 @@ if (database()->columnExists('zz_imports_lang', 'name')) {
// Controllo se è presente il campo name in zz_modules
$has_name = database()->columnExists('zz_modules', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_modules` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_modules` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_modules` SET `name` = (SELECT `name` FROM `zz_modules_lang` WHERE `id_record` = `zz_modules`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_modules_lang', 'name')) {
@@ -440,7 +437,7 @@ if (database()->columnExists('zz_modules_lang', 'name')) {
// Controllo se è presente il campo name in zz_plugins
$has_name = database()->columnExists('zz_plugins', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_plugins` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_plugins` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_plugins` SET `name` = (SELECT `name` FROM `zz_plugins_lang` WHERE `id_record` = `zz_plugins`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_plugins_lang', 'name')) {
@@ -455,7 +452,7 @@ if (database()->columnExists('zz_prints_lang', 'name')) {
// Controllo se è presente il campo name in zz_segments
$has_name = database()->columnExists('zz_segments', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_segments` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_segments` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_segments` SET `name` = (SELECT `name` FROM `zz_segments_lang` WHERE `id_record` = `zz_segments`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_segments_lang', 'name')) {
@@ -465,7 +462,7 @@ if (database()->columnExists('zz_segments_lang', 'name')) {
// Controllo se è presente il campo name in zz_tasks
$has_name = database()->columnExists('zz_tasks', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_tasks` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_tasks` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_tasks` SET `name` = (SELECT `name` FROM `zz_tasks_lang` WHERE `id_record` = `zz_tasks`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_tasks_lang', 'name')) {
@@ -475,7 +472,7 @@ if (database()->columnExists('zz_tasks_lang', 'name')) {
// Controllo se è presente il campo name in zz_views
$has_name = database()->columnExists('zz_views', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_views` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_views` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_views` SET `name` = (SELECT `name` FROM `zz_views_lang` WHERE `id_record` = `zz_views`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_views_lang', 'name')) {
@@ -485,9 +482,9 @@ if (database()->columnExists('zz_views_lang', 'name')) {
// Controllo se è presente il campo name in zz_widgets
$has_name = database()->columnExists('zz_widgets', 'name');
if (!$has_name) {
- $database->query('ALTER TABLE `zz_widgets` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
+ $database->query('ALTER TABLE `zz_widgets` ADD `name` VARCHAR(255) NULL DEFAULT NULL AFTER `id`');
$database->query('UPDATE `zz_widgets` SET `name` = (SELECT `name` FROM `zz_widgets_lang` WHERE `id_record` = `zz_widgets`.`id` AND `id_lang` = 1)');
}
if (database()->columnExists('zz_widgets_lang', 'name')) {
$database->query('ALTER TABLE `zz_widgets_lang` DROP `name`');
-}
\ No newline at end of file
+}