diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 75f829be46e..f1f92d01f3f 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1076,7 +1076,7 @@ if (empty($reshook)) $lines[$i]->fetch_optionals($lines[$i]->rowid); $array_options = $lines[$i]->array_options; } - + // View third's localtaxes for now $localtax1_tx = get_localtax($lines[$i]->tva_tx, 1, $object->client); $localtax2_tx = get_localtax($lines[$i]->tva_tx, 2, $object->client); diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 8a4ffd29d68..ff9f29f55ff 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -31,7 +31,7 @@ abstract class Stats { protected $db; var $_lastfetchdate=array(); // Dates of cache file read by methods - var $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts) + var $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts) /** * Return nb of elements by month for several years @@ -76,7 +76,7 @@ abstract class Stats dol_syslog(get_class($this).'::'.__FUNCTION__." cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it."); } } - + // Load file into $data if ($foundintocache) // Cache file found and is not too old { @@ -203,11 +203,14 @@ abstract class Stats dol_syslog(get_class($this).'::'.__FUNCTION__." save cache file ".$newpathofdestfile." onto disk."); if (! dol_is_dir($conf->user->dir_temp)) dol_mkdir($conf->user->dir_temp); $fp = fopen($newpathofdestfile, 'w'); - fwrite($fp, json_encode($data)); - fclose($fp); - if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; - @chmod($newpathofdestfile, octdec($newmask)); - + if ($fp) + { + fwrite($fp, json_encode($data)); + fclose($fp); + if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; + @chmod($newpathofdestfile, octdec($newmask)); + } + else dol_syslog("Failed to write cache file", LOG_ERR); $this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt; } @@ -309,21 +312,23 @@ abstract class Stats dol_syslog(get_class($this).'::'.__FUNCTION__." save cache file ".$newpathofdestfile." onto disk."); if (! dol_is_dir($conf->user->dir_temp)) dol_mkdir($conf->user->dir_temp); $fp = fopen($newpathofdestfile, 'w'); - fwrite($fp, json_encode($data)); - fclose($fp); - if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; - @chmod($newpathofdestfile, octdec($newmask)); - + if ($fp) + { + fwrite($fp, json_encode($data)); + fclose($fp); + if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; + @chmod($newpathofdestfile, octdec($newmask)); + } $this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt; } return $data; - } - - + } + + // Here we have low level of shared code called by XxxStats.class.php - + /** * Return nb of elements by year * @@ -532,8 +537,8 @@ abstract class Stats return $data; } - - + + /** * Return number or total of product refs * @@ -544,7 +549,7 @@ abstract class Stats function _getAllByProduct($sql, $limit=10) { global $langs; - + $result=array(); $res=array(); @@ -567,6 +572,6 @@ abstract class Stats else dol_print_error($this->db); return $result; - } + } } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index b3549d3a727..e5a1d9da08f 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -413,7 +413,7 @@ else } print ''; - print ''; + print ''; // print ''; print ''; print '';
'.$langs->trans("Project").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").'