<?php
//$Id$ 
//gen openMairie le 05/10/2012 13:55

require_once ("../obj/om_dbform.class.php");

class instruction_gen extends om_dbform {
    var $table="instruction";
    var $clePrimaire="instruction";
    var $typeCle="N";
    var $required_field=array(
        "datecourrier",
        "evenement",
        "instruction"
    );
    var $retourformulaire;

    function setvalF($val) {
        //affectation valeur formulaire
        if (!is_numeric($val['instruction'])) {
            $this->valF['instruction'] = ""; // -> requis
        } else {
            $this->valF['instruction'] = $val['instruction'];
        }
        if ($val['destinataire'] == "") {
            $this->valF['destinataire'] = ""; // -> default
        } else {
            $this->valF['destinataire'] = $val['destinataire'];
        }
        if ($val['datecourrier'] != "") {
            $this->valF['datecourrier'] = $this->dateDB($val['datecourrier']);
        }
        if (!is_numeric($val['evenement'])) {
            $this->valF['evenement'] = ""; // -> requis
        } else {
            $this->valF['evenement'] = $val['evenement'];
        }
        if ($val['lettretype'] == "") {
            $this->valF['lettretype'] = ""; // -> default
        } else {
            $this->valF['lettretype'] = $val['lettretype'];
        }
            $this->valF['complement'] = $val['complement'];
            $this->valF['complement2'] = $val['complement2'];
        if ($val['dossier'] == "") {
            $this->valF['dossier'] = NULL;
        } else {
            $this->valF['dossier'] = $val['dossier'];
        }
        if ($val['action'] == "") {
            $this->valF['action'] = NULL;
        } else {
            $this->valF['action'] = $val['action'];
        }
        if (!is_numeric($val['delai'])) {
            $this->valF['delai'] = NULL;
        } else {
            $this->valF['delai'] = $val['delai'];
        }
        if ($val['etat'] == "") {
            $this->valF['etat'] = NULL;
        } else {
            $this->valF['etat'] = $val['etat'];
        }
        if ($val['accord_tacite'] == "") {
            $this->valF['accord_tacite'] = ""; // -> default
        } else {
            $this->valF['accord_tacite'] = $val['accord_tacite'];
        }
        if (!is_numeric($val['delai_notification'])) {
            $this->valF['delai_notification'] = 0; // -> default
        } else {
            $this->valF['delai_notification'] = $val['delai_notification'];
        }
        if ($val['avis'] == "") {
            $this->valF['avis'] = NULL;
        } else {
            $this->valF['avis'] = $val['avis'];
        }
        if (!is_numeric($val['archive_delai'])) {
            $this->valF['archive_delai'] = 0; // -> default
        } else {
            $this->valF['archive_delai'] = $val['archive_delai'];
        }
        if ($val['archive_date_complet'] != "") {
            $this->valF['archive_date_complet'] = $this->dateDB($val['archive_date_complet']);
        } else {
            $this->valF['archive_date_complet'] = NULL;
        }
        if ($val['archive_date_rejet'] != "") {
            $this->valF['archive_date_rejet'] = $this->dateDB($val['archive_date_rejet']);
        } else {
            $this->valF['archive_date_rejet'] = NULL;
        }
        if ($val['archive_date_limite'] != "") {
            $this->valF['archive_date_limite'] = $this->dateDB($val['archive_date_limite']);
        } else {
            $this->valF['archive_date_limite'] = NULL;
        }
        if ($val['archive_date_notification_delai'] != "") {
            $this->valF['archive_date_notification_delai'] = $this->dateDB($val['archive_date_notification_delai']);
        } else {
            $this->valF['archive_date_notification_delai'] = NULL;
        }
        if ($val['archive_accord_tacite'] == "") {
            $this->valF['archive_accord_tacite'] = ""; // -> default
        } else {
            $this->valF['archive_accord_tacite'] = $val['archive_accord_tacite'];
        }
        if ($val['archive_etat'] == "") {
            $this->valF['archive_etat'] = ""; // -> default
        } else {
            $this->valF['archive_etat'] = $val['archive_etat'];
        }
        if ($val['archive_date_decision'] != "") {
            $this->valF['archive_date_decision'] = $this->dateDB($val['archive_date_decision']);
        } else {
            $this->valF['archive_date_decision'] = NULL;
        }
        if ($val['archive_avis'] == "") {
            $this->valF['archive_avis'] = ""; // -> default
        } else {
            $this->valF['archive_avis'] = $val['archive_avis'];
        }
        if ($val['archive_date_validite'] != "") {
            $this->valF['archive_date_validite'] = $this->dateDB($val['archive_date_validite']);
        } else {
            $this->valF['archive_date_validite'] = NULL;
        }
        if ($val['archive_date_achevement'] != "") {
            $this->valF['archive_date_achevement'] = $this->dateDB($val['archive_date_achevement']);
        } else {
            $this->valF['archive_date_achevement'] = NULL;
        }
        if ($val['archive_date_chantier'] != "") {
            $this->valF['archive_date_chantier'] = $this->dateDB($val['archive_date_chantier']);
        } else {
            $this->valF['archive_date_chantier'] = NULL;
        }
        if ($val['archive_date_conformite'] != "") {
            $this->valF['archive_date_conformite'] = $this->dateDB($val['archive_date_conformite']);
        } else {
            $this->valF['archive_date_conformite'] = NULL;
        }
            $this->valF['complement3'] = $val['complement3'];
            $this->valF['complement4'] = $val['complement4'];
            $this->valF['complement5'] = $val['complement5'];
            $this->valF['complement6'] = $val['complement6'];
            $this->valF['complement7'] = $val['complement7'];
            $this->valF['complement8'] = $val['complement8'];
            $this->valF['complement9'] = $val['complement9'];
            $this->valF['complement10'] = $val['complement10'];
            $this->valF['complement11'] = $val['complement11'];
            $this->valF['complement12'] = $val['complement12'];
            $this->valF['complement13'] = $val['complement13'];
            $this->valF['complement14'] = $val['complement14'];
            $this->valF['complement15'] = $val['complement15'];
    }

