From 06a1b4f22606102af7930d4e08eecfecf042cb96 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 24 May 2017 15:25:41 -0400 Subject: [PATCH] adding back button to detail view page, fixing random php warnings changing the search form methods from post to get. adding back button to detail page. fixing detail view issues with the newspaper date and the file upload locations --- css/front.css | 14 ++++++++++++++ models/front/obits/detail.php | 9 +++++++-- models/front/obits/search.php | 9 ++++++--- views/front/obits/detail.html | 13 +++++-------- views/front/obits/search.html | 2 +- views/front/obits/searchResults.html | 11 ++++++----- 6 files changed, 39 insertions(+), 19 deletions(-) diff --git a/css/front.css b/css/front.css index a5f822c..0e582e4 100644 --- a/css/front.css +++ b/css/front.css @@ -298,3 +298,17 @@ table tr.odd, table tr.alt, table tr:nth-of-type(n){ display: block; text-decoration: none; } +.back-search{ + padding: 5px; + background: #a42600; + color: white; + float: left; + border-radius: 2px; +} +.back-search:hover{ + color: white; + text-decoration: none; +} +.detail-wrapper .detail-value{ + word-break: break-all; +} diff --git a/models/front/obits/detail.php b/models/front/obits/detail.php index 7d73357..8be3a95 100644 --- a/models/front/obits/detail.php +++ b/models/front/obits/detail.php @@ -97,12 +97,17 @@ class GlmMembersFront_obits_detail extends GlmDataObits $obit = $this->getList($where); $obit = array_values($obit)[0]; - $article = $article_url . '/files/'.$obit['obit_article']; + $article = $article_url . '/files/' . $obit['obit_article']; + $article_b = $article_url . '/files/' . $obit['article_b']; + $article_c = $article_url . '/files/' . $obit['article_c']; // Compile template data $templateData = array( 'obit' => $obit, - 'article' => $article + 'article' => $article, + 'article_b' => $article_b, + 'article_c' => $article_c, + ); // Return status, any suggested view, and any data to controller return array( diff --git a/models/front/obits/search.php b/models/front/obits/search.php index d792e04..1626818 100644 --- a/models/front/obits/search.php +++ b/models/front/obits/search.php @@ -104,6 +104,9 @@ class GlmMembersFront_obits_search extends GlmDataObits $empty_search = false; $search_fields = false; $clause = ''; + $search_options = ''; + $empty_values = ''; + $where = ''; $this->table = GLM_MEMBERS_OBITS_PLUGIN_DB_PREFIX . 'obits'; @@ -119,7 +122,7 @@ class GlmMembersFront_obits_search extends GlmDataObits // only execute search if the search button is clicked or there are search params in the url if ( isset( $_REQUEST['searchButton'] ) || !empty( $_GET['alpha'] ) || !empty( $_GET['pageSelect'] ) ){ - $form_data = $_POST; + $form_data = $_REQUEST; // build array of potential search fields , will be used in the paging url $form_fields = array( @@ -203,7 +206,7 @@ class GlmMembersFront_obits_search extends GlmDataObits } // build the initial sql query based on the search fields and search options selected - If(!empty($search_fields)){ + If(!empty($search_fields && !empty($search_options))){ foreach($search_fields as $field => $f){ foreach($search_options as $option => $o){ @@ -322,7 +325,7 @@ class GlmMembersFront_obits_search extends GlmDataObits $alphaSelected = false; // Check for alpha selected - if ($actionData['request']['alpha'] && strlen($actionData['request']['alpha']) == 1) { + if (array_key_exists('alpha', $actionData['request'])) { $alphaSelected = strtoupper($actionData['request']['alpha']); } diff --git a/views/front/obits/detail.html b/views/front/obits/detail.html index 8c25b9c..f6de910 100644 --- a/views/front/obits/detail.html +++ b/views/front/obits/detail.html @@ -1,4 +1,6 @@ +Back to Search
+ {$obit|@print_r} @@ -58,19 +60,14 @@
- -
Article A:
-
{$obit.article_a}
-
-
Article B:
-
{$obit.article_b}
+
Article C:
-
{$obit.article_c}
+
@@ -80,7 +77,7 @@
Newspaper Date:
-
{$obit.newspaper_data}
+
{$obit.newspaper_date}
diff --git a/views/front/obits/search.html b/views/front/obits/search.html index fcb426d..1baefc2 100644 --- a/views/front/obits/search.html +++ b/views/front/obits/search.html @@ -1,6 +1,6 @@
-
+
- +
@@ -78,7 +79,7 @@
- +
@@ -204,7 +205,7 @@
- +
-- 2.17.1