noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 02/23: Fix cosmetic


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 02/23: Fix cosmetic
Date: Sun, 26 Feb 2023 14:47:29 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 74a8d5e1ba9a1231f2580054f6ae2264b23b9744
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Tue Feb 7 17:04:11 2023 +0100

    Fix cosmetic
---
 include/lib/manage_table_sql.class.php | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/include/lib/manage_table_sql.class.php 
b/include/lib/manage_table_sql.class.php
index 75d82beb3..8776db174 100644
--- a/include/lib/manage_table_sql.class.php
+++ b/include/lib/manage_table_sql.class.php
@@ -443,12 +443,12 @@ function check()
             throw new Exception("invalid key $p_key");
 
         if (!in_array($p_value,
-                        array("text", "numeric", "numeric4","numeric6","date", 
"select", "timestamp","custom")))
+                        array("text", "numeric","numeric2", 
"numeric4","numeric6","date", "select", "timestamp","custom")))
             throw new Exception("invalid type $p_value");
 
         $this->a_type[$p_key]=$p_value;
         $this->a_select[$p_key]=$p_array;
-        if ( in_array($p_value ,array("numeric","numeric4","numeric6")) && 
$this->a_col_option[$p_key]=="") {
+        if ( in_array($p_value 
,array("numeric","numeric2","numeric4","numeric6")) && 
$this->a_col_option[$p_key]=="") {
             $this->a_col_option[$p_key]=' class="num" ';
         }
          
@@ -1027,9 +1027,13 @@ function check()
                 if (  $this->get_col_type($v) == 'text') {
                     echo td($p_row[$v],sprintf(' sorttable_customkey="X%s" 
',$p_row[$v]));
                 } elseif ( $this->get_col_type($v) == 'numeric') {
+                    echo td($p_row[$v],$this->a_col_option[$v]);
+                } elseif ( $this->get_col_type($v) == 'numeric2') {
                     echo td(nbm($p_row[$v],2),$this->a_col_option[$v]);
                 } elseif ( $this->get_col_type($v) == 'numeric4') {
                     echo td(nbm($p_row[$v],4),$this->a_col_option[$v]);
+                }  elseif ( $this->get_col_type($v) == 'numeric6') {
+                    echo td(nbm($p_row[$v],6),$this->a_col_option[$v]);
                 }  elseif ($this->get_col_type($v)=="custom") {
                     // For custom col
                     echo $this->display_row_custom($v,$p_row[$v],$pk_id);
@@ -1074,8 +1078,10 @@ function check()
                     // For custom col
                     echo $this->display_row_custom($v,$p_row[$v],$pk_id);
                 } elseif ( $this->get_col_type($v) == 'numeric') {
+                    echo td($p_row[$v],$this->a_col_option[$v]);
+                } elseif ( $this->get_col_type($v) == 'numeric2') {
                     echo td(nbm($p_row[$v],2),$this->a_col_option[$v]);
-                } elseif ( $this->get_col_type($v) == 'numeric4') {
+                }elseif ( $this->get_col_type($v) == 'numeric4') {
                     echo td(nbm($p_row[$v],4),$this->a_col_option[$v]);
                 }elseif ( $this->get_col_type($v) == 'numeric6') {
                     echo td(nbm($p_row[$v],6),$this->a_col_option[$v]);
@@ -1182,10 +1188,18 @@ function check()
                         $text->size=$min_size;
                         echo $text->input();
                     }
-                    elseif ($this->a_type[$key]=="numeric") // number 2 
decimale
+                    elseif ($this->a_type[$key]=="numeric") // number from db
+                    {
+                        $text=new INum($key);
+                        $text->value=$value;
+                        
$min_size=(noalyss_strlen($value)<10)?10:strlen($value)+1;
+                        $text->size=$min_size;
+                        echo $text->input();
+                    }
+                    elseif ($this->a_type[$key]=="numeric2") // number from db
                     {
                         $text=new INum($key);
-                        $text->prec=2;
+                        $this->prec=2;
                         $text->value=round($value??"0",2);
                         
$min_size=(noalyss_strlen($value)<10)?10:strlen($value)+1;
                         $text->size=$min_size;



reply via email to

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