    //=================================================
    //cle primaire automatique [automatic primary key]
    //==================================================

    function setId(&$db) {
    //numero automatique
        $this->valF[$this->clePrimaire] = $db->nextId(DB_PREFIXE.$this->table);
    }

    function setValFAjout($val) {
    //numero automatique -> pas de controle ajout cle primaire
    }

    function verifierAjout() {
    //numero automatique -> pas de verfication de cle primaire
    }

    //==========================
    // Formulaire  [form]
    //==========================

    function setType(&$form,$maj) {
        //type
        if ($maj==0){ //ajout
            $form->setType('instruction','hidden');// cle automatique
            $form->setType('destinataire','text');
            if($this->retourformulaire=='')
                $form->setType('datecourrier','date');
            else
                $form->setType('datecourrier','date2');

            if($this->retourformulaire=='evenement'
               and $form->val['evenement'] == $this->getParameter('idxformulaire')) {
                $form->setType('evenement','selecthiddenstatic');
            } else {
                $form->setType('evenement','select');
            }
            $form->setType('lettretype','text');
            $form->setType('complement','textarea');
            $form->setType('complement2','textarea');

            if($this->retourformulaire=='dossier'
               and $form->val['dossier'] == $this->getParameter('idxformulaire')) {
                $form->setType('dossier','selecthiddenstatic');
            } else {
                $form->setType('dossier','select');
            }

            if($this->retourformulaire=='action'
               and $form->val['action'] == $this->getParameter('idxformulaire')) {
                $form->setType('action','selecthiddenstatic');
            } else {
                $form->setType('action','select');
            }
            $form->setType('delai','text');

            if($this->retourformulaire=='etat'
               and $form->val['etat'] == $this->getParameter('idxformulaire')) {
                $form->setType('etat','selecthiddenstatic');
            } else {
                $form->setType('etat','select');
            }
            $form->setType('accord_tacite','text');
            $form->setType('delai_notification','text');

            if($this->retourformulaire=='avis'
               and $form->val['avis'] == $this->getParameter('idxformulaire')) {
                $form->setType('avis','selecthiddenstatic');
            } else {
                $form->setType('avis','select');
            }
            $form->setType('archive_delai','text');
            if($this->retourformulaire=='')
                $form->setType('archive_date_complet','date');
            else
                $form->setType('archive_date_complet','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_rejet','date');
            else
                $form->setType('archive_date_rejet','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_limite','date');
            else
                $form->setType('archive_date_limite','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_notification_delai','date');
            else
                $form->setType('archive_date_notification_delai','date2');
            $form->setType('archive_accord_tacite','text');
            $form->setType('archive_etat','text');
            if($this->retourformulaire=='')
                $form->setType('archive_date_decision','date');
            else
                $form->setType('archive_date_decision','date2');
            $form->setType('archive_avis','text');
            if($this->retourformulaire=='')
                $form->setType('archive_date_validite','date');
            else
                $form->setType('archive_date_validite','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_achevement','date');
            else
                $form->setType('archive_date_achevement','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_chantier','date');
            else
                $form->setType('archive_date_chantier','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_conformite','date');
            else
                $form->setType('archive_date_conformite','date2');
            $form->setType('complement3','textarea');
            $form->setType('complement4','textarea');
            $form->setType('complement5','textarea');
            $form->setType('complement6','textarea');
            $form->setType('complement7','textarea');
            $form->setType('complement8','textarea');
            $form->setType('complement9','textarea');
            $form->setType('complement10','textarea');
            $form->setType('complement11','textarea');
            $form->setType('complement12','textarea');
            $form->setType('complement13','textarea');
            $form->setType('complement14','textarea');
            $form->setType('complement15','textarea');
        }// fin ajout
        if ($maj==1){ //modifier
            $form->setType('instruction','hiddenstatic');
            $form->setType('destinataire','text');
            if($this->retourformulaire=='')
                $form->setType('datecourrier','date');
            else
                $form->setType('datecourrier','date2');

            if($this->retourformulaire=='evenement'
               and $form->val['evenement'] == $this->getParameter('idxformulaire')) {
                $form->setType('evenement','selecthiddenstatic');
            } else {
                $form->setType('evenement','select');
            }
            $form->setType('lettretype','text');
            $form->setType('complement','textarea');
            $form->setType('complement2','textarea');

            if($this->retourformulaire=='dossier'
               and $form->val['dossier'] == $this->getParameter('idxformulaire')) {
                $form->setType('dossier','selecthiddenstatic');
            } else {
                $form->setType('dossier','select');
            }

            if($this->retourformulaire=='action'
               and $form->val['action'] == $this->getParameter('idxformulaire')) {
                $form->setType('action','selecthiddenstatic');
            } else {
                $form->setType('action','select');
            }
            $form->setType('delai','text');

            if($this->retourformulaire=='etat'
               and $form->val['etat'] == $this->getParameter('idxformulaire')) {
                $form->setType('etat','selecthiddenstatic');
            } else {
                $form->setType('etat','select');
            }
            $form->setType('accord_tacite','text');
            $form->setType('delai_notification','text');

            if($this->retourformulaire=='avis'
               and $form->val['avis'] == $this->getParameter('idxformulaire')) {
                $form->setType('avis','selecthiddenstatic');
            } else {
                $form->setType('avis','select');
            }
            $form->setType('archive_delai','text');
            if($this->retourformulaire=='')
                $form->setType('archive_date_complet','date');
            else
                $form->setType('archive_date_complet','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_rejet','date');
            else
                $form->setType('archive_date_rejet','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_limite','date');
            else
                $form->setType('archive_date_limite','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_notification_delai','date');
            else
                $form->setType('archive_date_notification_delai','date2');
            $form->setType('archive_accord_tacite','text');
            $form->setType('archive_etat','text');
            if($this->retourformulaire=='')
                $form->setType('archive_date_decision','date');
            else
                $form->setType('archive_date_decision','date2');
            $form->setType('archive_avis','text');
            if($this->retourformulaire=='')
                $form->setType('archive_date_validite','date');
            else
                $form->setType('archive_date_validite','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_achevement','date');
            else
                $form->setType('archive_date_achevement','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_chantier','date');
            else
                $form->setType('archive_date_chantier','date2');
            if($this->retourformulaire=='')
                $form->setType('archive_date_conformite','date');
            else
                $form->setType('archive_date_conformite','date2');
            $form->setType('complement3','textarea');
            $form->setType('complement4','textarea');
            $form->setType('complement5','textarea');
            $form->setType('complement6','textarea');
            $form->setType('complement7','textarea');
            $form->setType('complement8','textarea');
            $form->setType('complement9','textarea');
            $form->setType('complement10','textarea');
            $form->setType('complement11','textarea');
            $form->setType('complement12','textarea');
            $form->setType('complement13','textarea');
            $form->setType('complement14','textarea');
            $form->setType('complement15','textarea');
        }// fin modifier
        if ($maj==2){ //supprimer
            $form->setType('instruction','hiddenstatic');
            $form->setType('destinataire','hiddenstatic');
            $form->setType('datecourrier','hiddenstatic');
            $form->setType('evenement','selectstatic');
            $form->setType('lettretype','hiddenstatic');
            $form->setType('complement','hiddenstatic');
            $form->setType('complement2','hiddenstatic');
            $form->setType('dossier','selectstatic');
            $form->setType('action','selectstatic');
            $form->setType('delai','hiddenstatic');
            $form->setType('etat','selectstatic');
            $form->setType('accord_tacite','hiddenstatic');
            $form->setType('delai_notification','hiddenstatic');
            $form->setType('avis','selectstatic');
            $form->setType('archive_delai','hiddenstatic');
            $form->setType('archive_date_complet','hiddenstatic');
            $form->setType('archive_date_rejet','hiddenstatic');
            $form->setType('archive_date_limite','hiddenstatic');
            $form->setType('archive_date_notification_delai','hiddenstatic');
            $form->setType('archive_accord_tacite','hiddenstatic');
            $form->setType('archive_etat','hiddenstatic');
            $form->setType('archive_date_decision','hiddenstatic');
            $form->setType('archive_avis','hiddenstatic');
            $form->setType('archive_date_validite','hiddenstatic');
            $form->setType('archive_date_achevement','hiddenstatic');
            $form->setType('archive_date_chantier','hiddenstatic');
            $form->setType('archive_date_conformite','hiddenstatic');
            $form->setType('complement3','hiddenstatic');
            $form->setType('complement4','hiddenstatic');
            $form->setType('complement5','hiddenstatic');
            $form->setType('complement6','hiddenstatic');
            $form->setType('complement7','hiddenstatic');
            $form->setType('complement8','hiddenstatic');
            $form->setType('complement9','hiddenstatic');
            $form->setType('complement10','hiddenstatic');
            $form->setType('complement11','hiddenstatic');
            $form->setType('complement12','hiddenstatic');
            $form->setType('complement13','hiddenstatic');
            $form->setType('complement14','hiddenstatic');
            $form->setType('complement15','hiddenstatic');
        }//fin supprimer
        if ($maj==3){ //consulter
            $form->setType('instruction','static');
            $form->setType('destinataire','static');
            $form->setType('datecourrier','datestatic');
            $form->setType('evenement','selectstatic');
            $form->setType('lettretype','static');
            $form->setType('complement','textareastatic');
            $form->setType('complement2','textareastatic');
            $form->setType('dossier','selectstatic');
            $form->setType('action','selectstatic');
            $form->setType('delai','static');
            $form->setType('etat','selectstatic');
            $form->setType('accord_tacite','static');
            $form->setType('delai_notification','static');
            $form->setType('avis','selectstatic');
            $form->setType('archive_delai','static');
            $form->setType('archive_date_complet','datestatic');
            $form->setType('archive_date_rejet','datestatic');
            $form->setType('archive_date_limite','datestatic');
            $form->setType('archive_date_notification_delai','datestatic');
            $form->setType('archive_accord_tacite','static');
            $form->setType('archive_etat','static');
            $form->setType('archive_date_decision','datestatic');
            $form->setType('archive_avis','static');
            $form->setType('archive_date_validite','datestatic');
            $form->setType('archive_date_achevement','datestatic');
            $form->setType('archive_date_chantier','datestatic');
            $form->setType('archive_date_conformite','datestatic');
            $form->setType('complement3','textareastatic');
            $form->setType('complement4','textareastatic');
            $form->setType('complement5','textareastatic');
            $form->setType('complement6','textareastatic');
            $form->setType('complement7','textareastatic');
            $form->setType('complement8','textareastatic');
            $form->setType('complement9','textareastatic');
            $form->setType('complement10','textareastatic');
            $form->setType('complement11','textareastatic');
            $form->setType('complement12','textareastatic');
            $form->setType('complement13','textareastatic');
            $form->setType('complement14','textareastatic');
            $form->setType('complement15','textareastatic');
        }//fin consulter
    }

