diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2026-02-10 23:43:06 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2026-02-10 23:43:06 +0000 |
| commit | 34c8190846b2eeed79307c76a6fd30a7eb679d54 (patch) | |
| tree | f9eb1034971644c535595cc5fa0566e723bad826 | |
| parent | 52e8ff16768e6e8a565b1fa9fb835e61029a4e3f (diff) | |
| download | webtrees-34c8190846b2eeed79307c76a6fd30a7eb679d54.tar.gz webtrees-34c8190846b2eeed79307c76a6fd30a7eb679d54.tar.bz2 webtrees-34c8190846b2eeed79307c76a6fd30a7eb679d54.zip | |
Fix: #4465 - increase limit on generations in charts
| -rw-r--r-- | app/Module/AncestorsChartModule.php | 2 | ||||
| -rw-r--r-- | app/Module/DescendancyChartModule.php | 2 | ||||
| -rw-r--r-- | app/Module/FamilyBookChartModule.php | 2 | ||||
| -rw-r--r-- | app/Module/HourglassChartModule.php | 2 | ||||
| -rw-r--r-- | app/Module/PedigreeMapModule.php | 19 | ||||
| -rw-r--r-- | resources/views/modules/family-book-chart/page.phtml | 2 | ||||
| -rw-r--r-- | resources/views/modules/hourglass-chart/page.phtml | 2 | ||||
| -rw-r--r-- | resources/views/modules/pedigree-map/page.phtml | 6 |
8 files changed, 20 insertions, 17 deletions
diff --git a/app/Module/AncestorsChartModule.php b/app/Module/AncestorsChartModule.php index 3a6b7972d8..d327ce1bbe 100644 --- a/app/Module/AncestorsChartModule.php +++ b/app/Module/AncestorsChartModule.php @@ -55,7 +55,7 @@ class AncestorsChartModule extends AbstractModule implements ModuleChartInterfac // Limits protected const int MINIMUM_GENERATIONS = 2; - protected const int MAXIMUM_GENERATIONS = 10; + protected const int MAXIMUM_GENERATIONS = PHP_INT_SIZE === 4 ? 31 : 63; private ChartService $chart_service; diff --git a/app/Module/DescendancyChartModule.php b/app/Module/DescendancyChartModule.php index af8a6836c3..c93c771df7 100644 --- a/app/Module/DescendancyChartModule.php +++ b/app/Module/DescendancyChartModule.php @@ -55,7 +55,7 @@ class DescendancyChartModule extends AbstractModule implements ModuleChartInterf // Limits protected const int MINIMUM_GENERATIONS = 2; - protected const int MAXIMUM_GENERATIONS = 10; + protected const int MAXIMUM_GENERATIONS = PHP_INT_SIZE === 4 ? 31 : 63; private ChartService $chart_service; diff --git a/app/Module/FamilyBookChartModule.php b/app/Module/FamilyBookChartModule.php index 5203ac9cfe..2a83b4b988 100644 --- a/app/Module/FamilyBookChartModule.php +++ b/app/Module/FamilyBookChartModule.php @@ -53,7 +53,7 @@ class FamilyBookChartModule extends AbstractModule implements ModuleChartInterfa protected const int MAXIMUM_BOOK_SIZE = 5; protected const int MINIMUM_GENERATIONS = 2; - protected const int MAXIMUM_GENERATIONS = 10; + protected const int MAXIMUM_GENERATIONS = PHP_INT_SIZE === 4 ? 31 : 63; /** * Initialization. diff --git a/app/Module/HourglassChartModule.php b/app/Module/HourglassChartModule.php index 7f1ab103c7..108ce3f8da 100644 --- a/app/Module/HourglassChartModule.php +++ b/app/Module/HourglassChartModule.php @@ -52,7 +52,7 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac // Limits protected const int MINIMUM_GENERATIONS = 2; - protected const int MAXIMUM_GENERATIONS = 10; + protected const int MAXIMUM_GENERATIONS = PHP_INT_SIZE === 4 ? 31 : 63; /** * Initialization. diff --git a/app/Module/PedigreeMapModule.php b/app/Module/PedigreeMapModule.php index 2b29475c02..4dff9b533f 100644 --- a/app/Module/PedigreeMapModule.php +++ b/app/Module/PedigreeMapModule.php @@ -44,6 +44,8 @@ use function route; use function ucfirst; use function view; +use const PHP_INT_SIZE; + class PedigreeMapModule extends AbstractModule implements ModuleChartInterface, RequestHandlerInterface { use ModuleChartTrait; @@ -58,7 +60,7 @@ class PedigreeMapModule extends AbstractModule implements ModuleChartInterface, // Limits public const int MINIMUM_GENERATIONS = 1; - public const int MAXIMUM_GENERATIONS = 10; + public const int MAXIMUM_GENERATIONS = PHP_INT_SIZE === 4 ? 31 : 63; // CSS colors for each generation protected const int COUNT_CSS_COLORS = 12; @@ -192,14 +194,15 @@ class PedigreeMapModule extends AbstractModule implements ModuleChartInterface, ]); return $this->viewResponse('modules/pedigree-map/page', [ - 'module' => $this->name(), + 'module' => $this->name(), /* I18N: %s is an individual’s name */ - 'title' => I18N::translate('Pedigree map of %s', $individual->fullName()), - 'tree' => $tree, - 'individual' => $individual, - 'generations' => $generations, - 'maxgenerations' => self::MAXIMUM_GENERATIONS, - 'map' => $map, + 'title' => I18N::translate('Pedigree map of %s', $individual->fullName()), + 'tree' => $tree, + 'individual' => $individual, + 'generations' => $generations, + 'minimum_generations' => self::MINIMUM_GENERATIONS, + 'maximum_generations' => self::MAXIMUM_GENERATIONS, + 'map' => $map, ]); } diff --git a/resources/views/modules/family-book-chart/page.phtml b/resources/views/modules/family-book-chart/page.phtml index 5f66742aa5..472e9c52c0 100644 --- a/resources/views/modules/family-book-chart/page.phtml +++ b/resources/views/modules/family-book-chart/page.phtml @@ -50,7 +50,7 @@ use Fisharebest\Webtrees\Tree; <?= I18N::translate('Descendant generations') ?> </label> <div class="col-sm-9 wt-page-options-value"> - <?= view('components/select-number', ['name' => 'generations', 'selected' => $generations, 'options' => range($minimum_generations, $maximum_generations)]) ?> + <input class="form-control" id="generations" name="generations" type="number" min="<?= e($minimum_generations) ?>" max="<?= e($maximum_generations) ?>" value="<?= e($generations) ?>" required="required"> </div> </div> diff --git a/resources/views/modules/hourglass-chart/page.phtml b/resources/views/modules/hourglass-chart/page.phtml index 96d9633e27..c54217ae07 100644 --- a/resources/views/modules/hourglass-chart/page.phtml +++ b/resources/views/modules/hourglass-chart/page.phtml @@ -38,7 +38,7 @@ use Fisharebest\Webtrees\Tree; <?= I18N::translate('Generations') ?> </label> <div class="col-sm-9 wt-page-options-value"> - <?= view('components/select-number', ['name' => 'generations', 'selected' => $generations, 'options' => range($minimum_generations, $maximum_generations)]) ?> + <input class="form-control" id="generations" name="generations" type="number" min="<?= e($minimum_generations) ?>" max="<?= e($maximum_generations) ?>" value="<?= e($generations) ?>" required="required"> </div> </div> diff --git a/resources/views/modules/pedigree-map/page.phtml b/resources/views/modules/pedigree-map/page.phtml index d407484020..c5dea7cd73 100644 --- a/resources/views/modules/pedigree-map/page.phtml +++ b/resources/views/modules/pedigree-map/page.phtml @@ -10,7 +10,8 @@ use Fisharebest\Webtrees\Tree; * @var int $generations * @var Individual $individual * @var string $map - * @var int $maxgenerations + * @var int $maximum_generations + * @var int $minimum_generations * @var string $title * @var Tree $tree */ @@ -34,7 +35,7 @@ use Fisharebest\Webtrees\Tree; <?= I18N::translate('Generations') ?> </label> <div class="col-sm-9 wt-page-options-value"> - <?= view('components/select-number', ['name' => 'generations', 'selected' => $generations, 'options' => range(2, $maxgenerations)]) ?> + <input class="form-control" id="generations" name="generations" type="number" min="<?= e($minimum_generations) ?>" max="<?= e($maximum_generations) ?>" value="<?= e($generations) ?>" required="required"> </div> </div> @@ -54,4 +55,3 @@ use Fisharebest\Webtrees\Tree; <div class="wt-ajax-load wt-page-content"> <?= $map ?> </div> - |
