From 7419e920bc792b31e1c2ccf89359479170630bda Mon Sep 17 00:00:00 2001 From: aB0t Date: Thu, 10 Aug 2023 06:49:04 +0200 Subject: [PATCH] Update on v1.0.1 (beta for next version) Here's an update on the current version, which includes changes towards the next release still in beta. --- helper.php | 10 ++-- .../en-GB/en-GB.mod_version_calendar_svg.ini | 4 +- .../en-GB.mod_version_calendar_svg.sys.ini | 4 +- mod_version_calendar_svg.xml | 28 +++++----- rules/int.php | 55 ------------------- tmpl/default.php | 8 +-- 6 files changed, 27 insertions(+), 82 deletions(-) delete mode 100644 rules/int.php diff --git a/helper.php b/helper.php index e3d1f76..cb953ba 100644 --- a/helper.php +++ b/helper.php @@ -175,19 +175,19 @@ class ModVersion_Calendar_svgHelper public function state(stdClass $branch): ?string { $initial = new DateTime($branch->start); - $bug = new DateTime($branch->bug); - $security = new DateTime($branch->end); + $security = new DateTime($branch->security); + $end = new DateTime($branch->end); - if ($initial && $bug && $security) + if ($initial && $security) { $now = new DateTime; - if ($now >= $security) + if ($now >= $end) { return 'eol'; } - if ($now >= $bug) + if ($security && $now >= $security) { return 'security'; } diff --git a/language/en-GB/en-GB.mod_version_calendar_svg.ini b/language/en-GB/en-GB.mod_version_calendar_svg.ini index 4526b1b..88698e1 100644 --- a/language/en-GB/en-GB.mod_version_calendar_svg.ini +++ b/language/en-GB/en-GB.mod_version_calendar_svg.ini @@ -29,7 +29,7 @@ MOD_VERSION_CALENDAR_SVG_VERSION_MESSAGE="Error! Please add version here." MOD_VERSION_CALENDAR_SVG_VERSION_HINT="1.0.0" MOD_VERSION_CALENDAR_SVG_START_LABEL="Start Date" MOD_VERSION_CALENDAR_SVG_START_MESSAGE="Error! Please add date here." -MOD_VERSION_CALENDAR_SVG_BUG_LABEL="Bug Date" -MOD_VERSION_CALENDAR_SVG_BUG_MESSAGE="Error! Please add date here." +MOD_VERSION_CALENDAR_SVG_SECURITY_LABEL="Security Support Date" +MOD_VERSION_CALENDAR_SVG_SECURITY_MESSAGE="Error! Please add date here." MOD_VERSION_CALENDAR_SVG_END_LABEL="End Date" MOD_VERSION_CALENDAR_SVG_END_MESSAGE="Error! Please add date here." \ No newline at end of file diff --git a/language/en-GB/en-GB.mod_version_calendar_svg.sys.ini b/language/en-GB/en-GB.mod_version_calendar_svg.sys.ini index 4526b1b..88698e1 100644 --- a/language/en-GB/en-GB.mod_version_calendar_svg.sys.ini +++ b/language/en-GB/en-GB.mod_version_calendar_svg.sys.ini @@ -29,7 +29,7 @@ MOD_VERSION_CALENDAR_SVG_VERSION_MESSAGE="Error! Please add version here." MOD_VERSION_CALENDAR_SVG_VERSION_HINT="1.0.0" MOD_VERSION_CALENDAR_SVG_START_LABEL="Start Date" MOD_VERSION_CALENDAR_SVG_START_MESSAGE="Error! Please add date here." -MOD_VERSION_CALENDAR_SVG_BUG_LABEL="Bug Date" -MOD_VERSION_CALENDAR_SVG_BUG_MESSAGE="Error! Please add date here." +MOD_VERSION_CALENDAR_SVG_SECURITY_LABEL="Security Support Date" +MOD_VERSION_CALENDAR_SVG_SECURITY_MESSAGE="Error! Please add date here." MOD_VERSION_CALENDAR_SVG_END_LABEL="End Date" MOD_VERSION_CALENDAR_SVG_END_MESSAGE="Error! Please add date here." \ No newline at end of file diff --git a/mod_version_calendar_svg.xml b/mod_version_calendar_svg.xml index c73c0c1..1c920ee 100644 --- a/mod_version_calendar_svg.xml +++ b/mod_version_calendar_svg.xml @@ -1,7 +1,7 @@ MOD_VERSION_CALENDAR_SVG - 21st September, 2022 + 10th August, 2023 Joomla! Project admin@joomla.org http://www.joomla.org @@ -51,7 +51,7 @@ min="10" max="80" step="1" - validate="int" + validate="number" /> @@ -221,7 +221,7 @@ min="1" max="20" step="1" - validate="int" + validate="number" /> - + - * - * @created 29th July, 2020 - * @copyright (C) 2020 Open Source Matters, Inc. - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -// No direct access to this file -defined('JPATH_PLATFORM') or die; - -use Joomla\CMS\Form\Form; -use Joomla\CMS\Form\FormRule; -use Joomla\Registry\Registry; - -/** - * Form Rule (Int) class for the Joomla Platform. - */ -class JFormRuleInt extends FormRule -{ - /** - * Method to test that an integer value was added. - * - * @param \SimpleXMLElement $element The SimpleXMLElement object representing the `` tag for the form field object. - * @param mixed $value The form field value to validate. - * @param string $group The field name group control value. This acts as an array container for the field. - * For example if the field has name="foo" and the group value is set to "bar" then the - * full field name would end up being "bar[foo]". - * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. - * @param Form $form The form object for which the field is being tested. - * - * @return boolean True if the value is valid integer, false otherwise. - * - */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) - { - // Check if the field is required. - $required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required'); - - // If the value is empty and the field is not required return True. - if (($value === '' || $value === null) && ! $required) - { - return true; - } - - // now validate the value to be an integer - // we need to validate a string with the integer in it - // since this is how Joomla passes the value to the test method - // so we use type coercion along with is_numeric - return is_numeric($value) && is_int(+$value); - // if you have a better idea... lets hear it. - } -} diff --git a/tmpl/default.php b/tmpl/default.php index ec1874c..37f688a 100644 --- a/tmpl/default.php +++ b/tmpl/default.php @@ -90,13 +90,13 @@ defined('_JEXEC') or die('Restricted access'); coordinates(new DateTime($branch->start)); - $x_bug = $helper->coordinates(new DateTime($branch->bug)); $x_eol = $helper->coordinates(new DateTime($branch->end)); + $x_security = (empty($branch->security)) ? $x_eol : $helper->coordinates(new DateTime($branch->security)); ?> - + width="" height="get('branch_height', 30); ?>"/> +