    function setOnchange(&$form,$maj) {
    //javascript controle client
        $form->setOnchange('instruction','VerifNum(this)');
        $form->setOnchange('datecourrier','fdate(this)');
        $form->setOnchange('evenement','VerifNum(this)');
        $form->setOnchange('delai','VerifNum(this)');
        $form->setOnchange('delai_notification','VerifNum(this)');
        $form->setOnchange('archive_delai','VerifNum(this)');
        $form->setOnchange('archive_date_complet','fdate(this)');
        $form->setOnchange('archive_date_rejet','fdate(this)');
        $form->setOnchange('archive_date_limite','fdate(this)');
        $form->setOnchange('archive_date_notification_delai','fdate(this)');
        $form->setOnchange('archive_date_decision','fdate(this)');
        $form->setOnchange('archive_date_validite','fdate(this)');
        $form->setOnchange('archive_date_achevement','fdate(this)');
        $form->setOnchange('archive_date_chantier','fdate(this)');
        $form->setOnchange('archive_date_conformite','fdate(this)');
    }
    /**
     * Methode setTaille
     */
    function setTaille(&$form, $maj) {
        $form->setTaille("instruction", 11);
        $form->setTaille("destinataire", 30);
        $form->setTaille("datecourrier", 12);
        $form->setTaille("evenement", 11);
        $form->setTaille("lettretype", 30);
        $form->setTaille("complement", 80);
        $form->setTaille("complement2", 80);
        $form->setTaille("dossier", 12);
        $form->setTaille("action", 20);
        $form->setTaille("delai", 11);
        $form->setTaille("etat", 20);
        $form->setTaille("accord_tacite", 10);
        $form->setTaille("delai_notification", 11);
        $form->setTaille("avis", 10);
        $form->setTaille("archive_delai", 20);
        $form->setTaille("archive_date_complet", 12);
        $form->setTaille("archive_date_rejet", 12);
        $form->setTaille("archive_date_limite", 12);
        $form->setTaille("archive_date_notification_delai", 12);
        $form->setTaille("archive_accord_tacite", 10);
        $form->setTaille("archive_etat", 20);
        $form->setTaille("archive_date_decision", 12);
        $form->setTaille("archive_avis", 20);
        $form->setTaille("archive_date_validite", 12);
        $form->setTaille("archive_date_achevement", 12);
        $form->setTaille("archive_date_chantier", 12);
        $form->setTaille("archive_date_conformite", 12);
        $form->setTaille("complement3", 80);
        $form->setTaille("complement4", 80);
        $form->setTaille("complement5", 80);
        $form->setTaille("complement6", 80);
        $form->setTaille("complement7", 80);
        $form->setTaille("complement8", 80);
        $form->setTaille("complement9", 80);
        $form->setTaille("complement10", 80);
        $form->setTaille("complement11", 80);
        $form->setTaille("complement12", 80);
        $form->setTaille("complement13", 80);
        $form->setTaille("complement14", 80);
        $form->setTaille("complement15", 80);
    }

