diff --git a/assets/src/css/fonts/sourcesanspro-regular-webfont.eot b/assets/src/css/fonts/sourcesanspro-regular-webfont.eot new file mode 100644 index 000000000..a0f4e1832 Binary files /dev/null and b/assets/src/css/fonts/sourcesanspro-regular-webfont.eot differ diff --git a/assets/src/css/fonts/sourcesanspro-regular-webfont.svg b/assets/src/css/fonts/sourcesanspro-regular-webfont.svg new file mode 100644 index 000000000..0345b6479 --- /dev/null +++ b/assets/src/css/fonts/sourcesanspro-regular-webfont.svg @@ -0,0 +1,1054 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/src/css/fonts/sourcesanspro-regular-webfont.ttf b/assets/src/css/fonts/sourcesanspro-regular-webfont.ttf new file mode 100644 index 000000000..a7fa05849 Binary files /dev/null and b/assets/src/css/fonts/sourcesanspro-regular-webfont.ttf differ diff --git a/assets/src/css/fonts/sourcesanspro-regular-webfont.woff b/assets/src/css/fonts/sourcesanspro-regular-webfont.woff new file mode 100644 index 000000000..c09cf34f2 Binary files /dev/null and b/assets/src/css/fonts/sourcesanspro-regular-webfont.woff differ diff --git a/assets/src/css/fonts/sourcesanspro-regular-webfont.woff2 b/assets/src/css/fonts/sourcesanspro-regular-webfont.woff2 new file mode 100644 index 000000000..1a811db19 Binary files /dev/null and b/assets/src/css/fonts/sourcesanspro-regular-webfont.woff2 differ diff --git a/assets/src/css/style.css b/assets/src/css/style.css index 7d5be3c24..09333630d 100755 --- a/assets/src/css/style.css +++ b/assets/src/css/style.css @@ -20,6 +20,16 @@ outline: none; } +@font-face { + font-family: 'Source Sans Pro'; + src: local('Source Sans Pro'), + url('../fonts/sourcesanspro-regular-webfont.eot') format('embedded-opentype'), + url('../fonts/sourcesanspro-regular-webfont.woff') format('woff'), + url('../fonts/sourcesanspro-regular-webfont.woff2') format('woff2'), + url('../fonts/sourcesanspro-regular-webfont.ttf') format('truetype'), + url('../fonts/sourcesanspro-regular-webfont.svg') format('svg'); +} + html, body { font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; diff --git a/assets/src/css/themes/default.css b/assets/src/css/themes/default.css index 8f074dc2c..b32922a96 100755 --- a/assets/src/css/themes/default.css +++ b/assets/src/css/themes/default.css @@ -24,6 +24,7 @@ .skin-default.login-page .wrapper { background: #d2d6de; + display: block; } .skin-default .content-wrapper, diff --git a/gulpfile.js b/gulpfile.js index d7f5bb48d..d45f3d8c7 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -255,6 +255,11 @@ const fonts = gulp.parallel(() => { 'bootstrap/dist/fonts/glyphicons-halflings-regular.ttf', 'bootstrap/dist/fonts/glyphicons-halflings-regular.woff', 'bootstrap/dist/fonts/glyphicons-halflings-regular.woff2', + '../assets/src/css/fonts/sourcesanspro-regular-webfont.eot', + '../assets/src/css/fonts/sourcesanspro-regular-webfont.svg', + '../assets/src/css/fonts/sourcesanspro-regular-webfont.ttf', + '../assets/src/css/fonts/sourcesanspro-regular-webfont.woff', + '../assets/src/css/fonts/sourcesanspro-regular-webfont.woff2', ]; for (const i in vendor) { diff --git a/include/top.php b/include/top.php index 4144ef41c..3b5b8b974 100755 --- a/include/top.php +++ b/include/top.php @@ -333,8 +333,6 @@ if (Auth::check()) { $settings_collapse = session_get('settings.sidebar-collapse') ? 1 : 0; $hide_sidebar = Auth::check() && (setting('Nascondere la barra sinistra di default') || $settings_collapse); echo ' - diff --git a/modules/anagrafiche/actions.php b/modules/anagrafiche/actions.php index 16de29310..fe894ee6b 100755 --- a/modules/anagrafiche/actions.php +++ b/modules/anagrafiche/actions.php @@ -85,6 +85,7 @@ switch (post('op')) { $anagrafica->dipendenti = post('dipendenti'); $anagrafica->macchine = post('macchine'); $anagrafica->idagente = post('idagente'); + $anagrafica->id_provenienza = post('id_provenienza'); $anagrafica->idrelazione = post('idrelazione'); $anagrafica->sitoweb = post('sitoweb'); $anagrafica->iscrizione_tribunale = post('iscrizione_tribunale'); diff --git a/modules/anagrafiche/ajax/select.php b/modules/anagrafiche/ajax/select.php index 2790216af..aa93556a9 100755 --- a/modules/anagrafiche/ajax/select.php +++ b/modules/anagrafiche/ajax/select.php @@ -372,6 +372,19 @@ switch ($resource) { } break; + + case 'provenienze': + $query = 'SELECT id, descrizione, colore AS bgcolor FROM an_provenienze |where| ORDER BY descrizione'; + + foreach ($elements as $element) { + $filter[] = 'id='.prepare($element); + } + + if (!empty($search)) { + $search_fields[] = 'descrizione LIKE '.prepare('%'.$search.'%'); + } + + break; /* * Opzioni utilizzate: diff --git a/modules/anagrafiche/edit.php b/modules/anagrafiche/edit.php index 873c3c12e..48eb0fd8d 100755 --- a/modules/anagrafiche/edit.php +++ b/modules/anagrafiche/edit.php @@ -490,9 +490,8 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
- {[ "type": "select", "label": "'.tr('Tipo attività predefinita').'", "name": "idtipointervento_default", "values": "query=SELECT idtipointervento AS id, descrizione FROM in_tipiintervento ORDER BY descrizione ASC", "value": "$idtipointervento_default$" ]} + {[ "type": "select", "label": "'.tr('Provenienza cliente').'", "name": "id_provenienza", "ajax-source": "provenienze", "value": "$id_provenienza$", "icon-after": "add|'.Modules::get('Provenienze')['id'].'" ]}
-
{[ "type": "select", "label": "'.tr('Relazione con il cliente').'", "name": "idrelazione", "ajax-source": "relazioni", "value": "$idrelazione$", "icon-after": "add|'.Modules::get('Relazioni')['id'].'" ]}
@@ -556,6 +555,11 @@ if ($is_cliente or $is_fornitore or $is_tecnico) { echo '
+ +
+ {[ "type": "select", "label": "'.tr('Tipo attività predefinita').'", "name": "idtipointervento_default", "values": "query=SELECT idtipointervento AS id, descrizione FROM in_tipiintervento ORDER BY descrizione ASC", "value": "$idtipointervento_default$" ]} +
+ '; echo ' diff --git a/modules/provenienze/actions.php b/modules/provenienze/actions.php new file mode 100644 index 000000000..415585da7 --- /dev/null +++ b/modules/provenienze/actions.php @@ -0,0 +1,83 @@ +. + */ + +include_once __DIR__.'/../../core.php'; + +switch (filter('op')) { + case 'update': + $descrizione = filter('descrizione'); + $colore = filter('colore'); + + if (isset($descrizione)) { + if ($dbo->fetchNum('SELECT * FROM `an_provenienze` WHERE `descrizione`='.prepare($descrizione).' AND `id`!='.prepare($id_record)) == 0) { + $dbo->query('UPDATE `an_provenienze` SET `descrizione`='.prepare($descrizione).', `colore`='.prepare($colore).' WHERE `id`='.prepare($id_record)); + flash()->info(tr('Salvataggio completato.')); + } else { + flash()->error(tr("E' già presente una provenienza _NAME_.", [ + '_TYPE_' => $descrizione, + ])); + } + } else { + flash()->error(tr('Ci sono stati alcuni errori durante il salvataggio')); + } + + break; + + case 'add': + $descrizione = filter('descrizione'); + $colore = filter('colore'); + + if (isset($descrizione)) { + if ($dbo->fetchNum('SELECT * FROM `an_provenienze` WHERE `descrizione`='.prepare($descrizione)) == 0) { + $dbo->query('INSERT INTO `an_provenienze` (`descrizione`, `colore`) VALUES ('.prepare($descrizione).', '.prepare($colore).')'); + + $id_record = $dbo->lastInsertedID(); + + if (isAjaxRequest()) { + echo json_encode(['id' => $id_record, 'text' => $descrizione]); + } + + flash()->info(tr('Aggiunta nuova provenienza _NAME_', [ + '_NAME_' => $descrizione, + ])); + } else { + flash()->error(tr("E' già presente una provenienza di _NAME_.", [ + '_NAME_' => $descrizione, + ])); + } + } else { + flash()->error(tr('Ci sono stati alcuni errori durante il salvataggio')); + } + + break; + + case 'delete': + $righe = $dbo->fetchNum('SELECT idanagrafica FROM an_anagrafiche WHERE id_provenienza='.prepare($id_record)); + + if (isset($id_record) && empty($righe)) { + $dbo->query('DELETE FROM `an_provenienze` WHERE `id`='.prepare($id_record)); + flash()->info(tr('Provenienza _NAME_ eliminata con successo!', [ + '_NAME_' => $descrizione, + ])); + } else { + flash()->error(tr('Sono presenti '.count($righe).' anagrafiche collegate a questa provenienza.')); + } + + break; +} diff --git a/modules/provenienze/add.php b/modules/provenienze/add.php new file mode 100644 index 000000000..128f30d00 --- /dev/null +++ b/modules/provenienze/add.php @@ -0,0 +1,51 @@ +. + */ + +include_once __DIR__.'/../../core.php'; + +?>
+ + + +
+
+ {[ "type": "text", "label": "", "name": "descrizione", "required": 1 ]} +
+ +
+ {[ "type": "text", "label": "", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "", "extra": "maxlength='7'", "icon-after": "
" ]} +
+
+ + +
+
+ +
+
+
+ + diff --git a/modules/provenienze/edit.php b/modules/provenienze/edit.php new file mode 100644 index 000000000..b45a1d658 --- /dev/null +++ b/modules/provenienze/edit.php @@ -0,0 +1,77 @@ +. + */ + +include_once __DIR__.'/../../core.php'; + +?>
+ + + + +
+
+

+
+ +
+
+
+ {[ "type": "text", "label": "", "name": "descrizione", "required": 1, "value": "$descrizione$" ]} +
+ +
+ {[ "type": "text", "label": "", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "
" ]} +
+ +
+
+
+ +
+ +fetchNum('SELECT idanagrafica FROM an_anagrafiche WHERE idrelazione='.prepare($id_record)); + +if (!empty($righe)) { + echo ' +
+ '.tr('Ci sono _NUM_ anagrafiche collegate', [ + '_NUM_' => $righe, + ]).'. +
'; +} else { + ?> + + + + + + + + + diff --git a/modules/provenienze/init.php b/modules/provenienze/init.php new file mode 100644 index 000000000..8fcd413c4 --- /dev/null +++ b/modules/provenienze/init.php @@ -0,0 +1,24 @@ +. + */ + +include_once __DIR__.'/../../core.php'; + +if (isset($id_record)) { + $record = $dbo->fetchOne('SELECT * FROM `an_provenienze` WHERE id='.prepare($id_record)); +} diff --git a/update/2_4_34.sql b/update/2_4_34.sql index fc0e21484..34bafc1d1 100644 --- a/update/2_4_34.sql +++ b/update/2_4_34.sql @@ -60,3 +60,27 @@ INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione` -- Filtro per mostrare preventivi ai clienti INSERT INTO `zz_group_module` (`idgruppo`, `idmodule`, `name`, `clause`, `position`, `enabled`, `default`) VALUES ((SELECT `id` FROM `zz_groups` WHERE `nome`='Clienti'), (SELECT `id` FROM `zz_modules` WHERE `name`='Preventivi'), 'Mostra preventivi ai clienti coinvolti', 'co_preventivi.idanagrafica=|id_anagrafica|', 'WHR', 1, 0); + +-- Nuova tabella per gestire le provenienze +CREATE TABLE IF NOT EXISTS `an_provenienze` ( + `id` int NOT NULL AUTO_INCREMENT, + `descrizione` varchar(100) NOT NULL, + `colore` varchar(7) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB; + + +INSERT INTO `an_provenienze` (`id`, `descrizione`, `colore`) VALUES +(NULL, 'Sito web', '#caffb7'), +(NULL, 'Passaparola', '#8fbafd'); + +-- Aggiunto id_provenienza per scheda anagrafica Cliente +ALTER TABLE `an_anagrafiche` ADD `id_provenienza` AFTER `idrelazione`, INT DEFAULT NULL; + +-- Nuovo modulo "Provenienze" +INSERT INTO `zz_modules` (`id`, `name`, `title`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`, `use_notes`, `use_checklists`) VALUES (NULL, 'Provenienze', 'Provenienze', 'provenienze', 'SELECT |select| FROM `an_provenienze` WHERE 1=1 HAVING 2=2', '', 'fa fa-angle-right', '2.4.34', '2.4.34', '1', (SELECT id FROM zz_modules t WHERE t.name = 'Anagrafiche'), '1', '1', '0', '0'); + +INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `visible`, `format`, `default`) VALUES +(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Provenienze'), 'id', 'an_provenienze.id', 1, 1, 0, 1), +(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Provenienze'), 'descrizione', 'an_provenienze.descrizione', 2, 1, 0, 1), +(NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Provenienze'), 'colore', 'an_provenienze.colore', 3, 1, 0, 1); \ No newline at end of file