<?php
/*
$Id: modeletelecom.class.php,v 1.2 2007-03-14 12:38:11 fgiva Exp $
*/
require_once ("formulaire.class.php");
require_once ("modeleelement.class.php");

class modeletelecom extends modeleelement {

function modeletelecom($id,&$db,$DEBUG,$nature) {
  $this->constructeur($id,$db,$DEBUG);
  $this->nature=$nature;
  $this->classe="telecom";
} // fin constructeur

function setvalF($val){
  parent::setvalF($val);
  switch ($this->nature) {
  case "telephone":
    $this->valF['reseau'] = $val['reseau'];
  }
}

function setType(&$form,$maj) {
  parent::setType($form,$maj);  //sans& 
  if ($maj < 2) { //ajouter et modifier
    switch ($this->nature) {
    case "telephone":
      $form->setType('reseau','select');
    }
  }
}

function setSelect(&$form, $maj,$db,$debug) {
  parent::setSelect($form, $maj,$db,$debug);  //sans& 
  if($maj<2){
    $contenuON=array();
    $contenuON[0]=array('f','v');
    $contenuON[1]=array('Non','Oui');
    switch ($this->nature) {
    case "telephone":
       $form->setSelect("reseau",$contenuON);
    }
  }
}

function setLib(&$form,$maj) {
  parent::setLib($form,$maj);  //sans& 
  switch ($this->nature) {
  case "telephone":
    $form->setLib('reseau','VoIP');
  }
}

}// fin de classe
?>