    /**
     * Methode setMax
     */
    function setMax(&$form, $maj) {
        $form->setMax("instruction", 11);
        $form->setMax("destinataire", 30);
        $form->setMax("datecourrier", 12);
        $form->setMax("evenement", 11);
        $form->setMax("lettretype", 40);
        $form->setMax("complement", 6);
        $form->setMax("complement2", 6);
        $form->setMax("dossier", 12);
        $form->setMax("action", 20);
        $form->setMax("delai", 11);
        $form->setMax("etat", 20);
        $form->setMax("accord_tacite", 3);
        $form->setMax("delai_notification", 11);
        $form->setMax("avis", 2);
        $form->setMax("archive_delai", 20);
        $form->setMax("archive_date_complet", 12);
        $form->setMax("archive_date_rejet", 12);
        $form->setMax("archive_date_limite", 12);
        $form->setMax("archive_date_notification_delai", 12);
        $form->setMax("archive_accord_tacite", 3);
        $form->setMax("archive_etat", 20);
        $form->setMax("archive_date_decision", 12);
        $form->setMax("archive_avis", 20);
        $form->setMax("archive_date_validite", 12);
        $form->setMax("archive_date_achevement", 12);
        $form->setMax("archive_date_chantier", 12);
        $form->setMax("archive_date_conformite", 12);
        $form->setMax("complement3", 6);
        $form->setMax("complement4", 6);
        $form->setMax("complement5", 6);
        $form->setMax("complement6", 6);
        $form->setMax("complement7", 6);
        $form->setMax("complement8", 6);
        $form->setMax("complement9", 6);
        $form->setMax("complement10", 6);
        $form->setMax("complement11", 6);
        $form->setMax("complement12", 6);
        $form->setMax("complement13", 6);
        $form->setMax("complement14", 6);
        $form->setMax("complement15", 6);
    }


