From 42b41adba4720c373592c4599f3fc31a65b0dc5e Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Mon, 3 Sep 2018 17:28:43 +0200 Subject: [PATCH 1/6] Fix zip di release --- gulpfile.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 433bf4e3c..3ab6c0d84 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -292,11 +292,13 @@ gulp.task('release', function () { 'files/**', 'logs/**', 'config.inc.php', - '*.lock', - '*.phar', + '**/*.lock', + '**/*.phar', '**/*.log', '**/*.zip', '**/*.bak', + '**/*.jar', + '**/*.txt', '**/~*', ] }); From b0efc076211dfc70cdbe12eb873fef162b497076 Mon Sep 17 00:00:00 2001 From: loviuz <1647128+loviuz@users.noreply.github.com> Date: Mon, 3 Sep 2018 18:57:22 +0200 Subject: [PATCH 2/6] =?UTF-8?q?Rimossi=20link=20nel=20piano=20dei=20conti?= =?UTF-8?q?=20se=20non=20c'=C3=A8=20la=20fattura=20collegata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/partitario/edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/partitario/edit.php b/modules/partitario/edit.php index 49e319bcc..766a88966 100644 --- a/modules/partitario/edit.php +++ b/modules/partitario/edit.php @@ -115,7 +115,7 @@ for ($x = 0; $x < $n1; ++$x) { for ($i = 0; $i < sizeof($rs); ++$i) { echo " \n"; - if ($rs[$i]['iddocumento'] != '') { + if (!empty($rs[$i]['iddocumento'])) { $module = ($rs[$i]['dir'] == 'entrata') ? Modules::get('Fatture di vendita')['id'] : Modules::get('Fatture di acquisto')['id']; echo "".$rs[$i]['descrizione']."\n"; // echo " ".$rs[$i]['descrizione']."\n"; From 377998d7cee420cfd10427c94ff578bb927220b4 Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Tue, 4 Sep 2018 09:24:41 +0200 Subject: [PATCH 3/6] Aggiunto modulo per i campi personalizzati Miglioramento per #124. Aggiornamento della documentazione. --- couscous.yml | 46 +++++++++++++----------- docs/Aggiornamento.md | 2 +- docs/{ => base}/Assets.md | 0 docs/{ => base}/Framework.md | 0 docs/{ => more}/API.md | 0 docs/more/Extra.md | 20 +++++++++++ docs/{Struttura.md => more/Nucleo.md} | 35 +++---------------- docs/{ => more}/Upload.md | 0 docs/{ => structure}/Moduli.md | 0 docs/{ => structure}/Plugin.md | 0 docs/{ => structure}/Stampe.md | 0 docs/{ => structure}/Widget.md | 0 modules/custom_fields/actions.php | 46 ++++++++++++++++++++++++ modules/custom_fields/add.php | 37 ++++++++++++++++++++ modules/custom_fields/edit.php | 50 +++++++++++++++++++++++++++ modules/custom_fields/init.php | 10 ++++++ update/2_4_1.sql | 11 +++++- 17 files changed, 205 insertions(+), 52 deletions(-) rename docs/{ => base}/Assets.md (100%) rename docs/{ => base}/Framework.md (100%) rename docs/{ => more}/API.md (100%) create mode 100644 docs/more/Extra.md rename docs/{Struttura.md => more/Nucleo.md} (83%) rename docs/{ => more}/Upload.md (100%) rename docs/{ => structure}/Moduli.md (100%) rename docs/{ => structure}/Plugin.md (100%) rename docs/{ => structure}/Stampe.md (100%) rename docs/{ => structure}/Widget.md (100%) create mode 100644 modules/custom_fields/actions.php create mode 100644 modules/custom_fields/add.php create mode 100644 modules/custom_fields/edit.php create mode 100644 modules/custom_fields/init.php diff --git a/couscous.yml b/couscous.yml index 5b1cb275a..0dacef4f1 100644 --- a/couscous.yml +++ b/couscous.yml @@ -15,7 +15,7 @@ github: title: OpenSTAManager subTitle: Il software gestionale open-source per l'assistenza tecnica e la fatturazione fontAwesomeIcon: fa fa-cog -footerText: 'Progettato e sviluppato da DevCode.' +footerText: 'Progettato e sviluppato da DevCode.' googleAnalyticsCode: UA-42808312-1 scripts: @@ -37,43 +37,49 @@ menu: aggiornamento: text: Aggiornamento relativeUrl: aggiornamento.html - api: - text: API - relativeUrl: api.html contribuire: text: Contribuire relativeUrl: contributing.html structure: - name: Approfondimenti + name: Strutture items: - struttura: - text: Struttura - relativeUrl: struttura.html moduli: text: Moduli - relativeUrl: moduli.html - upload: - text: Gestione degli upload - relativeUrl: upload.html - widget: + relativeUrl: structure/moduli.html + plugin: text: Plugin - relativeUrl: widget.html + relativeUrl: structure/plugin.html stampe: text: Stampe - relativeUrl: stampe.html + relativeUrl: structure/stampe.html widget: text: Widget - relativeUrl: widget.html - custom: + relativeUrl: structure/widget.html + more: + name: Approfondimenti + items: + nucleo: + text: Nucleo + relativeUrl: more/nucleo.html + upload: + text: Upload + relativeUrl: more/upload.html + extra: + text: Extra + relativeUrl: more/extra.html + api: + text: API + relativeUrl: more/api.html + base: name: Personalizzazione items: framework: text: Framework - relativeUrl: framework.html + relativeUrl: base/framework.html assets: text: Assets - relativeUrl: assets.html - more: + relativeUrl: base/assets.html + links: name: Link utili items: docs: diff --git a/docs/Aggiornamento.md b/docs/Aggiornamento.md index bdfe54336..4841c2a93 100644 --- a/docs/Aggiornamento.md +++ b/docs/Aggiornamento.md @@ -85,5 +85,5 @@ Per reimpostare la password di un account amministrativo è possibile procedere - Se esiste un altro account amministrativo, seguire la procedura precedente per gli account comuni; - Accedere al database ed eseguire la seguente query: ```sql - UPDATE `zz_utenti` SET password = MD5('nuova_password') WHERE username = 'admin'; + UPDATE `zz_users` SET `password` = MD5('nuova_password') WHERE `username` = 'admin'; ``` diff --git a/docs/Assets.md b/docs/base/Assets.md similarity index 100% rename from docs/Assets.md rename to docs/base/Assets.md diff --git a/docs/Framework.md b/docs/base/Framework.md similarity index 100% rename from docs/Framework.md rename to docs/base/Framework.md diff --git a/docs/API.md b/docs/more/API.md similarity index 100% rename from docs/API.md rename to docs/more/API.md diff --git a/docs/more/Extra.md b/docs/more/Extra.md new file mode 100644 index 000000000..2ba55dbe8 --- /dev/null +++ b/docs/more/Extra.md @@ -0,0 +1,20 @@ +--- +currentMenu: extra +--- + +# Extra + + + +- [Campi personalizzati](#campi-personalizzati) + + + +## Campi personalizzati + +A partire dalla versione 2.4 è possibile sfruttare dei campi personalizzati per aggiungere informazioni ai moduli principali in modo dinamico. + +Questi campi sono gestiti a livello di database attarverso le tabelle `zz_fields` e `zz_field_record`, che si occupano riespettivamente della gestione generale dei campi e del salvataggio dei record personalizzati. +Le procedure automatiche di gestione di questi campi sono integrate nei file `actions.php`, `editor.php` e `add.php`. + +E' eventualmente disponibile il modulo **Campi personalizzati**, da abilitare, per la gestione dinamica di queste informazioni. diff --git a/docs/Struttura.md b/docs/more/Nucleo.md similarity index 83% rename from docs/Struttura.md rename to docs/more/Nucleo.md index ff89f053c..e718c3347 100644 --- a/docs/Struttura.md +++ b/docs/more/Nucleo.md @@ -1,21 +1,17 @@ --- -currentMenu: struttura +currentMenu: nucleo --- # Struttura -- [Caratteristiche](#caratteristiche) - - [open-source](#open-source) - - [Modulare e personalizzabile](#modulare-e-personalizzabile) - - [Multipiattaforma e user friendly](#multipiattaforma-e-user-friendly) - [Struttura](#struttura) - [Root](#root) - [add.php](#addphp) - - [ajax_complete.php](#ajax_completephp) - - [ajax_dataload.php](#ajax_dataloadphp) - - [ajax_select.php](#ajax_selectphp) + - [ajax_complete.php](#ajaxcompletephp) + - [ajax_dataload.php](#ajaxdataloadphp) + - [ajax_select.php](#ajaxselectphp) - [bug.php](#bugphp) - [core.php](#corephp) - [config.inc.php](#configincphp) @@ -42,34 +38,13 @@ currentMenu: struttura - [Cartella modules](#cartella-modules) - [Cartella templates](#cartella-templates) - [Cartella update](#cartella-update) - - [create_updates.sql](#create_updatessql) + - [create_updates.sql](#createupdatessql) - [VERSIONE.sql](#versionesql) - [VERSIONE.php](#versionephp) - [Cartella vendor](#cartella-vendor) -## Caratteristiche - -### open-source - -La natura open-source (termine inglese che significa _sorgente aperta_) del progetto evidenzia lo spirito di collaborazione e condivisione che pervade l'attività di sviluppo del gestionale, di cui gli autori rendono pubblico il codice sorgente e ne favoriscono il libero studio, permettendo a programmatori indipendenti di apportarvi modifiche ed estensioni. - -Particolarmente espressiva in questo senso risulta essere la documentazione ufficiale del progetto: - -> Il progetto è un software open-source perché permette agli utilizzatori di studiarne il funzionamento ed adattarlo alle proprie esigenze; inoltre, in ambito commerciale, non obbliga l'utilizzatore ad essere legato allo stesso fornitore di assistenza. - -La licenza in utilizzo è la GNU General Public License 3.0 (GPL 3.0). - -### Modulare e personalizzabile - -OpenSTAManager possiede una struttura fortemente modulare, che ne permette la rapida espandibilità e, nello specifico, la realizzazione di funzionalità _ad hoc_, personalizzate nel modo più completo secondo le richieste del cliente. - -### Multipiattaforma e user friendly - -Il progetto risulta compatibile con numerose piattaforme, necessitando esclusivamente un browser moderno da parte dei suoi utilizzatori per sfruttare appieno le sue potenzialità. -L'interfaccia di interazione con l'utente finale risulta inoltre estremamente semplificata e _user friendly_, oltre che _responsive_, presentando caratteristiche completamente compatibili con tutti i dispositivi mobili (in particolare, tablet e smartphone). - ## Struttura Scaricando la versione GIT del progetto dovreste trovare una struttura di base molto simile a quella seguente. diff --git a/docs/Upload.md b/docs/more/Upload.md similarity index 100% rename from docs/Upload.md rename to docs/more/Upload.md diff --git a/docs/Moduli.md b/docs/structure/Moduli.md similarity index 100% rename from docs/Moduli.md rename to docs/structure/Moduli.md diff --git a/docs/Plugin.md b/docs/structure/Plugin.md similarity index 100% rename from docs/Plugin.md rename to docs/structure/Plugin.md diff --git a/docs/Stampe.md b/docs/structure/Stampe.md similarity index 100% rename from docs/Stampe.md rename to docs/structure/Stampe.md diff --git a/docs/Widget.md b/docs/structure/Widget.md similarity index 100% rename from docs/Widget.md rename to docs/structure/Widget.md diff --git a/modules/custom_fields/actions.php b/modules/custom_fields/actions.php new file mode 100644 index 000000000..a214b82a6 --- /dev/null +++ b/modules/custom_fields/actions.php @@ -0,0 +1,46 @@ +update('zz_fields', [ + 'id_module' => $module, + 'id_plugin' => $plugin, + 'name' => post('name'), + 'html_name' => post('html_name'), + 'content' => post('content'), + 'on_add' => post('on_add'), + 'top' => post('top'), + ], ['id' => $id_record]); + + $_SESSION['infos'][] = tr('Salvataggio completato!'); + + break; + + case 'add': + $plugin = post('plugin_id') ?: null; + $module = $plugin ? null : post('module_id'); + + $dbo->insert('zz_fields', [ + 'id_module' => $module, + 'id_plugin' => $plugin, + 'name' => post('name'), + 'content' => post('content'), + 'html_name' => secure_random_string(8), + ]); + $id_record = $dbo->lastInsertedID(); + + $_SESSION['infos'][] = tr('Nuovo campo personalizzato creato!'); + + break; + + case 'delete': + $dbo->delete('zz_fields', ['id' => $id_record]); + $dbo->delete('zz_field_record', ['id_field' => $id_record]); + + break; +} diff --git a/modules/custom_fields/add.php b/modules/custom_fields/add.php new file mode 100644 index 000000000..a47fa486c --- /dev/null +++ b/modules/custom_fields/add.php @@ -0,0 +1,37 @@ +
+ + + +
+
+ {[ "type": "select", "label": "", "name": "module_id", "values": "query=SELECT id, name as text FROM zz_modules WHERE enabled = 1" ]} +
+ +
+ {[ "type": "select", "label": "", "name": "plugin_id", "values": "query=SELECT id, name as text FROM zz_plugins WHERE enabled = 1" ]} +
+
+ +
+
+ {[ "type": "text", "label": "", "name": "name", "required": 1 ]} +
+
+ +
+
+ {[ "type": "textarea", "label": "", "name": "content", "required": 1, "value": "$content$" ]} +
+
+ + +
+
+ +
+
+
diff --git a/modules/custom_fields/edit.php b/modules/custom_fields/edit.php new file mode 100644 index 000000000..aaaeabf4e --- /dev/null +++ b/modules/custom_fields/edit.php @@ -0,0 +1,50 @@ + +
+ + + + +
+
+ {[ "type": "select", "label": "", "name": "module_id", "values": "query=SELECT id, name as text FROM zz_modules WHERE enabled = 1", "value": "$id_module$" ]} +
+ +
+ {[ "type": "select", "label": "", "name": "plugin_id", "values": "query=SELECT id, name as text FROM zz_plugins WHERE enabled = 1", "value": "$id_plugin$" ]} +
+
+ +
+
+ {[ "type": "text", "label": "", "name": "name", "required": 1, "value": "$name$" ]} +
+ +
+ {[ "type": "text", "label": "", "name": "html_name", "required": 1, "value": "$html_name$" ]} +
+
+ +
+
+ {[ "type": "checkbox", "label": "", "name": "on_add","value": "$on_add$" ]} +
+ +
+ {[ "type": "checkbox", "label": "", "name": "top", "value": "$top$" ]} +
+
+ +
+
+ {[ "type": "textarea", "label": "", "name": "content", "required": 1, "value": "$content$" ]} +
+
+
+ + + + diff --git a/modules/custom_fields/init.php b/modules/custom_fields/init.php new file mode 100644 index 000000000..7193f6a53 --- /dev/null +++ b/modules/custom_fields/init.php @@ -0,0 +1,10 @@ +fetchArray('SELECT * FROM zz_fields WHERE id='.prepare($id_record)); +} + + +// TODO: prevedere un utilizzo pratico del campo options diff --git a/update/2_4_1.sql b/update/2_4_1.sql index 6c5af9e6b..193a1ee7a 100644 --- a/update/2_4_1.sql +++ b/update/2_4_1.sql @@ -490,10 +490,19 @@ UPDATE `zz_prints` SET `enabled` = 0 WHERE `name` IN( 'Ordine di servizio', 'Ord UPDATE `zz_views` SET `query` = '\'Intervento\'' WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi') AND `name` = '_print_'; -- Flag per definire i segmenti di note di accredito e di addebito -ALTER TABLE `zz_segments` ADD `predefined_accredito` TINYINT(1) NOT NULL AFTER `predefined`, ADD `predefined_addebito` TINYINT(1) NOT NULL AFTER `predefined_accredito`; +ALTER TABLE `zz_segments` ADD `predefined_accredito` TINYINT(1) NOT NULL AFTER `predefined`, ADD `predefined_addebito` TINYINT(1) NOT NULL AFTER `predefined_accredito`; -- Fattura di vendita senza intestazione (per carta intestata) INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `main`, `default`, `enabled`) VALUES (NULL, (SELECT id FROM zz_modules WHERE name='Fatture di vendita'), 1, 'Fattura di vendita (senza intestazione)', 'Fattura di vendita (senza intestazione)', 'fatture', 'iddocumento', '{"hide_header":true, "hide_footer":true}', 'fa fa-print', '', '', 0, 0, 1, 1); UPDATE `zz_prints` SET `main` = '1' WHERE `name` = 'Fattura di vendita'; +-- Innesto modulo per campi personalizzati +INSERT INTO `zz_modules` (`id`, `name`, `title`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`) VALUES (NULL, 'Campi personalizzati', 'Campi personalizzati', 'custom_fields', 'SELECT |select| FROM `zz_fields` WHERE 1=1 HAVING 2=2', '', 'fa fa-list', '2.4.1', '2.4.1', '1', NULL, '1', '0'); +UPDATE `zz_modules` `t1` INNER JOIN `zz_modules` `t2` ON (`t1`.`name` = 'Campi personalizzati' AND `t2`.`name` = 'Strumenti') SET `t1`.`parent` = `t2`.`id`; + +INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `enabled`, `summable`, `default`) VALUES +(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Campi personalizzati'), 'id', 'id', 0, 0, 0, 0, 0, 0, 1), +(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Campi personalizzati'), 'Modulo', '(SELECT name FROM zz_modules WHERE zz_modules.id = zz_fields.id_module)', 0, 1, 0, 0, 1, 0, 1), +(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Campi personalizzati'), 'Plugin', '(SELECT name FROM zz_plugins WHERE zz_plugins.id = zz_fields.id_plugin)', 0, 1, 0, 0, 1, 0, 1), +(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Campi personalizzati'), 'Nome', 'name', 0, 1, 0, 0, 1, 0, 1); From 9509355260ad4f1df91665fe343d626f26bc950f Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Tue, 4 Sep 2018 10:03:02 +0200 Subject: [PATCH 4/6] Miglioramenti distribuiti --- lib/util.php | 28 ++++++++++++++++++++++++ modules/articoli/import.php | 13 +----------- modules/custom_fields/edit.php | 39 +++++++++++++++++++++++++++++++++- modules/import/actions.php | 3 +++ modules/import/edit.php | 2 +- src/Import.php | 11 +++++++++- 6 files changed, 81 insertions(+), 15 deletions(-) diff --git a/lib/util.php b/lib/util.php index fd3686934..7d337e513 100644 --- a/lib/util.php +++ b/lib/util.php @@ -69,6 +69,34 @@ if (!function_exists('str_contains')) { } } +if (!function_exists('str_to_lower')) { + /** + * Converts a string in the lower-case version. + * + * @param string $string + * + * @return bool + */ + function str_to_lower($string) + { + return S::create($string)->toLowerCase(); + } +} + +if (!function_exists('str_to_upper')) { + /** + * Converts a string in the upper-case version. + * + * @param string $string + * + * @return bool + */ + function str_to_upper($string) + { + return S::create($string)->toUpperCase(); + } +} + if (!function_exists('random_string')) { /** * Generates a string of random characters. diff --git a/modules/articoli/import.php b/modules/articoli/import.php index 6117a66c9..b0510e0ea 100644 --- a/modules/articoli/import.php +++ b/modules/articoli/import.php @@ -123,8 +123,6 @@ return [ 'names' => [ 'Unità di misura', 'Unità misura', - 'unità misura', - 'unità di misura', 'Unit` di misura', 'um', ], @@ -132,18 +130,10 @@ return [ [ 'field' => 'prezzo_acquisto', 'label' => 'Prezzo acquisto', - 'names' => [ - 'Prezzo Acquisto', - 'prezzo acquisto', - ], ], [ 'field' => 'prezzo_vendita', 'label' => 'Prezzo vendita', - 'names' => [ - 'Prezzo Vendita', - 'prezzo vendita', - ], ], [ 'field' => 'peso_lordo', @@ -158,7 +148,7 @@ return [ 'label' => 'Volume (M3)', 'names' => [ 'Volume (M3)', - 'volume', + 'Volume', ], ], [ @@ -168,7 +158,6 @@ return [ 'Categoria', 'id_categoria', 'idcategoria', - 'categoria', ], ], [ diff --git a/modules/custom_fields/edit.php b/modules/custom_fields/edit.php index aaaeabf4e..7502b091d 100644 --- a/modules/custom_fields/edit.php +++ b/modules/custom_fields/edit.php @@ -8,7 +8,7 @@ include_once __DIR__.'/../../core.php'; -
+
{[ "type": "select", "label": "", "name": "module_id", "values": "query=SELECT id, name as text FROM zz_modules WHERE enabled = 1", "value": "$id_module$" ]}
@@ -45,6 +45,43 @@ include_once __DIR__.'/../../core.php';
+ +
+
+

