1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-10 00:20:51 +01:00

Formattazione codice

This commit is contained in:
Pek5892 2023-09-21 17:34:30 +02:00
parent 2c532f2254
commit 0f5dfcccfd
21 changed files with 58 additions and 69 deletions

View File

@ -24,7 +24,6 @@ use API\Interfaces\DeleteInterface;
use API\Interfaces\RetrieveInterface; use API\Interfaces\RetrieveInterface;
use API\Interfaces\UpdateInterface; use API\Interfaces\UpdateInterface;
use API\Resource; use API\Resource;
use Modules;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface, UpdateInterface, DeleteInterface class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface, UpdateInterface, DeleteInterface
@ -35,13 +34,13 @@ class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface
$select = [ $select = [
'an_anagrafiche.*', 'an_anagrafiche.*',
'an_nazioni.nome AS nazione' 'an_nazioni.nome AS nazione',
]; ];
$joins[] = [ $joins[] = [
'an_nazioni', 'an_nazioni',
'an_anagrafiche.id_nazione', 'an_anagrafiche.id_nazione',
'an_nazioni.id' 'an_nazioni.id',
]; ];
$where[] = ['an_anagrafiche.deleted_at', '=', null]; $where[] = ['an_anagrafiche.deleted_at', '=', null];
@ -54,13 +53,13 @@ class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface
$joins[] = [ $joins[] = [
'an_tipianagrafiche_anagrafiche', 'an_tipianagrafiche_anagrafiche',
'an_anagrafiche.idanagrafica', 'an_anagrafiche.idanagrafica',
'an_tipianagrafiche_anagrafiche.idanagrafica' 'an_tipianagrafiche_anagrafiche.idanagrafica',
]; ];
$joins[] = [ $joins[] = [
'an_tipianagrafiche', 'an_tipianagrafiche',
'an_tipianagrafiche_anagrafiche.idtipoanagrafica', 'an_tipianagrafiche_anagrafiche.idtipoanagrafica',
'an_tipianagrafiche.idtipoanagrafica' 'an_tipianagrafiche.idtipoanagrafica',
]; ];
$where[] = ['an_tipianagrafiche.descrizione', '=', $type]; $where[] = ['an_tipianagrafiche.descrizione', '=', $type];
@ -71,9 +70,8 @@ class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface
'select' => $select, 'select' => $select,
'joins' => $joins, 'joins' => $joins,
'where' => $where, 'where' => $where,
'order' => $order 'order' => $order,
]; ];
} }
public function create($request) public function create($request)

View File

@ -29,7 +29,7 @@ class Sedi extends Resource implements RetrieveInterface
$table = 'an_sedi'; $table = 'an_sedi';
return [ return [
'table' => $table 'table' => $table,
]; ];
} }
} }

View File

@ -34,21 +34,21 @@ class Articoli extends Resource implements RetrieveInterface, UpdateInterface, C
$select = [ $select = [
'mg_articoli.*', 'mg_articoli.*',
'categorie.nome AS categoria', 'categorie.nome AS categoria',
'sottocategorie.nome AS sottocategoria' 'sottocategorie.nome AS sottocategoria',
]; ];
$joins[] = [ $joins[] = [
'mg_categorie AS categorie', 'mg_categorie AS categorie',
'mg_articoli.id_categoria', 'mg_articoli.id_categoria',
'categorie.id' 'categorie.id',
]; ];
$joins[] = [ $joins[] = [
'mg_categorie AS sottocategorie', 'mg_categorie AS sottocategorie',
'mg_articoli.id_sottocategoria', 'mg_articoli.id_sottocategoria',
'sottocategorie.id' 'sottocategorie.id',
]; ];
$where[] = ['mg_articoli.deleted_at', '=', NULL ]; $where[] = ['mg_articoli.deleted_at', '=', null];
$whereraw = []; $whereraw = [];
@ -60,7 +60,7 @@ class Articoli extends Resource implements RetrieveInterface, UpdateInterface, C
'joins' => $joins, 'joins' => $joins,
'where' => $where, 'where' => $where,
'whereraw' => $whereraw, 'whereraw' => $whereraw,
'order' => $order 'order' => $order,
]; ];
} }

View File

