diff --git a/include/class/card_attribut_mtable.class.php b/include/class/card_attribut_mtable.class.php index 2933dae01..7b468f41f 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 a6a8e214a..98aee882c 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 7133a0a05..ee7184195 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) {