tr('Contenuto'), + ]); ?>

+
+ +
+

:

+
    + tr('Nome'), + 'html_name' => tr('Nome HTML'), +]; + +foreach ($list as $key => $value) { + echo ' +
  • '.tr('_TEXT_ con il valore del campo "_FIELD_"', [ + '_TEXT_' => '|'.$key.'|', + '_FIELD_' => $value, + ]).'
  • '; +} + +echo ' +
  • '.tr('_TEXT_ con il valore impostato per il record', [ + '_TEXT_' => '|value', + ]).'
  • '; + +?> +
+
+
+ +
+ diff --git a/modules/import/actions.php b/modules/import/actions.php index f6cc18e5b..b3789b2b7 100644 --- a/modules/import/actions.php +++ b/modules/import/actions.php @@ -20,6 +20,9 @@ switch (post('op')) { 'headers' => $first_row, ]); + // Gestione automatica dei valori convertiti + $csv = Filter::parse($csv); + // Interpretazione dei dati $data = []; foreach ($csv as $row) { diff --git a/modules/import/edit.php b/modules/import/edit.php index a479a6560..916f747d4 100644 --- a/modules/import/edit.php +++ b/modules/import/edit.php @@ -65,7 +65,7 @@ if (empty($id_record)) { // Individuazione delle corrispondenze $selected = null; foreach ($fields as $key => $value) { - if (in_array($rows[0][$column], $value['names'])) { + if (in_array(str_to_lower($rows[0][$column]), $value['names'])) { $first_row = 1; $selected = $key; break; diff --git a/src/Import.php b/src/Import.php index 9cedc55a0..86e02a021 100644 --- a/src/Import.php +++ b/src/Import.php @@ -77,11 +77,20 @@ class Import // Impostazione automatica dei nomi "ufficiali" dei campi foreach ($fields as $key => $value) { if (!isset($value['names'])) { - $fields[$key]['names'] = [ + $names = [ $value['field'], $value['label'], ]; + } else { + $names = $value['names']; } + + // Impostazione dei nomi in minuscolo + foreach ($names as $k => $v) { + $names[$k] = str_to_lower($v); + } + + $fields[$key]['names'] = $names; } return $fields; From 4fd9f1e57ecb6db3817ee7b0d090588e3828590d Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Tue, 4 Sep 2018 10:14:42 +0200 Subject: [PATCH 5/6] Miglioramento istruzione di autocompletamento --- modules/custom_fields/edit.php | 4 +- modules/emails/edit.php | 31 +++++++---- modules/segmenti/edit.php | 97 ++++++++++++++++++---------------- 3 files changed, 75 insertions(+), 57 deletions(-) diff --git a/modules/custom_fields/edit.php b/modules/custom_fields/edit.php index 7502b091d..6b2e90d74 100644 --- a/modules/custom_fields/edit.php +++ b/modules/custom_fields/edit.php @@ -45,7 +45,7 @@ include_once __DIR__.'/../../core.php';
- +

