1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Bugfix vari

This commit is contained in:
Thomas Zilio
2017-09-07 18:58:41 +02:00
parent e7a23297c9
commit f25677ef33
11 changed files with 321 additions and 210 deletions

View File

@@ -706,17 +706,21 @@ function start_datatables() {
} else { } else {
var index = selected.indexOf("" + id); var index = selected.indexOf("" + id);
if (index > -1) { if (index > -1) {
selected = selected.splice(index + 1, 1); delete selected[index];
} }
} }
} }
}); });
selected = selected.filter(function (entry) {
return entry != '';
});
$this.data('selected', selected.join(',')); $this.data('selected', selected.join(','));
var container = $(document).find('[data-target=' + $this.attr('id') + ']'); var container = $(document).find('[data-target=' + $this.attr('id') + ']');
if (selected.length > 1) { if (selected.length > 0) {
container.find('.bulk-container').removeClass('disabled'); container.find('.bulk-container').removeClass('disabled');
container.find('.bulk-container').attr('disabled', false); container.find('.bulk-container').attr('disabled', false);
} else { } else {
@@ -1175,7 +1179,7 @@ function setContrast(backgroundcolor) {
} }
function message(element) { function message(element) {
data = $(element).data(); data = $.extend({}, $(element).data());
var title = globals.translations.deleteTitle; var title = globals.translations.deleteTitle;
if (data["title"] != undefined) title = data["title"]; if (data["title"] != undefined) title = data["title"];

View File

@@ -84,12 +84,20 @@ function deltree($path)
*/ */
function copyr($source, $dest, $ignores = []) function copyr($source, $dest, $ignores = [])
{ {
$path = realpath($source);
$ignores = (array) $ignores; $ignores = (array) $ignores;
$exclude = !empty(array_intersect([slashes($path), slashes($path.'/'), $entry], $ignores)); foreach ($ignores as $key => $value) {
$ignores[$key] = slashes($value);
}
$path = realpath($source);
$exclude = !empty(array_intersect($ignores, [slashes($path), slashes($path.'/'), $entry]));
if ($exclude) {
return;
}
// Simple copy for a file // Simple copy for a file
if (is_file($source) && !$exclude) { if (is_file($source)) {
return copy($source, $dest); return copy($source, $dest);
} }
@@ -114,11 +122,11 @@ function copyr($source, $dest, $ignores = [])
} }
$path = realpath($source.'/'.$entry.'/'); $path = realpath($source.'/'.$entry.'/');
$exclude = !empty(array_intersect([slashes($path), slashes($path.'/'), $entry], $ignores)); $exclude = !empty(array_intersect($ignores, [slashes($path), slashes($path.'/'), $entry]));
// Deep copy directories // Deep copy directories
if ($dest !== $source.'/'.$entry && !$exclude) { if (slashes($dest) !== slashes($source.'/'.$entry) && !$exclude) {
copyr($source.'/'.$entry, $dest.'/'.$entry, $exclude); copyr($source.'/'.$entry, $dest.'/'.$entry, $ignores);
} }
} }
@@ -244,7 +252,7 @@ function do_backup()
} }
// Creazione cartella temporanea // Creazione cartella temporanea
if (file_exists($backup_dir.$tmp_backup_dir) || @create_dir($backup_dir.$tmp_backup_dir)) { if (file_exists($backup_dir.$tmp_backup_dir) || create_dir($backup_dir.$tmp_backup_dir)) {
$do_backup = true; $do_backup = true;
} else { } else {
$do_backup = false; $do_backup = false;

File diff suppressed because it is too large Load Diff

View File

@@ -68,7 +68,8 @@ if (file_exists($backup_dir)) {
if (!empty($backups_zip)) { if (!empty($backups_zip)) {
foreach ($backups_zip as $backup) { foreach ($backups_zip as $backup) {
$name = basename($backup); $name = basename($backup);
preg_match('/^OSM backup ([0-9\-]{10}) ([0-9_]{8})\.zip$/', basename($file), $m); preg_match('/^OSM backup ([0-9\-]{10}) ([0-9_]{8})\.zip$/', $name, $m);
echo ' echo '
<div class="callout callout-info"> <div class="callout callout-info">
<h4>'.str_replace(['_DATE_', '_TIME_'], [Translator::dateToLocale($m[1]), date('H:i', strtotime(str_replace('_', ':', $m[2])))], tr('Backup del _DATE_ alle _TIME_')).'</h4> <h4>'.str_replace(['_DATE_', '_TIME_'], [Translator::dateToLocale($m[1]), date('H:i', strtotime(str_replace('_', ':', $m[2])))], tr('Backup del _DATE_ alle _TIME_')).'</h4>

View File

@@ -34,7 +34,7 @@ switch (get('op')) {
{ {
"id": "'.$rs[$i]['idintervento'].'", "id": "'.$rs[$i]['idintervento'].'",
"idtecnico":"'.$rs[$i]['idtecnico'].'", "idtecnico":"'.$rs[$i]['idtecnico'].'",
"title":"<b>Int. '.$rs[$i]['idintervento'].'</b>'.addslashes($rs[$i]['cliente']).'<br><b>'.tr('Tecnici').':</b> '.addslashes($rs[$i]['nome_tecnico']).'", "title":"<b>Int. '.$rs[$i]['idintervento'].'</b> '.addslashes($rs[$i]['cliente']).'<br><b>'.tr('Tecnici').':</b> '.addslashes($rs[$i]['nome_tecnico']).'",
"start": "'.$rs[$i]['orario_inizio'].'", "start": "'.$rs[$i]['orario_inizio'].'",
"end": "'.$rs[$i]['orario_fine'].'", "end": "'.$rs[$i]['orario_fine'].'",
"url":"'.$rootdir.'/editor.php?id_module='.Modules::getModule('Interventi')['id'].'&id_record='.$rs[$i]['idintervento'].'", "url":"'.$rootdir.'/editor.php?id_module='.Modules::getModule('Interventi')['id'].'&id_record='.$rs[$i]['idintervento'].'",

View File

@@ -455,7 +455,7 @@ if (!empty(get_var('Abilitare orario lavorativo'))) {
$('#tiny-loader').hide(); $('#tiny-loader').hide();
} }
}, },
<?php <?php
if (Modules::getPermission($id_module) == 'rw') { if (Modules::getPermission($id_module) == 'rw') {
?> ?>
droppable: true, droppable: true,
@@ -517,16 +517,16 @@ if (Modules::getPermission($id_module) == 'rw') {
} }
}); });
}, },
<?php <?php
} }
?>
eventAfterRender: function(event, element) {
element.find('.fc-title').html(event.title);
<?php
if (get_var('Utilizzare i tooltip sul calendario') == '1') { if (get_var('Utilizzare i tooltip sul calendario') == '1') {
?> ?>
eventAfterRender: function(event, element) {
//alert(element.find('.fc-event-title').html();
element.find('.fc-title').html(event.title);
$.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=get_more_info&id="+event.id+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){ $.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=get_more_info&id="+event.id+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){
if( response=="success" ){ if( response=="success" ){
data = $.trim(data); data = $.trim(data);
@@ -551,12 +551,12 @@ if (get_var('Utilizzare i tooltip sul calendario') == '1') {
return false; return false;
} }
} }
}); });
}, <?php
<?php
} }
?> ?>
},
events: { events: {
url: globals.rootdir + "/modules/dashboard/ajaxreq.php?op=get_current_month", url: globals.rootdir + "/modules/dashboard/ajaxreq.php?op=get_current_month",
type: 'GET', type: 'GET',

View File

@@ -4,7 +4,7 @@ include_once __DIR__.'/../../core.php';
// Necessaria per la funzione add_movimento_magazzino // Necessaria per la funzione add_movimento_magazzino
include_once $docroot.'/modules/articoli/modutil.php'; include_once $docroot.'/modules/articoli/modutil.php';
//var_dump(get_totale_fattura($id_record));exit(); include_once $docroot.'/modules/interventi/modutil.php';
$module = Modules::getModule($id_module); $module = Modules::getModule($id_module);

View File

@@ -528,7 +528,7 @@ switch (post('op')) {
break; break;
case 'firma': case 'firma':
$directory_exists = (file_exists($docroot.'/files/interventi') || @create_dir($docroot.'/files/interventi')); $directory_exists = (file_exists($docroot.'/files/interventi') || create_dir($docroot.'/files/interventi'));
if ($directory_exists) { if ($directory_exists) {
if (post('firma_base64') != '') { if (post('firma_base64') != '') {

View File

@@ -86,7 +86,7 @@
"gulp": "gulp", "gulp": "gulp",
"release-OSM": "yarn run develop-OSM && gulp release", "release-OSM": "yarn run develop-OSM && gulp release",
"develop-OSM": "yarn install && yarn run install-OSM && yarn run assets-OSM", "develop-OSM": "yarn install && yarn run install-OSM && yarn run assets-OSM",
"install-OSM": "php composer.phar install", "install-OSM": "php composer.phar update",
"assets-OSM": "yarn upgrade && yarn run build-OSM", "assets-OSM": "yarn upgrade && yarn run build-OSM",
"build-OSM": "gulp", "build-OSM": "gulp",
"dump-OSM": "php composer.phar dump-autoload", "dump-OSM": "php composer.phar dump-autoload",

View File

@@ -156,6 +156,7 @@ if (!empty($v_iva)) {
} }
} }
// % 20 -> < 19 righe
for ($i = (floor($n_rows) % 20); $i < 15; ++$i) { for ($i = (floor($n_rows) % 20); $i < 15; ++$i) {
echo ' echo '
<tr> <tr>

View File

@@ -1,6 +1,5 @@
<?php <?php
// SCADENZE | TOTALI // SCADENZE | TOTALI
// TABELLA PRINCIPALE // TABELLA PRINCIPALE
echo " echo "