diff --git a/include/bottom.php b/include/bottom.php index d72a083a8..77df97a38 100755 --- a/include/bottom.php +++ b/include/bottom.php @@ -65,8 +65,8 @@ if (Auth::check()) { '; } - // Hooks - echo ' + // Hooks + echo ' '; } diff --git a/include/common/descrizione.php b/include/common/descrizione.php index 0dee7d76c..d332527ba 100755 --- a/include/common/descrizione.php +++ b/include/common/descrizione.php @@ -39,4 +39,4 @@ if ($module['name'] == 'Preventivi' && $options['op'] == 'manage_descrizione') { {[ "type": "checkbox", "label": "'.tr('Utilizza come titolo del gruppo').'", "name": "is_titolo", "value": '.json_encode($result['is_titolo']).', "help": "'.tr('').'" ]} '; -} \ No newline at end of file +} diff --git a/include/init/maintenance.php b/include/init/maintenance.php index 63ce05a31..c02c45db7 100644 --- a/include/init/maintenance.php +++ b/include/init/maintenance.php @@ -22,7 +22,7 @@ include_once __DIR__.'/../../core.php'; if ($config['maintenance_ip'] != $_SERVER['REMOTE_ADDR']) { include_once App::filepath('include|custom|', 'top.php'); $img = App::getPaths()['img']; - + echo '
diff --git a/modules/anagrafiche/src/API/v1/Anagrafiche.php b/modules/anagrafiche/src/API/v1/Anagrafiche.php index e33c72cc7..1875ca617 100755 --- a/modules/anagrafiche/src/API/v1/Anagrafiche.php +++ b/modules/anagrafiche/src/API/v1/Anagrafiche.php @@ -24,7 +24,6 @@ use API\Interfaces\DeleteInterface; use API\Interfaces\RetrieveInterface; use API\Interfaces\UpdateInterface; use API\Resource; -use Modules; use Modules\Anagrafiche\Anagrafica; class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface, UpdateInterface, DeleteInterface @@ -35,13 +34,13 @@ class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface $select = [ 'an_anagrafiche.*', - 'an_nazioni.nome AS nazione' + 'an_nazioni.nome AS nazione', ]; $joins[] = [ 'an_nazioni', 'an_anagrafiche.id_nazione', - 'an_nazioni.id' + 'an_nazioni.id', ]; $where[] = ['an_anagrafiche.deleted_at', '=', null]; @@ -54,13 +53,13 @@ class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface $joins[] = [ 'an_tipianagrafiche_anagrafiche', 'an_anagrafiche.idanagrafica', - 'an_tipianagrafiche_anagrafiche.idanagrafica' + 'an_tipianagrafiche_anagrafiche.idanagrafica', ]; $joins[] = [ 'an_tipianagrafiche', 'an_tipianagrafiche_anagrafiche.idtipoanagrafica', - 'an_tipianagrafiche.idtipoanagrafica' + 'an_tipianagrafiche.idtipoanagrafica', ]; $where[] = ['an_tipianagrafiche.descrizione', '=', $type]; @@ -71,9 +70,8 @@ class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface 'select' => $select, 'joins' => $joins, 'where' => $where, - 'order' => $order + 'order' => $order, ]; - } public function create($request) diff --git a/modules/anagrafiche/src/API/v1/Sedi.php b/modules/anagrafiche/src/API/v1/Sedi.php index 6724b3fa5..c9f5e60f8 100755 --- a/modules/anagrafiche/src/API/v1/Sedi.php +++ b/modules/anagrafiche/src/API/v1/Sedi.php @@ -29,7 +29,7 @@ class Sedi extends Resource implements RetrieveInterface $table = 'an_sedi'; return [ - 'table' => $table + 'table' => $table, ]; } } diff --git a/modules/articoli/src/API/v1/Articoli.php b/modules/articoli/src/API/v1/Articoli.php index b2bcc6fa5..bfe612c01 100755 --- a/modules/articoli/src/API/v1/Articoli.php +++ b/modules/articoli/src/API/v1/Articoli.php @@ -34,21 +34,21 @@ class Articoli extends Resource implements RetrieveInterface, UpdateInterface, C $select = [ 'mg_articoli.*', 'categorie.nome AS categoria', - 'sottocategorie.nome AS sottocategoria' + 'sottocategorie.nome AS sottocategoria', ]; $joins[] = [ 'mg_categorie AS categorie', 'mg_articoli.id_categoria', - 'categorie.id' + 'categorie.id', ]; $joins[] = [ 'mg_categorie AS sottocategorie', 'mg_articoli.id_sottocategoria', - 'sottocategorie.id' + 'sottocategorie.id', ]; - $where[] = ['mg_articoli.deleted_at', '=', NULL ]; + $where[] = ['mg_articoli.deleted_at', '=', null]; $whereraw = []; @@ -60,7 +60,7 @@ class Articoli extends Resource implements RetrieveInterface, UpdateInterface, C 'joins' => $joins, 'where' => $where, 'whereraw' => $whereraw, - 'order' => $order + 'order' => $order, ]; } diff --git a/modules/checklists/src/Check.php b/modules/checklists/src/Check.php index 9998c7808..98fab83b3 100755 --- a/modules/checklists/src/Check.php +++ b/modules/checklists/src/Check.php @@ -127,7 +127,6 @@ class Check extends Model } */ - /** * Rimuove tutte le check di un determinato modulo/plugin e record. * @@ -137,7 +136,7 @@ class Check extends Model { database()->delete('zz_checks', $data); } - + /* Relazioni Eloquent */ public function user() diff --git a/modules/emails/src/Mail.php b/modules/emails/src/Mail.php index 684ccfa47..442c19486 100755 --- a/modules/emails/src/Mail.php +++ b/modules/emails/src/Mail.php @@ -187,14 +187,13 @@ class Mail extends Model $id_templates = []; - foreach($templates as $template) { + foreach ($templates as $template) { $id_templates[] = $template->id; } database()->table('em_emails')->where('id_record', $data['id_record'])->whereIn('id_template', $id_templates)->delete(); } - /* Relazioni Eloquent */ public function account() diff --git a/modules/impianti/src/API/v1/Impianti.php b/modules/impianti/src/API/v1/Impianti.php index 9d7ae4e99..69a61adeb 100755 --- a/modules/impianti/src/API/v1/Impianti.php +++ b/modules/impianti/src/API/v1/Impianti.php @@ -33,7 +33,7 @@ class Impianti extends Resource implements RetrieveInterface 'my_impianti.idanagrafica', 'my_impianti.matricola', 'my_impianti.nome', - 'my_impianti.descrizione' + 'my_impianti.descrizione', ]; $where = []; @@ -50,7 +50,7 @@ class Impianti extends Resource implements RetrieveInterface 'where' => $where, 'whereraw' => $whereraw, 'order' => $order, - 'group' => $group + 'group' => $group, ]; } } diff --git a/modules/interventi/bulk.php b/modules/interventi/bulk.php index 802f48936..9d3e2996b 100755 --- a/modules/interventi/bulk.php +++ b/modules/interventi/bulk.php @@ -288,7 +288,6 @@ switch (post('op')) { // Eliminazione associazione interventi e my_impianti $dbo->query('DELETE FROM my_impianti_interventi WHERE idintervento='.prepare($id_record)); - } catch (InvalidArgumentException $e) { } } diff --git a/modules/interventi/src/API/v1/Articoli.php b/modules/interventi/src/API/v1/Articoli.php index d4cfe1f84..ec220f638 100755 --- a/modules/interventi/src/API/v1/Articoli.php +++ b/modules/interventi/src/API/v1/Articoli.php @@ -37,15 +37,15 @@ class Articoli extends Resource implements RetrieveInterface, CreateInterface 'in_righe_interventi.idarticolo AS id_articolo', 'in_righe_interventi.idintervento AS id_intervento', 'in_righe_interventi.qta', - 'in_righe_interventi.created_at as data' + 'in_righe_interventi.created_at as data', ]; - $where = [['in_righe_interventi.idarticolo', '!=', NULL ], ['in_righe_interventi.idintervento', '=', $request['id_intervento']]]; + $where = [['in_righe_interventi.idarticolo', '!=', null], ['in_righe_interventi.idintervento', '=', $request['id_intervento']]]; return [ 'table' => $table, 'select' => $select, - 'where' => $where + 'where' => $where, ]; } @@ -66,4 +66,3 @@ class Articoli extends Resource implements RetrieveInterface, CreateInterface $articolo->save(); } } - diff --git a/modules/interventi/src/API/v1/Firma.php b/modules/interventi/src/API/v1/Firma.php index 58783facf..a500a0589 100755 --- a/modules/interventi/src/API/v1/Firma.php +++ b/modules/interventi/src/API/v1/Firma.php @@ -25,7 +25,6 @@ use Models\Upload; class Firma extends Resource implements UpdateInterface { - // TODO: Da rivedere con upload in base64 public function update($request) { diff --git a/modules/interventi/src/API/v1/Impianti.php b/modules/interventi/src/API/v1/Impianti.php index b6668eba1..e43276bd3 100755 --- a/modules/interventi/src/API/v1/Impianti.php +++ b/modules/interventi/src/API/v1/Impianti.php @@ -31,7 +31,7 @@ class Impianti extends Resource implements RetrieveInterface, CreateInterface $select = [ 'idimpianto AS id_impianto', - 'idintervento AS id_intervento' + 'idintervento AS id_intervento', ]; $where[] = ['my_impianti_interventi.idintervento', '=', $request['id_intervento']]; @@ -39,7 +39,7 @@ class Impianti extends Resource implements RetrieveInterface, CreateInterface return [ 'table' => $table, 'select' => $select, - 'where' => $where + 'where' => $where, ]; } diff --git a/modules/interventi/src/API/v1/Interventi.php b/modules/interventi/src/API/v1/Interventi.php index 0d100d24c..68d60c2cd 100755 --- a/modules/interventi/src/API/v1/Interventi.php +++ b/modules/interventi/src/API/v1/Interventi.php @@ -24,7 +24,6 @@ use API\Interfaces\RetrieveInterface; use API\Interfaces\UpdateInterface; use API\Resource; use Auth; -use Modules; use Modules\Anagrafiche\Anagrafica; use Modules\Interventi\Intervento; use Modules\Interventi\Stato; @@ -43,36 +42,36 @@ class Interventi extends Resource implements RetrieveInterface, CreateInterface, 'in_interventi.*', 'MAX(in_interventi_tecnici.orario_fine) as data', 'GROUP_CONCAT(DISTINCT b.ragione_sociale SEPARATOR \', \') AS tecnici', - 'in_statiintervento.descrizione AS stato' + 'in_statiintervento.descrizione AS stato', ]; $joins[] = [ 'in_statiintervento', 'in_interventi.idstatointervento', - 'in_statiintervento.idstatointervento' + 'in_statiintervento.idstatointervento', ]; $joins[] = [ 'an_anagrafiche', 'in_interventi.idanagrafica', - 'an_anagrafiche.idanagrafica' + 'an_anagrafiche.idanagrafica', ]; $joins[] = [ 'in_interventi_tecnici', 'in_interventi_tecnici.idintervento', - 'in_interventi.id' + 'in_interventi.id', ]; $joins[] = [ 'an_anagrafiche as b', 'in_interventi_tecnici.idtecnico', - 'b.ragione_sociale' + 'b.ragione_sociale', ]; $where = []; - if(!$user->is_admin){ + if (!$user->is_admin) { $where[] = ['in_interventi_tecnici.idtecnico', '=', $user->idanagrafica]; } diff --git a/modules/newsletter/actions.php b/modules/newsletter/actions.php index ed483573f..71fb03f55 100755 --- a/modules/newsletter/actions.php +++ b/modules/newsletter/actions.php @@ -52,10 +52,10 @@ switch (filter('op')) { flash()->info(tr('Campagna newsletter salvata!')); - if($newsletter->state = "OK") { - $newsletter->completed_at = $newsletter -> updated_at; - }; - + if ($newsletter->state = 'OK') { + $newsletter->completed_at = $newsletter->updated_at; + } + $newsletter->save(); break; diff --git a/modules/preventivi/widgets/preventivi.fatturare.dashboard.php b/modules/preventivi/widgets/preventivi.fatturare.dashboard.php index bc15cd96f..d2acf9d55 100644 --- a/modules/preventivi/widgets/preventivi.fatturare.dashboard.php +++ b/modules/preventivi/widgets/preventivi.fatturare.dashboard.php @@ -23,7 +23,7 @@ use Modules\Preventivi\Stato; $id_module = Modules::get('Preventivi')['id']; -$rs = $dbo->fetchArray("SELECT *, (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=co_preventivi.idanagrafica) AS ragione_sociale FROM co_preventivi WHERE idstato IN (SELECT id FROM co_statipreventivi WHERE is_fatturabile = 1) AND default_revision = 1 ORDER BY data_conclusione ASC"); +$rs = $dbo->fetchArray('SELECT *, (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=co_preventivi.idanagrafica) AS ragione_sociale FROM co_preventivi WHERE idstato IN (SELECT id FROM co_statipreventivi WHERE is_fatturabile = 1) AND default_revision = 1 ORDER BY data_conclusione ASC'); if (!empty($rs)) { echo " @@ -39,7 +39,7 @@ if (!empty($rs)) { $data_accettazione = ($preventivo['data_accettazione'] != '0000-00-00') ? Translator::dateToLocale($preventivo['data_accettazione']) : ''; $data_conclusione = ($preventivo['data_conclusione'] != '0000-00-00') ? Translator::dateToLocale($preventivo['data_conclusione']) : ''; $stato_preventivo = Stato::find($preventivo['idstato'])->descrizione; - + if (strtotime($preventivo['data_conclusione']) < strtotime(date('Y-m-d')) && $data_conclusione != '') { $attr = ' class="danger"'; } else { diff --git a/src/API/Manager.php b/src/API/Manager.php index f90abfe99..7f5fa48bc 100755 --- a/src/API/Manager.php +++ b/src/API/Manager.php @@ -91,22 +91,22 @@ class Manager $value = trim($value, ']'); $values = explode(',', $value); - foreach ($values as $value){ + foreach ($values as $value) { // Filtro per LIKE se il valore contiene % if (string_contains($value, '%')) { $where[] = [ $key, 'LIKE', - $value + $value, ]; } - + // Filtro preciso se il valore non contiene % else { $where[] = [ $key, '=', - $value + $value, ]; } } @@ -137,7 +137,7 @@ class Manager 'order' => $order, 'page' => $page, 'length' => $length, - 'whereraw' => $whereraw + 'whereraw' => $whereraw, ]); $response = $this->getResponse($data); @@ -147,10 +147,10 @@ class Manager $joins = $response['joins']; $group = $response['group']; - if(!empty($response['where'])){ + if (!empty($response['where'])) { $where = array_merge($where, $response['where']); } - if(!empty($response['whereraw'])){ + if (!empty($response['whereraw'])) { $whereraw = $response['whereraw']; } @@ -180,7 +180,7 @@ class Manager foreach ($select as $s) { $query->selectRaw($s); } - + foreach ($joins as $join) { $query->leftJoin($join[0], $join[1], $join[2]); } @@ -197,7 +197,6 @@ class Manager $query->groupBy($group); } - $count = $query->count(); // Composizione query finale diff --git a/src/Common/Document.php b/src/Common/Document.php index 99002e74d..d4630a77e 100755 --- a/src/Common/Document.php +++ b/src/Common/Document.php @@ -295,7 +295,7 @@ abstract class Document extends Model implements ReferenceInterface, DocumentInt $id_fields = []; - foreach($fields as $field) { + foreach ($fields as $field) { $id_fields[] = $field->id; } database()->table('zz_field_record')->where('id_record', $this->id)->whereIn('id_field', $id_fields)->delete(); diff --git a/src/Database.php b/src/Database.php index 926fd8962..3ba0753e3 100755 --- a/src/Database.php +++ b/src/Database.php @@ -469,7 +469,7 @@ class Database extends Util\Singleton $select = !empty($select) ? $select : ['*']; $statement = Capsule::table($table); - + foreach ($joins as $join) { $statement = $statement->leftJoin($join[0], $join[1], $join[2]); } @@ -480,7 +480,6 @@ class Database extends Util\Singleton $statement->where($conditions); - foreach ($select as $s) { $statement->selectRaw($s); } diff --git a/src/Models/Note.php b/src/Models/Note.php index 496279d97..2c97854c2 100755 --- a/src/Models/Note.php +++ b/src/Models/Note.php @@ -70,7 +70,6 @@ class Note extends Model database()->delete('zz_notes', $data); } - /* Relazioni Eloquent */ public function user() diff --git a/templates/preventivi/body.php b/templates/preventivi/body.php index d5f5c312f..0b4dd8c6c 100755 --- a/templates/preventivi/body.php +++ b/templates/preventivi/body.php @@ -172,7 +172,7 @@ if ($options['pricing']) { echo " ".tr('Prezzo unitario', [], ['upper' => true])." ".tr('IVA', [], ['upper' => true])." (%) - ".($options['hide-total'] ? tr('Importo ivato', [], ['upper' => true]) : tr('Importo', [], ['upper' => true])).""; + ".($options['hide-total'] ? tr('Importo ivato', [], ['upper' => true]) : tr('Importo', [], ['upper' => true])).''; } echo ' @@ -280,8 +280,8 @@ foreach ($righe as $key => $riga) { '.Translator::numberToLocale($riga->aliquota->percentuale, 2).' '; - // Imponibile - echo ' + // Imponibile + echo ' '.(($options['hide-total'] || $prezzi_ivati) ? moneyFormat($riga->totale) : moneyFormat($riga->totale_imponibile)).' ';