    function setLib(&$form,$maj) {
    //libelle des champs
        $form->setLib('instruction',_('instruction'));
        $form->setLib('destinataire',_('destinataire'));
        $form->setLib('datecourrier',_('datecourrier'));
        $form->setLib('evenement',_('evenement'));
        $form->setLib('lettretype',_('lettretype'));
        $form->setLib('complement',_('complement'));
        $form->setLib('complement2',_('complement2'));
        $form->setLib('dossier',_('dossier'));
        $form->setLib('action',_('action'));
        $form->setLib('delai',_('delai'));
        $form->setLib('etat',_('etat'));
        $form->setLib('accord_tacite',_('accord_tacite'));
        $form->setLib('delai_notification',_('delai_notification'));
        $form->setLib('avis',_('avis'));
        $form->setLib('archive_delai',_('archive_delai'));
        $form->setLib('archive_date_complet',_('archive_date_complet'));
        $form->setLib('archive_date_rejet',_('archive_date_rejet'));
        $form->setLib('archive_date_limite',_('archive_date_limite'));
        $form->setLib('archive_date_notification_delai',_('archive_date_notification_delai'));
        $form->setLib('archive_accord_tacite',_('archive_accord_tacite'));
        $form->setLib('archive_etat',_('archive_etat'));
        $form->setLib('archive_date_decision',_('archive_date_decision'));
        $form->setLib('archive_avis',_('archive_avis'));
        $form->setLib('archive_date_validite',_('archive_date_validite'));
        $form->setLib('archive_date_achevement',_('archive_date_achevement'));
        $form->setLib('archive_date_chantier',_('archive_date_chantier'));
        $form->setLib('archive_date_conformite',_('archive_date_conformite'));
        $form->setLib('complement3',_('complement3'));
        $form->setLib('complement4',_('complement4'));
        $form->setLib('complement5',_('complement5'));
        $form->setLib('complement6',_('complement6'));
        $form->setLib('complement7',_('complement7'));
        $form->setLib('complement8',_('complement8'));
        $form->setLib('complement9',_('complement9'));
        $form->setLib('complement10',_('complement10'));
        $form->setLib('complement11',_('complement11'));
        $form->setLib('complement12',_('complement12'));
        $form->setLib('complement13',_('complement13'));
        $form->setLib('complement14',_('complement14'));
        $form->setLib('complement15',_('complement15'));
    }