@ -127,7 +127,6 @@ class Check extends Model
} }
*/ */
/** /**
* Rimuove tutte le check di un determinato modulo/plugin e record. * Rimuove tutte le check di un determinato modulo/plugin e record.
* *

View File

@ -194,7 +194,6 @@ class Mail extends Model
database()->table('em_emails')->where('id_record', $data['id_record'])->whereIn('id_template', $id_templates)->delete(); database()->table('em_emails')->where('id_record', $data['id_record'])->whereIn('id_template', $id_templates)->delete();
} }
/* Relazioni Eloquent */ /* Relazioni Eloquent */
public function account() public function account()

View File

@ -33,7 +33,7 @@ class Impianti extends Resource implements RetrieveInterface
'my_impianti.idanagrafica', 'my_impianti.idanagrafica',
'my_impianti.matricola', 'my_impianti.matricola',
'my_impianti.nome', 'my_impianti.nome',
'my_impianti.descrizione' 'my_impianti.descrizione',
]; ];
$where = []; $where = [];
@ -50,7 +50,7 @@ class Impianti extends Resource implements RetrieveInterface
'where' => $where, 'where' => $where,
'whereraw' => $whereraw, 'whereraw' => $whereraw,
'order' => $order, 'order' => $order,
'group' => $group 'group' => $group,
]; ];
} }
} }

View File

@ -288,7 +288,6 @@ switch (post('op')) {
// Eliminazione associazione interventi e my_impianti // Eliminazione associazione interventi e my_impianti
$dbo->query('DELETE FROM my_impianti_interventi WHERE idintervento='.prepare($id_record)); $dbo->query('DELETE FROM my_impianti_interventi WHERE idintervento='.prepare($id_record));
} catch (InvalidArgumentException $e) { } catch (InvalidArgumentException $e) {
} }
} }

View File

@ -37,15 +37,15 @@ class Articoli extends Resource implements RetrieveInterface, CreateInterface
'in_righe_interventi.idarticolo AS id_articolo', 'in_righe_interventi.idarticolo AS id_articolo',
'in_righe_interventi.idintervento AS id_intervento', 'in_righe_interventi.idintervento AS id_intervento',
'in_righe_interventi.qta', '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 [ return [
'table' => $table, 'table' => $table,
'select' => $select, 'select' => $select,
'where' => $where 'where' => $where,
]; ];
} }
@ -66,4 +66,3 @@ class Articoli extends Resource implements RetrieveInterface, CreateInterface
$articolo->save(); $articolo->save();
} }
} }

View File

@ -25,7 +25,6 @@ use Models\Upload;
class Firma extends Resource implements UpdateInterface class Firma extends Resource implements UpdateInterface
{ {
// TODO: Da rivedere con upload in base64 // TODO: Da rivedere con upload in base64
public function update($request) public function update($request)
{ {

View File

@ -31,7 +31,7 @@ class Impianti extends Resource implements RetrieveInterface, CreateInterface
$select = [ $select = [
'idimpianto AS id_impianto', 'idimpianto AS id_impianto',
'idintervento AS id_intervento' 'idintervento AS id_intervento',
]; ];
$where[] = ['my_impianti_interventi.idintervento', '=', $request['id_intervento']]; $where[] = ['my_impianti_interventi.idintervento', '=', $request['id_intervento']];
@ -39,7 +39,7 @@ class Impianti extends Resource implements RetrieveInterface, CreateInterface
return [ return [
'table' => $table, 'table' => $table,
'select' => $select, 'select' => $select,
'where' => $where 'where' => $where,
]; ];
} }

View File

@ -24,7 +24,6 @@ use API\Interfaces\RetrieveInterface;
use API\Interfaces\UpdateInterface; use API\Interfaces\UpdateInterface;
use API\Resource; use API\Resource;
use Auth; use Auth;
use Modules;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
use Modules\Interventi\Intervento; use Modules\Interventi\Intervento;
use Modules\Interventi\Stato; use Modules\Interventi\Stato;
@ -43,31 +42,31 @@ class Interventi extends Resource implements RetrieveInterface, CreateInterface,
'in_interventi.*', 'in_interventi.*',
'MAX(in_interventi_tecnici.orario_fine) as data', 'MAX(in_interventi_tecnici.orario_fine) as data',
'GROUP_CONCAT(DISTINCT b.ragione_sociale SEPARATOR \', \') AS tecnici', 'GROUP_CONCAT(DISTINCT b.ragione_sociale SEPARATOR \', \') AS tecnici',
'in_statiintervento.descrizione AS stato' 'in_statiintervento.descrizione AS stato',
]; ];
$joins[] = [ $joins[] = [
'in_statiintervento', 'in_statiintervento',
'in_interventi.idstatointervento', 'in_interventi.idstatointervento',
'in_statiintervento.idstatointervento' 'in_statiintervento.idstatointervento',
]; ];
$joins[] = [ $joins[] = [
'an_anagrafiche', 'an_anagrafiche',
'in_interventi.idanagrafica', 'in_interventi.idanagrafica',
'an_anagrafiche.idanagrafica' 'an_anagrafiche.idanagrafica',
]; ];
$joins[] = [ $joins[] = [
'in_interventi_tecnici', 'in_interventi_tecnici',
'in_interventi_tecnici.idintervento', 'in_interventi_tecnici.idintervento',
'in_interventi.id' 'in_interventi.id',
]; ];
$joins[] = [ $joins[] = [
'an_anagrafiche as b', 'an_anagrafiche as b',
'in_interventi_tecnici.idtecnico', 'in_interventi_tecnici.idtecnico',
'b.ragione_sociale' 'b.ragione_sociale',
]; ];
$where = []; $where = [];

