From 761ba99de186193dbca050658b21632a118e2279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Mon, 9 Dec 2024 16:31:09 +0100 Subject: [PATCH] fix s.php --- src/Jirafeau/s.php | 34 ++++++++++++++++++++++++++++++++++ src/bash/filterTest.sh | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Jirafeau/s.php b/src/Jirafeau/s.php index a396961..17b918e 100644 --- a/src/Jirafeau/s.php +++ b/src/Jirafeau/s.php @@ -16,6 +16,40 @@ require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); +// ======================================== +function period2seconds ($periodName) { + if (!$periodName) + return JIRAFEAU_MONTH; + switch ($periodName) { + case 'minute': + return JIRAFEAU_MINUTE; + break; + case 'hour': + return JIRAFEAU_HOUR; + break; + case 'day': + return JIRAFEAU_DAY; + break; + case 'week': + return JIRAFEAU_WEEK; + break; + case 'month': + return JIRAFEAU_MONTH; + break; + case 'quarter': + return JIRAFEAU_QUARTER; + break; + case 'semester': + return JIRAFEAU_SEMESTER; + break; + case 'year': + return JIRAFEAU_YEAR; + break; + default: + returnError (t ('ERR_OCC') . ' (periodName)'); + } +} + // ======================================== function returnError ($msg) { require (JIRAFEAU_ROOT.'lib/template/header.php'); diff --git a/src/bash/filterTest.sh b/src/bash/filterTest.sh index 99cfc02..fc6d10b 100755 --- a/src/bash/filterTest.sh +++ b/src/bash/filterTest.sh @@ -91,7 +91,7 @@ eMailShrinker="$(realpath "./eMailShrinker")" ######################################## dos2unix "${mbox}" -[ -z "${SIMULATE}" ] && DOMAINEDEPOT="$(cat domainedepot)" +[ -z "${SIMULATE}" ] && DOMAINEDEPOT="$(cat config/domainedepot)" JIRAFEAU_URL="https://depot.${DOMAINEDEPOT}" JIRAFEAU_LOCAL="${JIRAFEAU_URL}"