    function setSelect(&$form, $maj,&$db,$debug) {
        if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php"))
            include ("../sql/".$db->phptype."/".$this->table.".form.inc.php");
        elseif(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc"))
            include ("../sql/".$db->phptype."/".$this->table.".form.inc");

        // action
        $this->init_select($form, $db, $maj, $debug, "action",
                           $sql_action, $sql_action_by_id, false);

        // avis
        $this->init_select($form, $db, $maj, $debug, "avis",
                           $sql_avis, $sql_avis_by_id, false);

        // dossier
        $this->init_select($form, $db, $maj, $debug, "dossier",
                           $sql_dossier, $sql_dossier_by_id, false);

        // etat
        $this->init_select($form, $db, $maj, $debug, "etat",
                           $sql_etat, $sql_etat_by_id, false);

        // evenement
        $this->init_select($form, $db, $maj, $debug, "evenement",
                           $sql_evenement, $sql_evenement_by_id, false);
    }// fin select

    //==================================
    // sous Formulaire  [subform]
    //==================================

    function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){
        $this->retourformulaire = $retourformulaire;
        if($validation == 0) {
            if($retourformulaire =='action')
                $form->setVal('action', $idxformulaire);
            if($retourformulaire =='avis')
                $form->setVal('avis', $idxformulaire);
            if($retourformulaire =='dossier')
                $form->setVal('dossier', $idxformulaire);
            if($retourformulaire =='etat')
                $form->setVal('etat', $idxformulaire);
            if($retourformulaire =='evenement')
                $form->setVal('evenement', $idxformulaire);
        }// fin validation
    }// fin setValsousformulaire

    //==================================
    // cle secondaire  [secondary key]
    //==================================

}// fin classe
?>