From 00eb35b2beadc3dc354183ba8641156fd979dfea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Mon, 5 Aug 2019 23:27:47 -0300 Subject: [PATCH] Use the router the for the browse foreigners page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- index.php | 3 +++ libraries/classes/BrowseForeigners.php | 8 ++++---- libraries/classes/InsertEdit.php | 4 +++- .../entry_points/browse_foreigners.php | 6 ++---- templates/sql/relational_column_dropdown.twig | 2 +- templates/table/search/input_box.twig | 2 +- test/classes/BrowseForeignersTest.php | 6 +++++- test/classes/InsertEditTest.php | 7 +++++-- 8 files changed, 24 insertions(+), 14 deletions(-) rename browse_foreigners.php => libraries/entry_points/browse_foreigners.php (92%) diff --git a/index.php b/index.php index 9368f2b940..3b84e406f4 100644 --- a/index.php +++ b/index.php @@ -28,6 +28,9 @@ if (isset($_GET['route']) || isset($_POST['route'])) { $routes->addRoute(['GET', 'POST'], '/ajax', function () { require_once ROOT_PATH . 'libraries/entry_points/ajax.php'; }); + $routes->addRoute(['GET', 'POST'], '/browse_foreigners', function () { + require_once ROOT_PATH . 'libraries/entry_points/browse_foreigners.php'; + }); $routes->addGroup('/database', function (RouteCollector $routes) { $routes->addRoute(['GET', 'POST'], '/central_columns', function () { require_once ROOT_PATH . 'libraries/entry_points/database/central_columns.php'; diff --git a/libraries/classes/BrowseForeigners.php b/libraries/classes/BrowseForeigners.php index cc5216866a..d4685770dc 100644 --- a/libraries/classes/BrowseForeigners.php +++ b/libraries/classes/BrowseForeigners.php @@ -1,7 +1,7 @@ ' - . '
' + . 'id="browse_foreign_form" name="browse_foreign_from" action="' + . Url::getFromRoute('/browse_foreigners') + . '" method="post">
' . Url::getHiddenInputs($db, $table) . '' diff --git a/libraries/classes/InsertEdit.php b/libraries/classes/InsertEdit.php index c6d06c67ea..db2621b522 100644 --- a/libraries/classes/InsertEdit.php +++ b/libraries/classes/InsertEdit.php @@ -883,7 +883,9 @@ class InsertEdit . 'id="field_' . $idindex . '_3" ' . 'value="' . htmlspecialchars($data) . '">'; - $html_output .= '{{ current_value }} - + {% trans 'Browse foreign values' %} diff --git a/templates/table/search/input_box.twig b/templates/table/search/input_box.twig index 5c30535bd7..75c025bd71 100644 --- a/templates/table/search/input_box.twig +++ b/templates/table/search/input_box.twig @@ -20,7 +20,7 @@ {% if criteria_values[column_index] is defined %} value="{{ criteria_values[column_index] }}" {% endif %}> - diff --git a/test/classes/BrowseForeignersTest.php b/test/classes/BrowseForeignersTest.php index 825db139e8..eea6923d01 100644 --- a/test/classes/BrowseForeignersTest.php +++ b/test/classes/BrowseForeignersTest.php @@ -220,7 +220,11 @@ class BrowseForeignersTest extends TestCase $this->assertStringContainsString( '
', + . 'action="index.php?route=/browse_foreigners', + $result + ); + $this->assertStringContainsString( + '" method="post">', $result ); diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index 2f84c13cd6..67358ef65b 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -1023,11 +1023,14 @@ class InsertEditTest extends TestCase ); $this->assertStringContainsString( - '', $result ); + $this->assertStringContainsString( + '