View File

@ -52,9 +52,9 @@ switch (filter('op')) {
flash()->info(tr('Campagna newsletter salvata!')); flash()->info(tr('Campagna newsletter salvata!'));
if($newsletter->state = "OK") { if ($newsletter->state = 'OK') {
$newsletter->completed_at = $newsletter->updated_at; $newsletter->completed_at = $newsletter->updated_at;
}; }
$newsletter->save(); $newsletter->save();

View File

@ -23,7 +23,7 @@ use Modules\Preventivi\Stato;
$id_module = Modules::get('Preventivi')['id']; $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)) { if (!empty($rs)) {
echo " echo "

View File

@ -97,7 +97,7 @@ class Manager
$where[] = [ $where[] = [
$key, $key,
'LIKE', 'LIKE',
$value $value,
]; ];
} }
@ -106,7 +106,7 @@ class Manager
$where[] = [ $where[] = [
$key, $key,
'=', '=',
$value $value,
]; ];
} }
} }
@ -137,7 +137,7 @@ class Manager
'order' => $order, 'order' => $order,
'page' => $page, 'page' => $page,
'length' => $length, 'length' => $length,
'whereraw' => $whereraw 'whereraw' => $whereraw,
]); ]);
$response = $this->getResponse($data); $response = $this->getResponse($data);
@ -197,7 +197,6 @@ class Manager
$query->groupBy($group); $query->groupBy($group);
} }
$count = $query->count(); $count = $query->count();
// Composizione query finale // Composizione query finale

View File

@ -480,7 +480,6 @@ class Database extends Util\Singleton
$statement->where($conditions); $statement->where($conditions);
foreach ($select as $s) { foreach ($select as $s) {
$statement->selectRaw($s); $statement->selectRaw($s);
} }

View File

@ -70,7 +70,6 @@ class Note extends Model
database()->delete('zz_notes', $data); database()->delete('zz_notes', $data);
} }
/* Relazioni Eloquent */ /* Relazioni Eloquent */
public function user() public function user()

View File

@ -172,7 +172,7 @@ if ($options['pricing']) {
echo " echo "
<th class='text-center' style='width:15%'>".tr('Prezzo unitario', [], ['upper' => true])."</th> <th class='text-center' style='width:15%'>".tr('Prezzo unitario', [], ['upper' => true])."</th>
<th class='text-center' style='width:10%'>".tr('IVA', [], ['upper' => true])." (%)</th> <th class='text-center' style='width:10%'>".tr('IVA', [], ['upper' => true])." (%)</th>
<th class='text-center' style='width:15%'>".($options['hide-total'] ? tr('Importo ivato', [], ['upper' => true]) : tr('Importo', [], ['upper' => true]))."</th>"; <th class='text-center' style='width:15%'>".($options['hide-total'] ? tr('Importo ivato', [], ['upper' => true]) : tr('Importo', [], ['upper' => true])).'</th>';
} }
echo ' echo '