Correzioni JS e stile del codice

Correzioni JS sulla visualizzazione della barra laterale dei plugin e sulla stampa automatica delle tabelle.
This commit is contained in:
Dasc3er 2021-07-27 11:37:04 +02:00
parent 5f51c4af16
commit dfb5734d9b
12 changed files with 71 additions and 55 deletions

View File

@ -1033,13 +1033,13 @@ div.tip {
margin-right: 230px;
}
.control-sidebar-shown {
.control-sidebar-open {
right: 0;
display: block !important;
}
.control-sidebar.control-sidebar-shown,
.control-sidebar.control-sidebar-shown + .control-sidebar-bg {
.control-sidebar.control-sidebar-open,
.control-sidebar.control-sidebar-open + .control-sidebar-bg {
right: 0;
}

View File

@ -32,11 +32,11 @@ $(document).ready(function () {
$(this).find('ul').stop().slideUp();
});
$menulist = $('.treeview-menu > li.active');
for (i = 0; i < $menulist.length; i++) {
$list = $($menulist[i]);
$list.parent().show().parent().addClass('active');
$list.parent().parent().find('i.fa-angle-left').removeClass('fa-angle-left').addClass('fa-angle-down');
const elenco_menu = $('.treeview-menu > li.active');
for (i = 0; i < elenco_menu.length; i++) {
const elemento = $(elenco_menu[i]);
elemento.parent().show().parent().addClass('active');
elemento.parent().parent().find('i.fa-angle-left').removeClass('fa-angle-left').addClass('fa-angle-down');
}
// Menu ordinabile
@ -46,7 +46,7 @@ $(document).ready(function () {
cursor: "move",
dropOnEmpty: true,
scroll: true,
})[0].addEventListener("sortupdate", function(e) {
})[0].addEventListener("sortupdate", function (e) {
let order = $(".sidebar-menu > .treeview[data-id]").toArray().map(a => $(a).data("id"))
$.post(globals.rootdir + "/actions.php", {
@ -57,19 +57,52 @@ $(document).ready(function () {
});
}
$(".sidebar-toggle").click(function () {
setTimeout(function () {
window.dispatchEvent(new Event('resize'));
}, 350);
});
// Mostra/nasconde sidebar sx
// Mostra/nasconde sidebar del menu principale
$(".sidebar-toggle").on("click", function () {
if ($("body").hasClass("sidebar-collapse")) {
session_set("settings,sidebar-collapse", 0, 1, 0);
} else {
session_set("settings,sidebar-collapse", 1, 0, 0);
}
setTimeout(function () {
window.dispatchEvent(new Event('resize'));
}, 350);
});
// Barra plugin laterale
const pluginToggle = $(".control-sidebar-toggle");
const largeScreen = screen.width > 1200;
// Gestione click sul pulsante per il toggle
pluginToggle.on("click", function () {
$("aside.content-wrapper, .main-footer").toggleClass("with-control-sidebar");
toggleControlSidebar();
});
// Gestione click sulla sidebar per evitare chiusura
$(".control-sidebar").on("click", function (e) {
if (largeScreen && e.target.tagName !== 'H4' && $(".main-footer").hasClass("with-control-sidebar")) {
toggleControlSidebar();
}
});
// Barra plugin laterale disabilitata per schermi piccoli
if (largeScreen && !globals.collapse_plugin_sidebar) {
pluginToggle.click();
}
});
/**
* Funzione dedicata alla gestione del toggle della sidebar.
*/
function toggleControlSidebar() {
const sidebar = $(".control-sidebar");
sidebar.toggleClass("control-sidebar-open");
if (sidebar.hasClass("control-sidebar-open")) {
sidebar.show();
}
}

View File

@ -126,6 +126,7 @@ function start_datatables() {
{
extend: 'print',
autoPrint: true,
footer: true,
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')

View File

@ -119,30 +119,11 @@ if (empty($record) || !$has_access) {
</a>
</li>';
$hide_left_sidebar = Auth::check() && (setting('Nascondere la barra dei plugin di default'));
echo '
<li class="control-sidebar-toggle">
<a data-toggle="control-sidebar" style="cursor: pointer">'.tr('Plugin').'</a>
<a style="cursor: pointer">'.tr('Plugin').'</a>
</li>
<script>
$( document ).ready(function() {';
if (!empty($hide_left_sidebar)) {
echo ' $(".control-sidebar").removeClass("control-sidebar-shown"); $("aside.content-wrapper, .main-footer").toggleClass("with-control-sidebar");';
}
echo '
$(".control-sidebar-toggle").bind("click", function() {
$("aside.content-wrapper, .main-footer").toggleClass("with-control-sidebar");
$(".control-sidebar").toggleClass("control-sidebar-shown");
});
});
</script>
</ul>
<div class="tab-content">

View File

@ -26,7 +26,7 @@ if (Auth::check()) {
</section><!-- /.content -->
</aside><!-- /.content-wrapper -->
<footer class="main-footer '.(string_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php') ? 'with-control-sidebar' : '').'">
<footer class="main-footer">
<a class="hidden-xs" href="'.tr('https://www.openstamanager.com').'" title="'.tr("Il gestionale open source per l'assistenza tecnica e la fatturazione").'." target="_blank"><strong>'.tr('OpenSTAManager').'</strong></a>
<span class="pull-right hidden-xs">
<strong>'.tr('Versione').'</strong> '.$version.'

View File

@ -115,7 +115,7 @@ if (Auth::check()) {
'hookSingle' => tr('Hai 1 notifica'),
'hookNone' => tr('Nessuna notifica'),
'singleCalendar' => tr("E' presente un solo periodo!"),
'noResults' => tr("Nessun elemento trovato"),
'noResults' => tr('Nessun elemento trovato'),
];
foreach ($translations as $key => $value) {
echo '
@ -123,7 +123,7 @@ if (Auth::check()) {
}
echo '
allegati: {
messaggio: "'.tr("Clicca o trascina qui per caricare uno o più file").'",
messaggio: "'.tr('Clicca o trascina qui per caricare uno o più file').'",
maxFilesize: "'.tr('Max upload: _SIZE_ MB').'",
errore: "'.tr('Errore').'",
modifica: "'.tr('Modifica allegato').'",
@ -206,6 +206,8 @@ if (Auth::check()) {
end_date: "'.$_SESSION['period_end'].'",
end_date_formatted: "'.Translator::dateToLocale($_SESSION['period_end']).'",
collapse_plugin_sidebar: '.intval(setting('Nascondere la barra dei plugin di default')).',
ckeditorToolbar: [
["Undo","Redo","-","Cut","Copy","Paste","PasteText","PasteFromWord","-","SpellChecker", "Scayt", "-","Link","Unlink","-","Bold","Italic","Underline","Superscript","SpecialChar","HorizontalRule","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock","-","NumberedList","BulletedList","Outdent","Indent","Blockquote","-","Styles","Format","Image","Table", "TextColor", "BGColor" ],
],
@ -405,23 +407,23 @@ if (Auth::check()) {
</ul>
</li>
<li><a href="#" onclick="window.print()" class="tip nav-button" title="'.tr('Stampa').'">
<li class="nav-button"><a href="#" onclick="window.print()" class="tip nav-button" title="'.tr('Stampa').'">
<i class="fa fa-print"></i>
</a></li>
<li><a href="'.base_path().'/bug.php" class="tip nav-button" title="'.tr('Segnalazione bug').'">
<li class="nav-button"><a href="'.base_path().'/bug.php" class="tip nav-button" title="'.tr('Segnalazione bug').'">
<i class="fa fa-bug"></i>
</a></li>
<li><a href="'.base_path().'/log.php" class="tip nav-button" title="'.tr('Log accessi').'">
<li class="nav-button"><a href="'.base_path().'/log.php" class="tip nav-button" title="'.tr('Log accessi').'">
<i class="fa fa-book"></i>
</a></li>
<li><a href="'.base_path().'/info.php" class="tip nav-button" title="'.tr('Informazioni').'">
<li class="nav-button"><a href="'.base_path().'/info.php" class="tip nav-button" title="'.tr('Informazioni').'">
<i class="fa fa-info"></i>
</a></li>
<li><a href="'.base_path().'/index.php?op=logout" onclick="sessionStorage.clear()" class="bg-red tip" title="'.tr('Esci').'">
<li class="nav-button"><a href="'.base_path().'/index.php?op=logout" onclick="sessionStorage.clear()" class="bg-red tip" title="'.tr('Esci').'">
<i class="fa fa-power-off"></i>
</a></li>
</ul>
@ -482,7 +484,7 @@ if (Auth::check()) {
if (string_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php')) {
// Menu laterale per la visualizzazione dei plugin
echo '
<aside class="control-sidebar control-sidebar-light control-sidebar-shown">
<aside class="control-sidebar control-sidebar-light">
<h4 class="text-center">'.tr('Plugin disponibili').'</h4>
<ul class="nav nav-tabs nav-pills nav-stacked">
<li data-toggle="control-sidebar" class="active">
@ -542,7 +544,7 @@ if (Auth::check()) {
echo '
<!-- Right side column. Contains the navbar and content of the page -->
<aside class="content-wrapper '.(string_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php') ? 'with-control-sidebar' : '').'">
<aside class="content-wrapper">
<!-- Main content -->
<section class="content">

View File

@ -159,7 +159,7 @@ echo '
<script>
var emails = [];
var id_anagrafica = "'.$id_anagrafica.'";
var pec = "'.$smtp['pec']. '";
var pec = "'.$smtp['pec'].'";
$(document).ready(function() {
// Auto-completamento destinatario

View File

@ -138,7 +138,7 @@ if ($dir == 'entrata') {
array_push($campi_mancanti, 'Partita IVA');
array_push($campi_mancanti, 'Codice fiscale');
}
$nazione = Nazione::find($rs2[0]['id_nazione']);
//se è un privato o un ente pubblico controllo il codice fiscale
if ((($rs2[0]['tipo'] == 'Privato' && $nazione->iso2 == 'IT') or $rs2[0]['tipo'] == 'Ente pubblico') and empty($rs2[0]['codice_fiscale'])) {

View File

@ -141,7 +141,7 @@ class FileManager implements ManagerInterface
<i class="fa fa-external-link"></i> '.$r['name'].'
</a>
<small> ('.$file->extension.')'.((!empty($file->size)) ? ' ('. FileSystem::formatBytes($file->size).')' : '').' '.(((setting('Logo stampe') == $r['filename']) || (setting('Filigrana stampe') == $r['filename'])) ? '<i class="fa fa-file-text-o"></i>' : '').'</small>'.'
<small> ('.$file->extension.')'.((!empty($file->size)) ? ' ('.FileSystem::formatBytes($file->size).')' : '').' '.(((setting('Logo stampe') == $r['filename']) || (setting('Filigrana stampe') == $r['filename'])) ? '<i class="fa fa-file-text-o"></i>' : '').'</small>'.'
</td>
<td>'.timestampFormat($r['created_at']).'</td>

View File

@ -167,7 +167,7 @@ class Query
$search_filters = [];
foreach ($search as $field => $original_value) {
$pos = array_search($field, $total['fields']);
$value = trim($original_value);
$value = is_array($original_value) ? $original_value : trim($original_value);
if (isset($value) && $pos !== false) {
$search_query = $total['search_inside'][$pos];

View File

@ -55,4 +55,3 @@ if (!empty($documento->idsede)) {
}
}
}

View File

@ -71,16 +71,16 @@ $default_header$
<p>$c_telefono$ $c_cellulare$</p>
</td>
</tr>';
if (!empty($destinazione)) {
echo '
if (!empty($destinazione)) {
echo '
<tr>
<td class="border-full" style="height:16mm;">
<p class="small-bold">'.tr('Destinazione diversa', [], ['upper' => true]).'</p>
'.$destinazione.'
</td>
</tr>';
}
echo '
}
echo '
</table>
</div>