noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 68/119: Add new type of attribute : check


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 68/119: Add new type of attribute : check
Date: Mon, 26 Oct 2020 18:27:24 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 1b041e65de5d508c1af1619e11f316b94701d809
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Sat Oct 10 19:34:30 2020 +0200

    Add new type of attribute : check
---
 include/class/card_attribut_mtable.class.php |  2 ++
 include/class/fiche.class.php                | 16 ++++++++++++++++
 include/class/fiche_attr.class.php           |  2 +-
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/include/class/card_attribut_mtable.class.php 
b/include/class/card_attribut_mtable.class.php
index 2933dae..7b468f4 100644
--- a/include/class/card_attribut_mtable.class.php
+++ b/include/class/card_attribut_mtable.class.php
@@ -54,11 +54,13 @@ class Card_Attribut_MTable extends Manage_Table_SQL
                     ["value"=>"select", "label"=>_("Choix")],
                     ["value"=>"card", "label"=>_("Fiche")],
                     ["value"=>"zone", "label"=>_("Zone de texte")],
+                    ["value"=>"check", "label"=>_("Coche")],
                     ["value"=>"poste", "label"=>_("Poste comptable")]
         ));
         $this->set_col_tips("ad_search_followup", 77);
         // to prevent a call to this function for each row
         $this->dossier_id=Dossier::id();
+        $this->set_col_sort(1);
     }
 
     /**
diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index a6a8e21..98aee88 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -29,6 +29,7 @@ require_once NOALYSS_INCLUDE.'/class/fiche_def.class.php';
 require_once NOALYSS_INCLUDE.'/lib/iposte.class.php';
 require_once NOALYSS_INCLUDE.'/class/acc_operation.class.php';
 require_once NOALYSS_INCLUDE.'/class/acc_account.class.php';
+require_once NOALYSS_INCLUDE."/lib/input_switch.class.php";
 
 /*! \file
  * \brief define Class fiche, this class are using
@@ -502,6 +503,11 @@ class Fiche
                             $w->table = 1;
                             $bulle = Icon_Action::infobulle(14);
                             break;
+                    case 'check':
+                            $w=new InputSwitch("av_text".$r->ad_id);
+                            $w->value=$r->av_text;
+                            $w->value=(trim($w->value)=="")?1:$w->value;
+                            break;
                     case 'select':
                             $w = new ISelect("av_text" . $attr->ad_id);
                             $w->value = $this->cn->make_array($attr->ad_extra);
@@ -641,6 +647,11 @@ class Fiche
                             $w->style=' class="itextarea" 
style="margin:0px;width:100%"';
                             $w->value=$r->av_text;
                             break;
+                        case 'check':
+                            $w=new InputSwitch("av_text".$r->ad_id);
+                             $w->value=$r->av_text;
+                            $w->value=(trim($w->value)=="")?1:$w->value;
+                            break;
                         case 'poste':
                             $w=new IPoste("av_text".$r->ad_id);
                             $w->set_attribute('ipopup', 'ipop_account');
@@ -711,6 +722,11 @@ class Fiche
                         $value=$x->display();
                         $w->value=$value;
                         break;
+                    case 'check':
+                       $w=new InputSwitch("av_text".$r->ad_id);
+                       $w->value=$r->av_text;
+                       $w->value=(trim($w->value)=="")?1:$w->value;
+                       break;
                     default:
                         $w->value=$r->av_text;
                 }
diff --git a/include/class/fiche_attr.class.php 
b/include/class/fiche_attr.class.php
index 7133a0a..ee71841 100644
--- a/include/class/fiche_attr.class.php
+++ b/include/class/fiche_attr.class.php
@@ -39,7 +39,7 @@ class Fiche_Attr extends Attr_def_SQL
         if (strlen(trim($this->ad_type))==0)
             throw new Exception('Le type ne peut pas ĂȘtre vide', 1);
         $this->ad_type=strtolower($this->ad_type);
-        if (in_array($this->ad_type, array('date', 'text', 'numeric', 'zone', 
'poste', 'card', 'select'))==false)
+        if (in_array($this->ad_type, array('date', 'text', 'numeric', 'zone', 
'poste', 'card', 'select','check'))==false)
             throw new Exception('Le type doit ĂȘtre text, numeric,poste, card, 
select ou date', 1);
         if 
(trim($this->ad_size)==''||isNumber($this->ad_size)==0||$this->ad_size>22)
         {



reply via email to

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