2
0
forked from Wavyzz/dolibarr

use shorter name for function

This commit is contained in:
Frédéric France
2024-01-15 17:48:20 +01:00
parent 15b1ff5b69
commit 4fbb5b01be
2 changed files with 7 additions and 7 deletions

View File

@@ -235,14 +235,14 @@ function isModEnabled($module)
} }
/** /**
* isDolValidTms check if a timestamp is valid. * isDolTms check if a timestamp is valid.
* *
* @param int|string|null $timestamp timestamp to check * @param int|string|null $timestamp timestamp to check
* @return bool * @return bool
*/ */
function isDolValidTms($timestamp) function isDolTms($timestamp)
{ {
if ($timestamp == '') { if ($timestamp === '') {
dol_syslog('Using empty string for a timestamp is deprecated, prefer use of null when calling page '.$_SERVER["PHP_SELF"], LOG_NOTICE); dol_syslog('Using empty string for a timestamp is deprecated, prefer use of null when calling page '.$_SERVER["PHP_SELF"], LOG_NOTICE);
return false; return false;
} }

View File

@@ -849,9 +849,9 @@ class Project extends CommonObject
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$this->db->sanitize($ids).") AND entity IN (".getEntity($type).")"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$this->db->sanitize($ids).") AND entity IN (".getEntity($type).")";
} }
if (isDolValidTms($date_start) && $type == 'loan') { if (isDolTms($date_start) && $type == 'loan') {
$sql .= " AND (dateend > '".$this->db->idate($date_start)."' OR dateend IS NULL)"; $sql .= " AND (dateend > '".$this->db->idate($date_start)."' OR dateend IS NULL)";
} elseif (isDolValidTms($date_start) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table } elseif (isDolTms($date_start) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
if (empty($datefieldname) && !empty($this->table_element_date)) { if (empty($datefieldname) && !empty($this->table_element_date)) {
$datefieldname = $this->table_element_date; $datefieldname = $this->table_element_date;
} }
@@ -861,9 +861,9 @@ class Project extends CommonObject
$sql .= " AND (".$datefieldname." >= '".$this->db->idate($date_start)."' OR ".$datefieldname." IS NULL)"; $sql .= " AND (".$datefieldname." >= '".$this->db->idate($date_start)."' OR ".$datefieldname." IS NULL)";
} }
if (isDolValidTms($date_end) && $type == 'loan') { if (isDolTms($date_end) && $type == 'loan') {
$sql .= " AND (datestart < '".$this->db->idate($date_end)."' OR datestart IS NULL)"; $sql .= " AND (datestart < '".$this->db->idate($date_end)."' OR datestart IS NULL)";
} elseif (isDolValidTms($date_end) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table } elseif (isDolTms($date_end) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
if (empty($datefieldname) && !empty($this->table_element_date)) { if (empty($datefieldname) && !empty($this->table_element_date)) {
$datefieldname = $this->table_element_date; $datefieldname = $this->table_element_date;
} }