diff --git a/modules/segmenti/edit.php b/modules/segmenti/edit.php index a96eb1de2..cc73dfcc7 100644 --- a/modules/segmenti/edit.php +++ b/modules/segmenti/edit.php @@ -85,7 +85,7 @@ if (str_contains($current_module['option'], '|segment|')) {
- {[ "type": "checkbox", "label": "", "name": "is_fiscale", "value": "$is_fiscale$" ]} + {[ "type": "checkbox", "label": "", "name": "is_fiscale", "value": "$is_fiscale$", "extra": " 0) ? 'readonly' : ''; ?>" ]}
@@ -138,13 +138,6 @@ $list = [ fetchArray('SELECT COUNT(*) AS tot FROM '.$table[0].' WHERE id_segment = '.prepare($id_record)); - $tot = $righe[0]['tot']; -} - if ($tot > 0) { echo "
"; diff --git a/modules/segmenti/init.php b/modules/segmenti/init.php index 0ab21eedf..5a4503536 100644 --- a/modules/segmenti/init.php +++ b/modules/segmenti/init.php @@ -4,4 +4,11 @@ include_once __DIR__.'/../../core.php'; if (isset($id_record)) { $record = $dbo->fetchOne('SELECT *, (SELECT options FROM zz_modules WHERE id = zz_segments.id_module) options, (SELECT name FROM zz_modules WHERE id = zz_segments.id_module) AS modulo, (SELECT COUNT(t.id) FROM zz_segments t WHERE t.id_module = zz_segments.id_module) AS n_sezionali FROM zz_segments WHERE id='.prepare($id_record)); + + + $array = preg_match('/(?<=FROM)\s([^\s]+)\s/', $record['options'], $table); + if (strpos($table[0], 'co_documenti') !== false) { + $righe = $dbo->fetchArray('SELECT COUNT(*) AS tot FROM '.$table[0].' WHERE id_segment = '.prepare($id_record)); + $tot = $righe[0]['tot']; + } } diff --git a/plugins/exportFE/src/Interaction.php b/plugins/exportFE/src/Interaction.php index c0d4f9bc9..b71f0ec2c 100644 --- a/plugins/exportFE/src/Interaction.php +++ b/plugins/exportFE/src/Interaction.php @@ -30,7 +30,7 @@ class Interaction return self::$client; } - public function isEnabled() + public static function isEnabled() { return false; } @@ -58,7 +58,7 @@ class Interaction $fattura = new FatturaElettronica($id_record); $file = DOCROOT.'/'.FatturaElettronica::getDirectory().'/'.$fattura->getFilename(); - $response = static::request('POST', 'send_fattura', [ + $response = static::request('POST', 'send', [ 'name' => $fattura->getFilename(), ], [ 'multipart' => [