Applying improvements selected from IcehrmPro for release v21.0.0

This commit is contained in:
gamonoid
2018-02-03 04:42:17 +01:00
parent e7792e7d79
commit f783163a78
11 changed files with 45 additions and 23 deletions

View File

@@ -1407,7 +1407,7 @@ class BaseService
{
$noJSONRequests = SettingsManager::getInstance()->getSetting("System: Do not pass JSON in request");
if ($noJSONRequests."" == "1") {
$json = str_replace("|", '"', $json);
$json = base64_decode($json);
}
return $json;
}

View File

@@ -49,11 +49,19 @@ class CalendarTools
return $days;
}
public static function addMinutesToDateTime($datetime, $minutes)
public static function addMinutesToDateTime($datetime, $minutes, $format = 'Y-m-d H:i:s')
{
$time = new \DateTime($datetime);
$time->add(new \DateInterval('PT' . $minutes . 'M'));
$time = $time->add(new \DateInterval('PT' . $minutes . 'M'));
return $time->format('Y-m-d H:i:s');
return $time->format($format);
}
public static function addMonthsToDateTime($datetime, $months, $format = 'Y-m-d H:i:s')
{
$time = new \DateTime($datetime);
$time = $time->add(new \DateInterval('P' . $months . 'M'));
return $time->format($format);
}
}

View File

@@ -23,7 +23,7 @@ class SessionUtils
session_write_close();
}
public function unsetClientSession()
public static function unsetClientSession()
{
$names = [
"user",