noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 07/13: issue #1 : manage_table_sql , there is


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 07/13: issue #1 : manage_table_sql , there is a bug with the type select
Date: Sat, 15 Sep 2018 17:18:56 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 1b55462d1c401f720bcb2462615043ad050118f9
Author: Dany De Bontridder <address@hidden>
Date:   Mon Aug 6 12:18:46 2018 +0200

    issue #1 : manage_table_sql , there is a bug with the type select
---
 include/lib/manage_table_sql.class.php | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/include/lib/manage_table_sql.class.php 
b/include/lib/manage_table_sql.class.php
index fc42f21..87427d3 100644
--- a/include/lib/manage_table_sql.class.php
+++ b/include/lib/manage_table_sql.class.php
@@ -806,9 +806,29 @@ function check()
             {
                 if ( $this->get_col_type($v)=="select")
                 {
+                    /**
+                     * we translate the code from the database into a 
hardcoded label
+                     */
                     $idx=$p_row[$v];
                     if ( ! isset($this->a_select[$v][$idx])) {
-                        echo td("--");
+                        /*
+                        * Check if index exists
+                        */
+                        $array_to_search=$this->a_select[$v];
+                        $value=$p_row[$v];
+                        $nb_search=count($array_to_search);
+                        $found=FALSE;
+                        for ( $e=0;$e< $nb_search;$e++) {
+                            if (isset ($array_to_search[$e]['value']) && 
$array_to_search[$e]['value']==$value ) {
+                                $found=TRUE;
+                                echo td($array_to_search[$e]['label']);
+                            }
+                        }
+
+                        if ( ! $found) {
+                            echo td("--");
+
+                        }
                     } else {
                         echo td($this->a_select[$v][$idx]["label"]);
                     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]