Formattazione codice

This commit is contained in:
Pek5892 2024-01-31 14:23:46 +01:00
parent 47801bf4f8
commit 71b1f91005
27 changed files with 81 additions and 87 deletions

View File

@ -491,7 +491,7 @@ if ($structure->permission == 'rw') {
$query = 'SELECT `id`, `html_name` AS `name` FROM `zz_fields` WHERE '.$custom_where;
$customs = $dbo->fetchArray($query);
if (post('op')!='delete') {
if (post('op') != 'delete') {
$values = [];
foreach ($customs as $custom) {
if (post($custom['name']) !== null) {
@ -502,7 +502,7 @@ if ($structure->permission == 'rw') {
}
// Inserimento iniziale
if (post('op')=='add') {
if (post('op') == 'add') {
// Informazioni di log
Filter::set('get', 'id_record', $id_record);
@ -516,7 +516,7 @@ if ($structure->permission == 'rw') {
}
// Aggiornamento
if (post('op')=='update') {
if (post('op') == 'update') {
$query = 'SELECT `zz_field_record`.`id_field` FROM `zz_field_record` JOIN `zz_fields` ON `zz_fields`.`id` = `zz_field_record`.`id_field` WHERE id_record = '.prepare($id_record).' AND '.$custom_where;
$customs_present = $dbo->fetchArray($query);
$customs_present = array_column($customs_present, 'id_field');

View File

@ -221,7 +221,7 @@ if (!API\Response::isAPIRequest()) {
// Impostazione del tema grafico di default
$theme = !empty($config['theme']) ? $config['theme'] : 'default';
if ($continue) {
// Periodo di visualizzazione dei record
// Personalizzato

View File

@ -336,9 +336,9 @@ if (Auth::check()) {
}
}
//Set the group theme
if (isset($user)){
if ($user->getThemeAttribute()){
// Set the group theme
if (isset($user)) {
if ($user->getThemeAttribute()) {
$theme = $user->getThemeAttribute();
}
}

View File

@ -26,9 +26,10 @@ $op = filter('op');
$microsoft = null;
try {
try {
$microsoft = $dbo->selectOne('zz_oauth2', '*', ['nome' => 'Microsoft', 'enabled' => 1, 'is_login' => 1]);
} catch (Exception $e) {}
} catch (Exception $e) {
}
// LOGIN
switch ($op) {
@ -179,15 +180,15 @@ echo ' required>
<button type="submit" class="btn btn-danger btn-block btn-flat">'.tr('Accedi').'</button>
<br>
<p><a href="'.base_path().'/reset.php">'.tr('Password dimenticata?').'</a></p>';
if ($microsoft) {
echo '
if ($microsoft) {
echo '
<div class="social-auth-links text-center">
<p>- oppure -</p>
<a href="'.base_path().'/oauth2_login.php?id='.$microsoft['id'].'" class="btn btn-block btn-social btn-primary btn-flat"><i class="fa fa-windows"></i>'.tr('Accedi con Microsoft').'</a>
</div>';
}
echo '
}
echo '
</div>
</div>
</form>

View File

@ -66,6 +66,7 @@ function settings_diff($expected, $current)
];
}
}
return $difference;
}
@ -222,9 +223,8 @@ if (!empty($results) || !empty($results_settings) || !empty($results_settings_ad
</table>';
}
}
}
if (!empty($results_settings)) {
echo '
<table class="table table-bordered">
@ -238,11 +238,11 @@ if (!empty($results) || !empty($results_settings) || !empty($results_settings_ad
</thead>
<tbody>';
foreach ($results_settings as $key => $setting) {
if (!$setting['current']) {
$class = 'danger';
} else {
$class = 'warning';
}
if (!$setting['current']) {
$class = 'danger';
} else {
$class = 'warning';
}
echo '
<tr class="bg-'.$class.'" >
<td>

View File

@ -82,7 +82,7 @@ switch (post('op')) {
});
} else {
$fattura = $documenti->first(function ($item, $key) use ($id_anagrafica) {
return $item->anagrafica->id == $id_anagrafica ;
return $item->anagrafica->id == $id_anagrafica;
});
}

View File

@ -81,7 +81,7 @@ switch (post('op')) {
});
} else {
$fattura = $documenti->first(function ($item, $key) use ($id_anagrafica) {
return $item->anagrafica->id == $id_anagrafica ;
return $item->anagrafica->id == $id_anagrafica;
});
}

View File

@ -234,7 +234,7 @@ if (!empty($id_sede_azienda)) {
</a>';
}
echo '
echo '
</div>
</div>
@ -367,9 +367,9 @@ if (!empty($id_sede_azienda)) {
if (!empty($record['idvettore'])) {
echo Modules::link('Anagrafiche', $record['idvettore'], null, null, 'class="pull-right"');
}
$esterno = $dbo->selectOne('dt_spedizione', 'esterno', [
'id' => $record['idspedizione'],
])['esterno'];
$esterno = $dbo->selectOne('dt_spedizione', 'esterno', [
'id' => $record['idspedizione'],
])['esterno'];
?>
{[ "type": "select", "label": "<?php echo tr('Vettore'); ?>", "name": "idvettore", "ajax-source": "vettori", "value": "$idvettore$", "disabled": <?php echo empty($esterno) || (!empty($esterno) && !empty($record['idvettore'])) ? 1 : 0; ?>, "required": <?php echo !empty($esterno) ?: 0; ?>, "icon-after": "add|<?php echo Modules::get('Anagrafiche')['id']; ?>|tipoanagrafica=Vettore&readonly_tipo=1|btn_idvettore|<?php echo ($esterno and (intval(!$record['flag_completato']) || empty($record['idvettore']))) ? '' : 'disabled'; ?>", "class": "<?php echo empty($record['idvettore']) ? 'unblockable' : ''; ?>" ]}
</div>

View File

@ -21,7 +21,7 @@ class Microsoft extends Azure implements ProviderInterface
'https://outlook.office.com/SMTP.Send',
// 'https://outlook.office.com/IMAP.AccessAsUser.All'
],
'accessType' => 'offline'
'accessType' => 'offline',
];
public function __construct(array $options = [], array $collaborators = [])

View File

@ -9,7 +9,6 @@ class MicrosoftLogin extends Azure implements ProviderInterface
/**
* Impostazioni native per la connessione.
*
*
* @var \string[][]
*/
protected static $options = [

View File

@ -279,7 +279,7 @@ $query .= ' ORDER BY descrizione';
<?php
}
echo '
echo '
<div class="col-md-'.($is_fiscale ? 2 : 6).'">
{[ "type": "select", "label": "'.tr('Stato').'", "name": "idstatodocumento", "required": 1, "values": "query='.$query.'", "value": "$idstatodocumento$", "class": "'.(($record['stato'] != 'Bozza' && !$abilita_genera) ? '' : 'unblockable').'", "extra": "onchange=\"return cambiaStato()\"" ]}
</div>
@ -498,7 +498,7 @@ if ($dir == 'entrata') {
{[ "type": "select", "label": "'.tr("Dichiarazione d'intento").'", "name": "id_dichiarazione_intento", "help": "'.tr('Elenco delle dichiarazioni d\'intento definite all\'interno dell\'anagrafica del cliente').'.", "ajax-source": "dichiarazioni_intento", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "data": "'.$record['data'].'"},"value": "$id_dichiarazione_intento$", "icon-after": "add|'.Modules::get('Anagrafiche')['id'].'|id_plugin='.Plugins::get('Dichiarazioni d\'Intento')['id'].'&id_parent='.$record['idanagrafica'].'", "extra": "'.((intval($block_edit)) ? 'disabled' : '').'" ]}
</div>';
}
echo '
echo '
</div>';
if ($dir == 'entrata') {

View File

@ -28,7 +28,7 @@ $richiesta = filter('richiesta');
$descrizione = filter('descrizione');
$id_tipo = filter('id_tipo');
$origine_dashboard = get('ref') == "dashboard" ? true : false;
$origine_dashboard = get('ref') == 'dashboard' ? true : false;
$module_anagrafiche = Modules::get('Anagrafiche');
$id_plugin_sedi = Plugins::get('Sedi')['id'];

View File

@ -143,7 +143,7 @@ if (!empty($sessioni)) {
// ORE
echo '
<td style="border-right:1px solid #aaa;">'.(((\Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_inizio'])->eq(\Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_fine']))) || (\Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_inizio'])->gt(\Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_fine'])))) ? '<i title="'.tr('Questa sessione non ha una durata valida.').'" class="fa fa-warning tip text-warning"></i>' : '').'
<td style="border-right:1px solid #aaa;">'.((Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_inizio'])->eq(Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_fine'])) || Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_inizio'])->gt(Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $sessione['orario_fine']))) ? '<i title="'.tr('Questa sessione non ha una durata valida.').'" class="fa fa-warning tip text-warning"></i>' : '').'
</td>
<td style="border-right:1px solid #aaa;">
{[ "type": "number", "name": "ore_'.$sessione['id'].'", "required": 1, "value": "'.numberFormat($ore, 'qta').'", "disabled": "1" ]}

View File

@ -337,27 +337,27 @@ echo '
<!-- RIGA 5 -->
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">';
echo input([
'type' => 'ckeditor',
'label' => tr('Richiesta'),
'name' => 'richiesta',
'id' => 'richiesta_add',
'required' => 1,
'value' => $record['richiesta'],
'extra' => 'style=\'max-height:80px;\'',
]);
echo '
echo input([
'type' => 'ckeditor',
'label' => tr('Richiesta'),
'name' => 'richiesta',
'id' => 'richiesta_add',
'required' => 1,
'value' => $record['richiesta'],
'extra' => 'style=\'max-height:80px;\'',
]);
echo '
</div>
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">';
echo input([
'type' => 'ckeditor',
'label' => tr('Descrizione'),
'name' => 'descrizione',
'id' => 'descrizione_add',
'value' => $record['descrizione'],
'extra' => 'style=\'max-height:80px;\'',
]);
echo '
echo input([
'type' => 'ckeditor',
'label' => tr('Descrizione'),
'name' => 'descrizione',
'id' => 'descrizione_add',
'value' => $record['descrizione'],
'extra' => 'style=\'max-height:80px;\'',
]);
echo '
</div>
</div>';
// Nascondo le note interne ai clienti
@ -592,7 +592,7 @@ if (!$block_edit) {
]).'</div>';
}
echo '
echo '
</div>
</div>

