Formattazione stile codice

This commit is contained in:
valentina 2024-08-27 09:20:20 +02:00
parent 2750b34dad
commit c2fe1ee872
39 changed files with 163 additions and 184 deletions

View File

@ -534,7 +534,7 @@ if (Auth::check()) {
}
if (!empty($opt)) {
$q = str_replace('|id_parent|', ($id_record?:$id_parent), $opt['main_query'][0]['query']);
$q = str_replace('|id_parent|', $id_record ?: $id_parent, $opt['main_query'][0]['query']);
$count = $dbo->fetchNum($q);
}

View File

@ -60,6 +60,7 @@ switch (post('op')) {
if (!function_exists('curl_init')) {
// cURL non è attivo
flash()->error(tr('cURL non attivo, impossibile continuare l\'operazione.'));
return false;
} else {
$ch = curl_init();

View File

@ -130,7 +130,7 @@ if (!empty($movimenti)) {
echo '
<tr>
<td class="text-center">
'.count($movimenti)-($i). '
'.count($movimenti) - $i.'
</td>
<td class="text-center" style="color: '.($movimento->qta < 0 ? 'red' : 'green').';">
'.numberFormat($movimento->qta, 'qta').' '.$record['um'].'

View File

@ -30,7 +30,6 @@ use Modules\DDT\DDT;
use Modules\DDT\Stato;
use Modules\DDT\Tipo;
use Modules\Iva\Aliquota;
use Modules\Ordini\Stato as StatoOrdine;
$module = Module::find($id_module);

View File

@ -785,18 +785,14 @@ switch (post('op')) {
foreach ($tecnici as $tecnico) {
$mail_tecnico = $dbo->selectOne('an_anagrafiche', '*', ['idanagrafica' => $tecnico]);
if (!empty($mail_tecnico['email'])) {
if (!empty($template)) {
$mail = Mail::build(auth()->getUser(), $template, $id_record);
$mail->addReceiver($mail_tecnico['email']);
$mail->save();
flash()->info(tr('Notifica al tecnico aggiunta correttamente.'));
}
}
}
}
}
} else {

View File

@ -21,53 +21,51 @@ include_once __DIR__.'/../../core.php';
if (get('op') == 'getmappa') {
$nome = 'Ricarica mappa';
}
else{
} else {
$nome = 'Visualizza mappa';
}
echo "<center><a onclick=\"location.href='".$rootdir."/controller.php?id_module=".$id_module."&op=getmappa&r='+Math.random()+'#tab_".Plugins::get('Mostra su mappa')['id']."';\" id='button' class='btn btn-primary btn-lg btn-large'>".$nome."</a></center>";
echo "<br>";
echo "<center><a onclick=\"location.href='".$rootdir.'/controller.php?id_module='.$id_module."&op=getmappa&r='+Math.random()+'#tab_".Plugins::get('Mostra su mappa')['id']."';\" id='button' class='btn btn-primary btn-lg btn-large'>".$nome.'</a></center>';
echo '<br>';
if (get('op') == 'getmappa') {
$current_module = Modules::get($id_module);
$total = Util\Query::readQuery($current_module);
$module_query = Modules::replaceAdditionals($id_module, $total['query']);
$search_filters = array();
$search_filters = [];
if (is_array($_SESSION['module_'.$id_module])) {
foreach ($_SESSION['module_'.$id_module] as $field_name => $field_value) {
if ($field_value != '' && $field_name != 'selected' && $field_name != 'id_segment') {
$field_name = str_replace( "search_", "", $field_name );
$field_name = str_replace( "__", " ", $field_name );
$field_name = str_replace( "-", " ", $field_name );
array_push( $search_filters, "`".$field_name."` LIKE \"%".$field_value."%\"" );
$field_name = str_replace('search_', '', $field_name);
$field_name = str_replace('__', ' ', $field_name);
$field_name = str_replace('-', ' ', $field_name);
array_push($search_filters, '`'.$field_name.'` LIKE "%'.$field_value.'%"');
}
}
}
if (sizeof($search_filters) > 0) {
$module_query = str_replace( "2=2", "2=2 AND (".implode( " AND ", $search_filters ).") ", $module_query);
$module_query = str_replace('2=2', '2=2 AND ('.implode(' AND ', $search_filters).') ', $module_query);
}
$rs1 = $dbo->fetchArray($module_query);
// marker svg
if (!file_exists($docroot.'/assets/dist/img/leaflet/place-marker.svg')) {
throw new Exception("File not found: " . $docroot.'/assets/dist/img/leaflet/place-marker.svg');
throw new Exception('File not found: '.$docroot.'/assets/dist/img/leaflet/place-marker.svg');
}
$svgContent = file_get_contents($docroot.'/assets/dist/img/leaflet/place-marker.svg');
if ($svgContent === false) {
throw new Exception("Error reading file: " . $docroot.'/assets/dist/img/leaflet/place-marker.svg');
throw new Exception('Error reading file: '.$docroot.'/assets/dist/img/leaflet/place-marker.svg');
}
$stringa_descrizioni = "";
$stringa_content = "";
$color = "";
$lat = "";
$lng = "";
for( $i=0; $i<sizeof($rs1); $i++ ){//elenco delle righe
$stringa_descrizioni = '';
$stringa_content = '';
$color = '';
$lat = '';
$lng = '';
for ($i = 0; $i < sizeof($rs1); ++$i) {// elenco delle righe
$val = html_entity_decode($rs1[$i]['idanagrafica']);
$id_sede = $dbo->selectOne('in_interventi', '*', ['id' => $rs1[$i]['id']])['idsede_destinazione'];
if ($id_sede) {
@ -82,21 +80,19 @@ include_once __DIR__.'/../../core.php';
$color .= "'".$rs1[$i]['_bg_']."',";
$lat .= "'".$rs[0]['lat']."',";
$lng .= "'".$rs[0]['lng']."',";
$stringa_descrizioni .= "'".str_replace("'", " ", $rs[0]['ragione_sociale'])."',";
$stringa_descrizioni .= "'".str_replace("'", ' ', $rs[0]['ragione_sociale'])."',";
$stringa_content .= "'";
$stringa_content .= str_replace("'", "", "<big><b>".$rs[0]['ragione_sociale']."</b></big><br>".$rs[0]['indirizzo'].", ".$rs[0]['cap'].", ".$rs[0]['citta']." (".$rs[0]['provincia'].")".($rs[0]['telefono']!=''? "<br><i class=\"fa fa-phone\"></i> &nbsp;".$rs[0]['telefono'] : "").($rs[0]['email']!=''? "<br><i class=\"fa fa-envelope\"></i> &nbsp;".$rs[0]['email'] : "")."<br>");
$stringa_content .= str_replace("'", '', '<big><b>'.$rs[0]['ragione_sociale'].'</b></big><br>'.$rs[0]['indirizzo'].', '.$rs[0]['cap'].', '.$rs[0]['citta'].' ('.$rs[0]['provincia'].')'.($rs[0]['telefono'] != '' ? '<br><i class="fa fa-phone"></i> &nbsp;'.$rs[0]['telefono'] : '').($rs[0]['email'] != '' ? '<br><i class="fa fa-envelope"></i> &nbsp;'.$rs[0]['email'] : '').'<br>');
$altri_interventi = $dbo->fetchArray('SELECT * FROM in_interventi WHERE idsede_destinazione='.prepare($id_sede).' AND idanagrafica='.prepare($val).' AND id IN ('.implode(',', array_column($rs1, 'id')).')');
for($j=0;$j<sizeof($altri_interventi);$j++){
$stringa_content .= str_replace("'", "", "<br> <a href=\"".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$altri_interventi[$j]['id']."\">Intervento numero: ".$altri_interventi[$j]['codice']." del ".date('d/m/Y', strtotime($altri_interventi[$j]['data_richiesta']))."</a>");
for ($j = 0; $j < sizeof($altri_interventi); ++$j) {
$stringa_content .= str_replace("'", '', '<br> <a href="'.$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$altri_interventi[$j]['id'].'">Intervento numero: '.$altri_interventi[$j]['codice'].' del '.date('d/m/Y', strtotime($altri_interventi[$j]['data_richiesta'])).'</a>');
}
$stringa_content .= "',";
}
}
echo "<div id='mappa'></div>";

View File

@ -24,8 +24,8 @@ use API\Interfaces\RetrieveInterface;
use API\Resource;
use Modules\Articoli\Articolo as ArticoloOriginale;
use Modules\Interventi\Components\Articolo;
use Modules\Interventi\Components\Riga;
use Modules\Interventi\Components\Descrizione;
use Modules\Interventi\Components\Riga;
use Modules\Interventi\Intervento;
class Righe extends Resource implements RetrieveInterface, CreateInterface
@ -124,5 +124,4 @@ class Righe extends Resource implements RetrieveInterface, CreateInterface
$riga->um = $data['um'] ?: null;
$riga->save();
}
}

View File

@ -384,7 +384,6 @@ switch (filter('op')) {
$spazio_totale = floatval($informazioni['maxSize']) * (1024 ** 2);
$avviso_spazio = !empty($spazio_totale) && floatval($informazioni['size']) > 0.9 * $spazio_totale;
$history = (array) $informazioni['history'];
// Restrizione storico agli ultimi 3 anni

View File

@ -19,7 +19,7 @@
include_once __DIR__.'/../../core.php';
$directory = Plugins\ImportFE\FatturaElettronica::getImportDirectory();
$directory = FatturaElettronica::getImportDirectory();
$filename = get('filename');
$content = file_get_contents($directory.'/'.$filename);

View File

@ -22,7 +22,6 @@ namespace HTMLBuilder\Manager;
use Models\Upload;
use Util\FileSystem;
/**
* Gestione allegati.
*

View File

@ -99,7 +99,6 @@ echo '
</tr>
</table>';
// Dati attività
echo '
<table class="table border-bottom">
@ -152,8 +151,6 @@ if (!empty($preventivo) or !empty($contratto)) {
</tr>';
}
// riga 3
// Elenco impianti su cui è stato fatto l'intervento
$rs2 = $dbo->fetchArray('SELECT *, (SELECT nome FROM my_impianti WHERE id=my_impianti_interventi.idimpianto) AS nome, (SELECT matricola FROM my_impianti WHERE id=my_impianti_interventi.idimpianto) AS matricola FROM my_impianti_interventi WHERE idintervento='.prepare($id_record));
@ -406,7 +403,6 @@ if (count($sessioni) > 0) {
'.$orario.'
</td>';
// Testo lavori eseguiti 1/2
if ($i == 0) {
echo '
@ -421,7 +417,6 @@ if (count($sessioni) > 0) {
<td rowspan="'.(count($sessioni) + 1).'" class="text-center" style="font-size:6pt; vertical-align:bottom; border-left:1px solid #aaa;">
'.$firma.'<br>';
if (empty($documento['firma_file'])) {
echo ' <i>('.tr('Timbro e firma leggibile').')</i>';
} else {
@ -435,7 +430,7 @@ if (count($sessioni) > 0) {
echo '
</tr>';
$i++;
++$i;
}
}
@ -463,7 +458,6 @@ if ($options['pricing']) {
<td colspan="3" class="text-center">-</td>';
}
// Testo lavori eseguiti 2/2
if (count($sessioni) == 0) {
echo '
@ -477,7 +471,6 @@ if (count($sessioni) == 1) {
echo '<td rowspan="2" class="text-center" style="font-size:6pt; vertical-align:bottom; border-left:1px solid #aaa;">
'.$firma.'<br>';
if (empty($documento['firma_file'])) {
echo ' <br><br><br><i>('.tr('Timbro e firma leggibile').')</i>';
} else {
@ -491,7 +484,6 @@ if (count($sessioni) == 1) {
echo '
</tr>';
// Totale km
echo '
<tr>
@ -526,7 +518,6 @@ if (count($sessioni) == 0) {
echo '<td class="text-center" style="font-size:6pt; vertical-align:bottom; border-left:1px solid #aaa;">
'.$firma.'<br>';
if (empty($documento['firma_file'])) {
echo ' <br><br><br><i>('.tr('Timbro e firma leggibile').')</i>';
} else {
@ -537,7 +528,6 @@ if (count($sessioni) == 0) {
</td>';
}
// Calcoli
$imponibile = abs($documento->imponibile);
$sconto = $documento->sconto;