Compare commits

...

5 Commits

Author SHA1 Message Date
valentina e2fb7bf1da Fix minore 2024-09-10 12:40:20 +02:00
valentina 6a2420351a Formattazione codice 2024-09-10 12:38:16 +02:00
valentina fa8df5948f Fix visualizzazione ultimi movimenti in prima nota 2024-09-10 12:13:33 +02:00
valentina 9b82b68f0f Fix per anagrafica senza tipo 2024-09-10 12:07:00 +02:00
valentina 1e115cd27e Fix validatore 2024-09-10 09:35:40 +02:00
27 changed files with 68 additions and 66 deletions

View File

@ -515,9 +515,9 @@ if ($structure->permission == 'rw') {
foreach ($values as $key => $value) {
$name = $dbo->fetchOne('SELECT `name` FROM `zz_fields` WHERE `id` = '.prepare($key));
$custom_fields = new HTMLBuilder\Manager\FieldManager;
$custom_fields = new HTMLBuilder\Manager\FieldManager();
$campo = $custom_fields->getValue(['id_record' => $id_record, 'id_module' => $id_module], $name);
if (empty($campo)){
if (empty($campo)) {
$dbo->insert('zz_field_record', [
'id_record' => $id_record,
'id_field' => $key,

View File

@ -133,7 +133,7 @@ if (!empty($query)) {
// Formattazione HTML
if (empty($total['html_format'][$pos]) && !empty($value)) {
$value = strip_tags($value?:'');
$value = strip_tags($value ?: '');
}
// Formattazione automatica

View File

@ -457,8 +457,8 @@ if (Auth::check()) {
<!-- Main Sidebar Container -->
<aside class="main-sidebar '.$theme.' elevation-4">
<a href="'.tr('https://www.openstamanager.com').'" class="brand-link" title="'.tr("Il gestionale open source per l'assistenza tecnica e la fatturazione elettronica"). '" target="_blank">
<img src="'. $rootdir . '/assets/dist/img/logo_completo.png" class="brand-image" alt="'.tr("Il gestionale open source per l'assistenza tecnica e la fatturazione elettronica"). '">
<a href="'.tr('https://www.openstamanager.com').'" class="brand-link" title="'.tr("Il gestionale open source per l'assistenza tecnica e la fatturazione elettronica").'" target="_blank">
<img src="'.$rootdir.'/assets/dist/img/logo_completo.png" class="brand-image" alt="'.tr("Il gestionale open source per l'assistenza tecnica e la fatturazione elettronica").'">
<span class="brand-text font-weight-light">&nbsp;</span>
</a>

View File

@ -80,7 +80,7 @@ foreach ($logs as $log) {
<td>'.$log['username'].'</td>
<td class="tip" title="'.$created_at->format('d/m/Y H:i:s').'">'.$created_at->diffForHumans().'</td>
<td>'.$log['ip'].'</td>
<td class="user-agent tip" title="'.strip_tags($log['user_agent']?:'').'">'.$log['user_agent'].'</td>
<td class="user-agent tip" title="'.strip_tags($log['user_agent'] ?: '').'">'.$log['user_agent'].'</td>
<td><span class="badge badge-'.$type.'">'.$stato.'</span></td>
</tr>';
}

View File

@ -228,8 +228,8 @@ echo '
});
}';
if (!empty($template['indirizzi_proposti'])) {
echo '
if (!empty($template['indirizzi_proposti'])) {
echo '
$(document).load(globals.rootdir + "/modules/emails/ajax/complete.php?op=get_email&indirizzi_proposti='.$template['indirizzi_proposti'].'", function(response) {
emails = JSON.parse(response);
console.log(emails);
@ -240,7 +240,7 @@ echo '
aggiungiDestinatario();
});';
}
}
echo '
});

View File

@ -17,8 +17,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use Geocoder\Provider\GoogleMaps;
use Ivory\HttpAdapter\CurlHttpAdapter;
use Modules\Anagrafiche\Anagrafica;
use Modules\Anagrafiche\Export\CSV;
use Modules\Anagrafiche\Tipo;

View File

@ -38,8 +38,8 @@ if (!empty($id_record)) {
GROUP_CONCAT(`an_tipianagrafiche_lang`.`title`) AS tipianagrafica
FROM
`an_anagrafiche`
INNER JOIN `an_tipianagrafiche_anagrafiche` ON `an_anagrafiche`.`idanagrafica`=`an_tipianagrafiche_anagrafiche`.`idanagrafica`
INNER JOIN `an_tipianagrafiche` ON `an_tipianagrafiche`.`id`=`an_tipianagrafiche_anagrafiche`.`idtipoanagrafica`
LEFT JOIN `an_tipianagrafiche_anagrafiche` ON `an_anagrafiche`.`idanagrafica`=`an_tipianagrafiche_anagrafiche`.`idanagrafica`
LEFT JOIN `an_tipianagrafiche` ON `an_tipianagrafiche`.`id`=`an_tipianagrafiche_anagrafiche`.`idtipoanagrafica`
LEFT JOIN `an_tipianagrafiche_lang` ON (`an_tipianagrafiche`.`id`=`an_tipianagrafiche_lang`.`id_record` AND `an_tipianagrafiche_lang`.`id_lang`='.prepare(Models\Locale::getDefault()->id).')
LEFT JOIN `an_anagrafiche_agenti` ON `an_anagrafiche`.`idanagrafica`=`an_anagrafiche_agenti`.`idanagrafica`
WHERE

View File

@ -24,8 +24,8 @@ if (!function_exists('geolocalizzazione')) {
{
$dbo = database();
if( $is_sede ){
$sede = $dbo->table('an_sedi')->where('id',$id_record)->first();
if ($is_sede) {
$sede = $dbo->table('an_sedi')->where('id', $id_record)->first();
if (!empty($sede->indirizzo) && !empty($sede->citta) && !empty($sede->provincia) && empty($sede->lat) && empty($sede->lng)) {
$indirizzo = urlencode($sede->indirizzo.', '.$sede->citta.', '.$sede->provincia);
@ -34,6 +34,7 @@ if (!function_exists('geolocalizzazione')) {
if (!function_exists('curl_init')) {
// cURL non è attivo
flash()->error(tr('cURL non attivo, impossibile continuare l\'operazione.'));
return false;
} else {
$ch = curl_init();
@ -52,9 +53,9 @@ if (!function_exists('geolocalizzazione')) {
'gaddress' => $data[0]->display_name,
'lat' => $data[0]->lat,
'lng' => $data[0]->lon,
],['id' => $sede->id]);
], ['id' => $sede->id]);
}
}else{
} else {
$anagrafica = Anagrafica::find($id_record);
if (!empty($anagrafica->sedeLegale->indirizzo) && !empty($anagrafica->sedeLegale->citta) && !empty($anagrafica->sedeLegale->provincia) && empty($anagrafica->lat) && empty($anagrafica->lng)) {
$indirizzo = urlencode($anagrafica->sedeLegale->indirizzo.', '.$anagrafica->sedeLegale->citta.', '.$anagrafica->sedeLegale->provincia);
@ -63,6 +64,7 @@ if (!function_exists('geolocalizzazione')) {
if (!function_exists('curl_init')) {
// cURL non è attivo
flash()->error(tr('cURL non attivo, impossibile continuare l\'operazione.'));
return false;
} else {
$ch = curl_init();
@ -86,4 +88,4 @@ if (!function_exists('geolocalizzazione')) {
return true;
}
}
}

View File

@ -222,7 +222,7 @@ class Anagrafica extends Model
{
$this->fixRagioneSociale();
if( setting('Geolocalizzazione automatica') ){
if (setting('Geolocalizzazione automatica')) {
$this->geolocalizzazione();
}
@ -452,11 +452,12 @@ class Anagrafica extends Model
if (!empty($this->sedeLegale->indirizzo) && !empty($this->sedeLegale->citta) && !empty($this->sedeLegale->provincia)) {
$indirizzo = urlencode($this->sedeLegale->indirizzo.', '.$this->sedeLegale->citta.', '.$this->sedeLegale->provincia);
if( setting('Gestore mappa')=='OpenStreetMap' ){
if (setting('Gestore mappa') == 'OpenStreetMap') {
// TODO: da riscrivere con Guzzle e spostare su hook
if (!function_exists('curl_init')) {
// cURL non è attivo
flash()->error(tr('cURL non attivo, impossibile continuare l\'operazione.'));
return false;
} else {
$ch = curl_init();
@ -474,9 +475,9 @@ class Anagrafica extends Model
$this->gaddress = $data[0]->display_name;
$this->lat = $data[0]->lat;
$this->lng = $data[0]->lon;
}elseif( setting('Gestore mappa')=='Google Maps' ){
} elseif (setting('Gestore mappa') == 'Google Maps') {
$apiKey = setting('Google Maps API key per Tecnici');
$url = "https://maps.googleapis.com/maps/api/geocode/json?address=".$indirizzo."&key=".$apiKey;
$url = 'https://maps.googleapis.com/maps/api/geocode/json?address='.$indirizzo.'&key='.$apiKey;
$response = file_get_contents($url);
$data = json_decode($response, true);

View File

@ -20,8 +20,8 @@
namespace Modules\Anagrafiche;
use Common\SimpleModelTrait;
use Illuminate\Database\Eloquent\Model;
use Geocoder\Provider\GoogleMaps;
use Illuminate\Database\Eloquent\Model;
use Ivory\HttpAdapter\CurlHttpAdapter;
class Sede extends Model
@ -69,7 +69,7 @@ class Sede extends Model
{
$this->fixRappresentanteFiscale();
if( setting('Geolocalizzazione automatica') ){
if (setting('Geolocalizzazione automatica')) {
$this->geolocalizzazione();
}
@ -96,11 +96,12 @@ class Sede extends Model
if (!empty($this->indirizzo) && !empty($this->citta) && !empty($this->provincia) && empty($this->gaddress)) {
$indirizzo = urlencode($this->indirizzo.', '.$this->citta.', '.$this->provincia);
if( setting('Gestore mappa')=='OpenStreetMap' ){
if (setting('Gestore mappa') == 'OpenStreetMap') {
// TODO: da riscrivere con Guzzle e spostare su hook
if (!function_exists('curl_init')) {
// cURL non è attivo
flash()->error(tr('cURL non attivo, impossibile continuare l\'operazione.'));
return false;
} else {
$ch = curl_init();
@ -118,7 +119,7 @@ class Sede extends Model
$this->gaddress = $data[0]->display_name;
$this->lat = $data[0]->lat;
$this->lng = $data[0]->lon;
}elseif( setting('Gestore mappa')=='Google Maps' ){
} elseif (setting('Gestore mappa') == 'Google Maps') {
$curl = new CurlHttpAdapter();
$geocoder = new GoogleMaps($curl, 'IT-it', null, true, $google);

View File

@ -72,9 +72,9 @@ use Modules\Iva\Aliquota;
'name' => 'descrizione',
'required' => 1,
'value' => $articolo->getTranslation('title'),
'charcounter' => 1
])
?>
'charcounter' => 1,
]);
?>
</div>
</div>
@ -193,7 +193,7 @@ use Modules\Iva\Aliquota;
<div class="row">
<div class="col-md-12">
<?php echo (!empty($record['id_fornitore'])) ?
Plugins::link('Listino Fornitori', $id_record, null, null, 'class="pull-right" onclick="modificaFornitore('.$id_record.','.$record['id_fornitore'].')"') : ''; ?>
Plugins::link('Listino Fornitori', $id_record, null, null, 'class="pull-right" onclick="modificaFornitore('.$id_record.','.$record['id_fornitore'].')"') : ''; ?>
{[ "type": "select", "label": "<?php echo tr('Fornitore predefinito'); ?>", "name": "id_fornitore", "ajax-source": "fornitori-articolo", "select-options": <?php echo json_encode(['id_articolo' => $id_record]); ?>, "value":"$id_fornitore$", "help": "<?php echo tr('Fornitore predefinito selezionabile tra i fornitori presenti nel plugin \"Listino fornitori\"'); ?>." ]}
</div>
</div>

View File

@ -19,29 +19,28 @@
include_once __DIR__.'/../../../core.php';
$resource = ($resource ? $resource : $_GET['op']);
$resource = ($resource ?: $_GET['op']);
switch ($resource) {
// Elenco e-mail
case 'get_email':
$indirizzi_proposti = $_GET['indirizzi_proposti'];
$where = "";
$where = '';
if( $indirizzi_proposti==1 ) {
if ($indirizzi_proposti == 1) {
$where .= 'AND an_tipianagrafiche_lang.title = "Cliente"';
}elseif( $indirizzi_proposti==2 ) {
} elseif ($indirizzi_proposti == 2) {
$where .= 'AND an_tipianagrafiche_lang.title = "Fornitore"';
}
$results = [];
// Tutte le anagrafiche
$q = "SELECT DISTINCT(an_anagrafiche.email), an_anagrafiche.idanagrafica, an_anagrafiche.ragione_sociale FROM an_anagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche_anagrafiche.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN an_tipianagrafiche ON an_tipianagrafiche.id=an_tipianagrafiche_anagrafiche.idtipoanagrafica INNER JOIN an_tipianagrafiche_lang ON (an_tipianagrafiche_lang.id_lang=1 AND an_tipianagrafiche_lang.id_record=an_tipianagrafiche.id) WHERE email != '' ".$where." ORDER BY ragione_sociale";
// Tutte le anagrafiche
$q = "SELECT DISTINCT(an_anagrafiche.email), an_anagrafiche.idanagrafica, an_anagrafiche.ragione_sociale FROM an_anagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche_anagrafiche.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN an_tipianagrafiche ON an_tipianagrafiche.id=an_tipianagrafiche_anagrafiche.idtipoanagrafica INNER JOIN an_tipianagrafiche_lang ON (an_tipianagrafiche_lang.id_lang=1 AND an_tipianagrafiche_lang.id_record=an_tipianagrafiche.id) WHERE email != '' ".$where.' ORDER BY ragione_sociale';
$rs = $dbo->fetchArray($q);
foreach ($rs as $r) {
if( !empty($r['email']) ){
if (!empty($r['email'])) {
$results[] = [
'value' => $r['email'],
'label' => $r['ragione_sociale'].' <'.$r['email'].'>',
@ -49,8 +48,8 @@ switch ($resource) {
}
}
$q = "SELECT DISTINCT(an_sedi.email), an_sedi.idanagrafica, nomesede AS ragione_sociale FROM an_sedi INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica=an_sedi.idanagrafica INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche_anagrafiche.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN an_tipianagrafiche ON an_tipianagrafiche.id=an_tipianagrafiche_anagrafiche.idtipoanagrafica INNER JOIN an_tipianagrafiche_lang ON (an_tipianagrafiche_lang.id_lang=1 AND an_tipianagrafiche_lang.id_record=an_tipianagrafiche.id) WHERE an_sedi.email != '' ".$where." ORDER BY ragione_sociale";
$q = "SELECT DISTINCT(an_sedi.email), an_sedi.idanagrafica, nomesede AS ragione_sociale FROM an_sedi INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica=an_sedi.idanagrafica INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche_anagrafiche.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN an_tipianagrafiche ON an_tipianagrafiche.id=an_tipianagrafiche_anagrafiche.idtipoanagrafica INNER JOIN an_tipianagrafiche_lang ON (an_tipianagrafiche_lang.id_lang=1 AND an_tipianagrafiche_lang.id_record=an_tipianagrafiche.id) WHERE an_sedi.email != '' ".$where.' ORDER BY ragione_sociale';
$sedi = $dbo->fetchArray($q);
foreach ($sedi as $sede) {
$results[] = [
@ -59,7 +58,7 @@ switch ($resource) {
];
}
$q = "SELECT DISTINCT(an_referenti.email), an_referenti.idanagrafica, an_referenti.nome AS ragione_sociale FROM an_referenti INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica=an_referenti.idanagrafica INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche_anagrafiche.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN an_tipianagrafiche ON an_tipianagrafiche.id=an_tipianagrafiche_anagrafiche.idtipoanagrafica INNER JOIN an_tipianagrafiche_lang ON (an_tipianagrafiche_lang.id_lang=1 AND an_tipianagrafiche_lang.id_record=an_tipianagrafiche.id) WHERE an_referenti.email != '' ".$where." ORDER BY ragione_sociale";
$q = "SELECT DISTINCT(an_referenti.email), an_referenti.idanagrafica, an_referenti.nome AS ragione_sociale FROM an_referenti INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica=an_referenti.idanagrafica INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche_anagrafiche.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN an_tipianagrafiche ON an_tipianagrafiche.id=an_tipianagrafiche_anagrafiche.idtipoanagrafica INNER JOIN an_tipianagrafiche_lang ON (an_tipianagrafiche_lang.id_lang=1 AND an_tipianagrafiche_lang.id_record=an_tipianagrafiche.id) WHERE an_referenti.email != '' ".$where.' ORDER BY ragione_sociale';
$referenti = $dbo->fetchArray($q);
foreach ($referenti as $referente) {

View File

@ -64,10 +64,10 @@ if (!$record['predefined']) {
{[ "type": "text", "label": "<?php echo tr('Oggetto'); ?>", "name": "subject", "value": "$subject$" ]}
</div>
<div class="col-md-3">
{[ "type": "select", "label": "<?php echo tr('Proponi destinatari'); ?>", "name": "indirizzi_proposti", "value": "$indirizzi_proposti$", "values":"list=\"0\":\"<?php echo tr('Nessuno');?>\", \"1\":\"<?php echo tr('Clienti');?>\", \"2\":\"<?php echo tr('Fornitori');?>\", \"3\":\"<?php echo tr('Tutti');?>\" " ]}
{[ "type": "select", "label": "<?php echo tr('Proponi destinatari'); ?>", "name": "indirizzi_proposti", "value": "$indirizzi_proposti$", "values":"list=\"0\":\"<?php echo tr('Nessuno'); ?>\", \"1\":\"<?php echo tr('Clienti'); ?>\", \"2\":\"<?php echo tr('Fornitori'); ?>\", \"3\":\"<?php echo tr('Tutti'); ?>\" " ]}
</div>
<div class="col-md-3">
{[ "type": "select", "label": "<?php echo tr('Tipologia destinatari'); ?>", "name": "type", "value": "$type$", "values":"list=\"a\":\"<?php echo tr('A');?>\", \"cc\":\"<?php echo tr('CC');?>\", \"bcc\":\"<?php echo tr('CCN');?>\" ", "required":1 ]}
{[ "type": "select", "label": "<?php echo tr('Tipologia destinatari'); ?>", "name": "type", "value": "$type$", "values":"list=\"a\":\"<?php echo tr('A'); ?>\", \"cc\":\"<?php echo tr('CC'); ?>\", \"bcc\":\"<?php echo tr('CCN'); ?>\" ", "required":1 ]}
</div>
</div>

View File

@ -122,7 +122,7 @@ if (get('op') == 'getmappa') {
const lt = "41.706";
const ln = "13.228";
var container = L.DomUtil.get("mappa");
var esri_url = '<?php echo setting('Tile server satellite');?>';
var esri_url = '<?php echo setting('Tile server satellite'); ?>';
var esri_attribution = "© Esri © OpenStreetMap Contributors";
if(container._leaflet_id != null){
@ -143,7 +143,7 @@ if (get('op') == 'getmappa') {
attribution: "© OpenStreetMap"
});
var street = L.tileLayer('<?php echo setting('Tile server OpenStreetMap');?>', {
var street = L.tileLayer('<?php echo setting('Tile server OpenStreetMap'); ?>', {
maxZoom: 17,
attribution: "© OpenStreetMap",
}).addTo(map);

View File

@ -20,8 +20,8 @@
include_once __DIR__.'/../../core.php';
use Models\Module;
use Util\Query;
use Modules\Anagrafiche\Anagrafica;
use Util\Query;
switch (get('op')) {
case 'get_markers':

View File

@ -94,7 +94,7 @@ foreach ($rs_stati as $stato) {
var coords = [];
var circle = "";
var ROOTDIR = '<?php echo $rootdir; ?>';
var esri_url = '<?php echo setting('Tile server satellite');?>';
var esri_url = '<?php echo setting('Tile server satellite'); ?>';
var esri_attribution = "© Esri © OpenStreetMap Contributors";
function caricaMappa() {
@ -112,7 +112,7 @@ foreach ($rs_stati as $stato) {
attribution: "© OpenStreetMap"
});
var street = L.tileLayer('<?php echo setting('Tile server OpenStreetMap');?>', {
var street = L.tileLayer('<?php echo setting('Tile server OpenStreetMap'); ?>', {
maxZoom: 17,
attribution: "© OpenStreetMap",
}).addTo(map);

View File

@ -387,7 +387,7 @@ $(document).on("change", "[id*=dare], [id*=avere]", function() {
});
function visualizzaMovimenti(button) {
let id_conto = $(button).parent().parent().find("select").val();
let id_conto = $(button).parent().parent().parent().find("select").val();
openModal("'.tr('Ultimi 25 movimenti').'", "'.$module->fileurl('dettagli.php').'?id_module=" + globals.id_module + "&id_conto=" + id_conto);
}
</script>';

View File

@ -543,11 +543,11 @@ echo '
<div class="card-body">
<div class="row">
<div class="col-md-4">';
if ($_SESSION['superselect']['idanagrafica']) {
echo '
if ($_SESSION['superselect']['idanagrafica']) {
echo '
{["type": "select", "multiple": "1", "label": "'.tr('Tipi attività').'", "name": "idtipiintervento[]", "ajax-source": "tipiintervento", "value": "'.implode(',', (array) json_decode((string) $_SESSION['superselect']['idtipiintervento'])).'", "placeholder": "Tutti" ]}';
}
echo '
}
echo '
</div>
</div>

View File

@ -546,7 +546,7 @@ class Validator
*/
public function __construct(
/** @var string XML da validare */
protected $xml
protected $xml,
) {
}

View File

@ -31,9 +31,9 @@ if (!empty($id_record)) {
try {
$fattura_pa = FatturaElettronica::manage($record['name'] ?? '');
$anagrafica = $fattura_pa->findAnagrafica();
} catch (UnexpectedValueException $e) {
} catch (UnexpectedValueException) {
$imported = true;
} catch (Exception $e) {
} catch (Exception) {
$error = true;
}

View File

@ -214,7 +214,7 @@ class FatturaElettronica
} elseif (!empty($info['partita_iva'])) {
$anagrafica = Anagrafica::where('piva', '=', $info['partita_iva']);
}
if (!empty($anagrafica)) {
$anagrafica = $anagrafica->get()->first();
@ -223,7 +223,7 @@ class FatturaElettronica
if ($is_fornitore || $is_cliente) {
return $anagrafica;
}
}
}
}
@ -236,7 +236,7 @@ class FatturaElettronica
*/
public function saveAnagrafica($type = 'Fornitore')
{
$anagrafica = $this->findAnagrafica($type);
$anagrafica = $this->findAnagrafica();
if (!empty($anagrafica)) {
return $anagrafica;

View File

@ -19,8 +19,8 @@
include_once __DIR__.'/../../core.php';
use Modules\Anagrafiche\Sede;
use Modules\Anagrafiche\Anagrafica;
use Modules\Anagrafiche\Sede;
$operazione = filter('op');
@ -29,7 +29,7 @@ switch ($operazione) {
if (!empty(post('nomesede'))) {
$opt_out_newsletter = post('disable_newsletter_add');
$sede = Sede::build(Anagrafica::find($id_parent));
$sede->nomesede = post('nomesede');
$sede->indirizzo = post('indirizzo');
$sede->citta = post('citta');

View File

@ -80,7 +80,7 @@ class Upload extends Model
$original_name = $source['name'] ?? $name;
$category = $data['category'] ?? $category;
// Nome e categoria dell'allegato
$model->name = !empty($name) ? $name : $original_name;
$model->category = $category;

View File

@ -158,9 +158,10 @@ class Validate
// Indirizzo
$address = $data['result']['company_address'];
$info = explode(PHP_EOL, (string) $address);
$fields['indirizzo'] = $info[0];
$info = explode(' ', $info[1]);
$info = $info[1] ? explode(' ', $info[1]) : $info;
$fields['cap'] = $info[0];
$fields['provincia'] = end($info);

View File

@ -106,7 +106,7 @@ foreach ($righe as $riga) {
}
$r['descrizione'] = str_replace('Rif. '.strtolower((string) $key), '', $r['descrizione']);
preg_match("/Rif\.(.*)/s", $r['descrizione'], $rif2);
$r['descrizione'] = str_replace('Rif.'.strtolower($rif2[1]?:''), '', $r['descrizione']);
$r['descrizione'] = str_replace('Rif.'.strtolower($rif2[1] ?: ''), '', $r['descrizione']);
if (!empty($rif2)) {
$text .= '<b>'.$rif2[0].'</b>';
}

View File

@ -124,7 +124,7 @@ foreach ($righe as $riga) {
}
$r['descrizione'] = str_replace('Rif. '.strtolower((string) $key), '', $r['descrizione']);
preg_match("/Rif\.(.*)/s", $r['descrizione'], $rif2);
$r['descrizione'] = str_replace('Rif.'.strtolower($rif2[1]?: ''), '', $r['descrizione']);
$r['descrizione'] = str_replace('Rif.'.strtolower($rif2[1] ?: ''), '', $r['descrizione']);
if (!empty($rif2)) {
$text .= '<b>'.$rif2[0].'</b>';

View File

@ -87,4 +87,4 @@ if (get('lev') == '2' || get('lev') == '3') {
</table>';
}
echo '</tbody></table>';
echo '</tbody></table>';