View File

@ -47,7 +47,7 @@ if (get('anteprima') !== null) {
</div>';
}
if ((setting('Sistema di firma') == 'Base') || isMobile() ){
if ((setting('Sistema di firma') == 'Base') || isMobile()) {
?>
<form action="<?php echo base_path(); ?>/editor.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>" method="post" id="form-firma" class="hide">
<input type="hidden" name="op" value="firma">

View File

@ -49,16 +49,16 @@ include_once __DIR__.'/../../core.php';
{[ "type": "text", "label": "<?php echo tr('Client Secret'); ?>", "name": "client_secret", "value": "$client_secret$" ]}
</div>
<?php
$config = $record['class']::getConfigInputs();
foreach ($config as $name => $field) {
$field['name'] = 'config['.$name.']';
$field['value'] = $oauth2->config[$name];
$config = $record['class']::getConfigInputs();
foreach ($config as $name => $field) {
$field['name'] = 'config['.$name.']';
$field['value'] = $oauth2->config[$name];
echo '
echo '
<div class="col-md-4">
'.input($field).'
</div>';
}
}
?>
</div>
</div>

View File

@ -21,9 +21,8 @@ use Models\OAuth2;
include_once __DIR__.'/../../core.php';
if (isset($id_record)) {
$record = $dbo->fetchOne('SELECT * FROM `zz_oauth2` WHERE id='.prepare($id_record));
$oauth2 = OAuth2::find($id_record);
$a=0;
$a = 0;
}

View File

@ -70,7 +70,7 @@ switch (post('op')) {
if (!empty($righe)) {
++$numero_totale;
// Ricerca fattura per anagrafica tra le registrate
// Ricerca fattura per anagrafica tra le registrate
$id_sede = $raggruppamento == 'sede' ? $documento_import->idsede : 0;
if ($raggruppamento == 'sede') {
$fattura = $documenti->first(function ($item, $key) use ($id_anagrafica, $id_sede) {
@ -78,7 +78,7 @@ switch (post('op')) {
});
} else {
$fattura = $documenti->first(function ($item, $key) use ($id_anagrafica) {
return $item->anagrafica->id == $id_anagrafica ;
return $item->anagrafica->id == $id_anagrafica;
});
}

View File

@ -79,7 +79,7 @@ switch (post('op')) {
});
} else {
$fattura = $documenti->first(function ($item, $key) use ($id_anagrafica) {
return $item->anagrafica->id == $id_anagrafica ;
return $item->anagrafica->id == $id_anagrafica;
});
}

View File

@ -99,7 +99,7 @@ $_SESSION['module_'.$record['id_module']]['id_segment'] = $previous_module;
</div>
<?php
}
echo '
echo '
<div class="row">
<div class="col-md-12">
{[ "type": "select", "label": "'.tr('Gruppi con accesso').'", "name": "gruppi[]", "multiple": "1", "values": "query=SELECT id, nome AS descrizione FROM zz_groups ORDER BY id ASC", "value": "';

View File

@ -394,7 +394,7 @@ switch (filter('op')) {
// Formattazione dei contenuti dello storico
foreach ($history as $key => $value) {
$history[$key]['size'] = (($history[$key]['size']) ? Filesystem::formatBytes($value['size']) : '-');
$history[$key]['size'] = (($history[$key]['size']) ? FileSystem::formatBytes($value['size']) : '-');
// $history[$key]['invoices_size'] = Filesystem::formatBytes($value['invoices_size']);
// $history[$key]['notifies_size'] = Filesystem::formatBytes($value['notifies_size']);
}
@ -408,8 +408,8 @@ switch (filter('op')) {
'maxNumber' => $max_number,
'avviso_numero' => $avviso_numero,
'avviso_spazio' => $avviso_spazio,
'spazio_totale' => Filesystem::formatBytes($spazio_totale),
'spazio_occupato' => Filesystem::formatBytes($informazioni['size']),
'spazio_totale' => FileSystem::formatBytes($spazio_totale),
'spazio_occupato' => FileSystem::formatBytes($informazioni['size']),
'history' => $history,
]);

View File

@ -26,24 +26,22 @@ $id_utente = filter('id_utente');
switch (filter('op')) {
// Aggiunta nuovo gruppo
case 'add':
$nome = filter('nome');
$id_module_start = filter('id_module_start') ?: null;
$theme = filter('theme') ?: null;
// Verifico che questo nome gruppo non sia già stato usato
if ($dbo->fetchNum('SELECT nome FROM zz_groups WHERE nome='.prepare($nome)) == 0) {
$dbo->insert('zz_groups', [
'nome' => $nome,
'id_module_start' => $id_module_start,
'theme' => $theme,
'editable' => 1,
$dbo->insert('zz_groups', [
'nome' => $nome,
'id_module_start' => $id_module_start,
'theme' => $theme,
'editable' => 1,
]);
$id_record = $dbo->lastInsertedID();
if ($id_module_start){
if ($id_module_start) {
$dbo->insert('zz_permissions', [
'idgruppo' => $id_record,
'idmodule' => $id_module_start,

View File

@ -59,7 +59,7 @@ if (empty($response['authorization_url'])) {
if (empty($_GET['error'])) {
if ($response['access_token']) {
$username = $account->getProvider()->getUser($response['access_token']);
if (!auth()->attempt($username, null, true)) {
flash()->error(tr('Autenticazione fallita!'));
}
@ -68,7 +68,6 @@ if (empty($_GET['error'])) {
redirect($redirect);
}
exit;
} else {
echo strip_tags($_GET['error']).'<br>'.strip_tags($_GET['error_description']).'

View File

@ -21,7 +21,6 @@ namespace Plugins\ExportFE;
use FluidXml\FluidXml;
use GuzzleHttp\Client;
use Modules;
use Modules\Anagrafiche\Anagrafica;
use Modules\Anagrafiche\Sede;
use Modules\Banche\Banca;
@ -43,7 +42,7 @@ class FatturaElettronica
/** @var Anagrafica Informazioni sull'anagrafica Cliente del documento */
protected $cliente = [];
/** @var Modules\Fatture\Fattura Informazioni sul documento */
/** @var Fattura Informazioni sul documento */
protected $documento;
/** @var Validator Oggetto dedicato alla validazione dell'XML */
@ -314,7 +313,7 @@ class FatturaElettronica
]));
// Aggiornamento effettivo
database()->update('co_documenti', [
$result=database()->update('co_documenti', [
'progressivo_invio' => $this->getDocumento()['progressivo_invio'],
'codice_stato_fe' => 'GEN',
'id_ricevuta_principale' => null,

View File

@ -101,7 +101,7 @@ class Auth extends Util\Singleton
*
* @param string $username
* @param string $password
* @param bool $force Forza il login solo tramite username (serve per l'autenticazione con Oauth2)
* @param bool $force Forza il login solo tramite username (serve per l'autenticazione con Oauth2)
*
* @return bool
*/

View File

@ -126,8 +126,8 @@ class FieldManager implements ManagerInterface
return $result;
}
public function getValue($options, $name) {
public function getValue($options, $name)
{
$database = database();
$query = 'SELECT `zz_fields`.*'.(isset($options['id_record']) ? ', `zz_field_record`.`value`' : '').' FROM `zz_fields`';
@ -156,4 +156,3 @@ class FieldManager implements ManagerInterface
return $results[0]['value'];
}
}

View File

@ -47,7 +47,7 @@ class OAuth2 extends Model
$config = $this->config ?? [];
$config = array_merge($config, [
'clientId' => $this->client_id,
'clientSecret' => $this->client_secret
'clientSecret' => $this->client_secret,
]);
$class = $this->class;