$value) { echo '
  • '.tr('_TEXT_ con il valore impostato per il record', [ - '_TEXT_' => '|value', + '_TEXT_' => '|value|', ]).'
  • '; ?> diff --git a/modules/emails/edit.php b/modules/emails/edit.php index 529f28f63..e5a7489af 100644 --- a/modules/emails/edit.php +++ b/modules/emails/edit.php @@ -88,27 +88,38 @@ echo ' // Variabili utilizzabili $variables = include Modules::filepath($records[0]['id_module'], 'variables.php'); -if (sizeof($variables) > 0) { +echo ' + +
    +
    +

    '.tr('Istruzioni per i campi automatici').'

    +
    + +
    '; + +if (!empty($variables)) { echo ' -
    -

    '.tr("Puoi utilizzare le seguenti variabili nell'oggetto e nel corpo della mail").':

    -
      '; +

      '.tr("Puoi utilizzare le seguenti sequenze di testo nell'oggetto e nel corpo della mail").':

      +
        '; foreach ($variables as $variable => $value) { echo ' -
      • {'.$variable.'}
      • '; +
      • {'.$variable.'}
      • '; } echo ' -
      -
    '; + '; } else { echo ' -
    - '.tr('Non sono state definite variabili da utilizzare nel template').'. -
    '; +

    '.tr('Non sono state definite variabili da utilizzare nel template').'.

    '; } +echo ' +
    +
    + +
    '; + ?>

    diff --git a/modules/segmenti/edit.php b/modules/segmenti/edit.php index 9fa0865dd..69ccbb025 100644 --- a/modules/segmenti/edit.php +++ b/modules/segmenti/edit.php @@ -30,9 +30,9 @@ include_once __DIR__.'/../../core.php'; ?> {[ "type": "checkbox", "label": "", "name": "predefined", "value": "$predefined$", "help": "", "placeholder": "", "extra": "" ]}
    - + - +
    @@ -64,7 +64,6 @@ include_once __DIR__.'/../../core.php';
    -
    @@ -73,43 +72,44 @@ include_once __DIR__.'/../../core.php';
    -fetchArray('SELECT COUNT(*) AS tot FROM '.$table[0].' WHERE id_segment = '.prepare($id_record)); - $tot = $righe[0]['tot']; -} -?>
    {[ "type": "text", "label": "", "name": "pattern", "required": 0, "class": "alphanumeric-mask", "value": "$pattern$", "maxlength": 25, "placeholder":"####/YY", "extra": " 0) ? 'readonly' : ''; ?>" ]}
    -
    -
    + +
    +
    +

    tr('Maschera'), + ]); ?>

    +
    -
    -

    tr('Maschera'), - ]); ?>

    +
    +

    :

    +
      + tr('Numero progressivo del documento, con zeri non significativi per raggiungere il numero desiderato di caratteri'), + 'YYYY' => tr('Anno corrente a 4 cifre'), + 'yy' => tr('Anno corrente a 2 cifre'), +]; -

      #### .

      +foreach ($list as $key => $value) { + echo ' +
    • '.tr('_TEXT_: _FIELD_', [ + '_TEXT_' => ''.$key.'', + '_FIELD_' => $value, + ]).'
    • '; +} -

      YYYY 'yy', - ]); ?>.

      - -

      '####', - '_YYYY_' => 'YYYY', - ]); ?>.

      -

      -
    - -
    -
    +?> + +

    .

    +
    +
    @@ -117,35 +117,42 @@ if (strpos($table[0], 'co_documenti') !== false) { 0) { - echo "
    "; - echo tr("Ci sono _TOT_ righe collegate al segmento per il modulo '_MODULO_'. Il comando elimina è stato disattivato, eliminare le righe per attivare il comando 'Elimina segmento'.", [ +$array = preg_match('/(?<=FROM)\s([^\s]+)\s/', $records[0]['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']; +} + +if ($tot > 0) { + echo "
    "; + + echo tr("Ci sono _TOT_ righe collegate al segmento per il modulo '_MODULO_'. Il comando elimina è stato disattivato, eliminare le righe per attivare il comando 'Elimina segmento'.", [ '_TOT_' => $tot, '_MODULO_' => $records[0]['modulo'], ]); - echo '
    '; - } elseif ($records[0]['predefined']) { - echo "
    "; + echo '
    '; +} elseif ($records[0]['predefined']) { + echo "
    "; - echo tr("Questo è il segmento predefinito per il modulo '_MODULO_'. Il comando elimina è stato disattivato.", [ + echo tr("Questo è il segmento predefinito per il modulo '_MODULO_'. Il comando elimina è stato disattivato.", [ '_MODULO_' => $records[0]['modulo'], ]); - echo '
    '; - } elseif ($records[0]['n_sezionali'] < 2) { - echo "
    "; + echo '
    '; +} elseif ($records[0]['n_sezionali'] < 2) { + echo "
    "; - echo tr("Questo è l'unico segmento per il modulo '_MODULO_'. Il comando elimina è stato disattivato.", [ + echo tr("Questo è l'unico segmento per il modulo '_MODULO_'. Il comando elimina è stato disattivato.", [ '_MODULO_' => $records[0]['modulo'], ]); - echo '
    '; - } else { - echo ' + echo '
    '; +} else { + echo ' '.tr('Elimina').' '; - } +} ?> From 1b1d3753cfcd38befdcb5f217534b8d1586bb70a Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Tue, 4 Sep 2018 10:56:03 +0200 Subject: [PATCH 6/6] =?UTF-8?q?Aggiornamento=20quantit=C3=A0=20inventario?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../magazzino_inventario/pdfgen.magazzino_inventario.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/magazzino_inventario/pdfgen.magazzino_inventario.php b/templates/magazzino_inventario/pdfgen.magazzino_inventario.php index ad2182831..8abb47f30 100644 --- a/templates/magazzino_inventario/pdfgen.magazzino_inventario.php +++ b/templates/magazzino_inventario/pdfgen.magazzino_inventario.php @@ -50,11 +50,13 @@ include_once $docroot.'/templates/pdfgen_variables.php'; // LEFT OUTER JOIN mg_unitamisura ON mg_unitamisura.id=mg_articoli.idum // mg_unitamisura.valore AS um // LEFT OUTER JOIN mg_categorie ON (mg_categorie.id=mg_articoli.id_categoria AND mg_categorie.parent = 0) OR (mg_categorie.id=mg_articoli.id_sottocategoria AND mg_categorie.parent = 1) -$query = 'SELECT *, mg_articoli.id AS id_articolo, (SELECT nome FROM mg_categorie WHERE mg_categorie.parent = 0 AND mg_categorie.id = mg_articoli.id_categoria) AS categoria, (SELECT nome FROM mg_categorie WHERE mg_categorie.parent = 1 AND mg_categorie.id = mg_articoli.id_sottocategoria) AS subcategoria FROM mg_articoli WHERE 1=1 '.$add_where.' AND qta > 0 HAVING 2=2 '.$add_having.' ORDER BY codice ASC'; +$period_end = $_SESSION['period_end']; + +$query = 'SELECT *, mg_articoli.id AS id_articolo, (SELECT nome FROM mg_categorie WHERE mg_categorie.parent = 0 AND mg_categorie.id = mg_articoli.id_categoria) AS categoria, (SELECT nome FROM mg_categorie WHERE mg_categorie.parent = 1 AND mg_categorie.id = mg_articoli.id_sottocategoria) AS subcategoria, (SELECT SUM(qta) FROM mg_movimenti WHERE mg_movimenti.idarticolo=mg_articoli.id AND (mg_movimenti.idintervento IS NULL OR mg_movimenti.idautomezzo = 0) AND data <= '.prepare($period_end).' ) AS qta FROM mg_articoli WHERE 1=1 '.$add_where.' HAVING 2=2 '.$add_having.' ORDER BY codice ASC'; $rs = $dbo->fetchArray($query); $totrows = sizeof($rs); -$body .= '

    INVENTARIO AL '.date('d/m/Y')."

    \n"; +$body .= '

    INVENTARIO AL '.Translator::dateToLocale($period_end)."

    \n"; $body .= "\n"; $body .= "\n";