<?php
//$Id$ 
//gen openMairie le 03/12/2025 11:10

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

class reprise_abandon_gen extends om_dbform {

    protected $_absolute_class_name = "reprise_abandon";

    var $table = "reprise_abandon";
    var $clePrimaire = "reprise_abandon";
    var $typeCle = "N";
    var $required_field = array(
        "datecreation",
        "emplacement",
        "etat",
        "reprise_abandon",
        "statut"
    );
    
    var $foreign_keys_extended = array(
        "emplacement" => array("emplacement", "colombarium", "concession", "depositoire", "enfeu", "ossuaire", "terraincommunal", ),
    );
    
    /**
     *
     * @return string
     */
    function get_default_libelle() {
        return $this->getVal($this->clePrimaire)."&nbsp;".$this->getVal("emplacement");
    }

    /**
     *
     * @return array
     */
    function get_var_sql_forminc__champs() {
        return array(
            "reprise_abandon",
            "emplacement",
            "statut",
            "etat",
            "datecreation",
            "effectuee",
            "dateconvocationvisite1",
            "dateconstatpv1",
            "heureconstatpv1",
            "descriptionpv1",
            "personnepresentepv1",
            "datenotificationpv1",
            "debutaffichage1pv1",
            "finaffichage1pv1",
            "debutaffichage2pv1",
            "finaffichage2pv1",
            "debutaffichage3pv1",
            "finaffichage3pv1",
            "dateconvocationvisite2",
            "dateconstatpv2",
            "heureconstatpv2",
            "descriptionpv2",
            "personnepresentepv2",
            "datenotificationpv2",
            "debutaffichagepv2",
            "finaffichagepv2",
            "arrete",
            "datearrete",
            "datearretedebut",
            "datearretefin",
            "numrefarrete",
            "datedeliberation",
            "numrefdeliberation",
            "deliberation",
            "date_fin_prelim",
            "date_suspendue",
        );
    }

    /**
     *
     * @return string
     */
    function get_var_sql_forminc__sql_emplacement() {
        return "SELECT emplacement.emplacement, emplacement.nature FROM ".DB_PREFIXE."emplacement ORDER BY emplacement.nature ASC";
    }

    /**
     *
     * @return string
     */
    function get_var_sql_forminc__sql_emplacement_by_id() {
        return "SELECT emplacement.emplacement, emplacement.nature FROM ".DB_PREFIXE."emplacement WHERE emplacement = <idx>";
    }




    function setvalF($val = array()) {
        //affectation valeur formulaire
        if (!is_numeric($val['reprise_abandon'])) {
            $this->valF['reprise_abandon'] = ""; // -> requis
        } else {
            $this->valF['reprise_abandon'] = $val['reprise_abandon'];
        }
        if (!is_numeric($val['emplacement'])) {
            $this->valF['emplacement'] = ""; // -> requis
        } else {
            $this->valF['emplacement'] = $val['emplacement'];
        }
        $this->valF['statut'] = $val['statut'];
        $this->valF['etat'] = $val['etat'];
        if ($val['datecreation'] != "") {
            $this->valF['datecreation'] = $this->dateDB($val['datecreation']);
        }
        if ($val['effectuee'] == 1 || $val['effectuee'] == "t" || $val['effectuee'] == "Oui") {
            $this->valF['effectuee'] = true;
        } else {
            $this->valF['effectuee'] = false;
        }
        if ($val['dateconvocationvisite1'] != "") {
            $this->valF['dateconvocationvisite1'] = $this->dateDB($val['dateconvocationvisite1']);
        } else {
            $this->valF['dateconvocationvisite1'] = NULL;
        }
        if ($val['dateconstatpv1'] != "") {
            $this->valF['dateconstatpv1'] = $this->dateDB($val['dateconstatpv1']);
        } else {
            $this->valF['dateconstatpv1'] = NULL;
        }
            $this->valF['heureconstatpv1'] = $val['heureconstatpv1'];
            $this->valF['descriptionpv1'] = $val['descriptionpv1'];
            $this->valF['personnepresentepv1'] = $val['personnepresentepv1'];
        if ($val['datenotificationpv1'] != "") {
            $this->valF['datenotificationpv1'] = $this->dateDB($val['datenotificationpv1']);
        } else {
            $this->valF['datenotificationpv1'] = NULL;
        }
        if ($val['debutaffichage1pv1'] != "") {
            $this->valF['debutaffichage1pv1'] = $this->dateDB($val['debutaffichage1pv1']);
        } else {
            $this->valF['debutaffichage1pv1'] = NULL;
        }
        if ($val['finaffichage1pv1'] != "") {
            $this->valF['finaffichage1pv1'] = $this->dateDB($val['finaffichage1pv1']);
        } else {
            $this->valF['finaffichage1pv1'] = NULL;
        }
        if ($val['debutaffichage2pv1'] != "") {
            $this->valF['debutaffichage2pv1'] = $this->dateDB($val['debutaffichage2pv1']);
        } else {
            $this->valF['debutaffichage2pv1'] = NULL;
        }
        if ($val['finaffichage2pv1'] != "") {
            $this->valF['finaffichage2pv1'] = $this->dateDB($val['finaffichage2pv1']);
        } else {
            $this->valF['finaffichage2pv1'] = NULL;
        }
        if ($val['debutaffichage3pv1'] != "") {
            $this->valF['debutaffichage3pv1'] = $this->dateDB($val['debutaffichage3pv1']);
        } else {
            $this->valF['debutaffichage3pv1'] = NULL;
        }
        if ($val['finaffichage3pv1'] != "") {
            $this->valF['finaffichage3pv1'] = $this->dateDB($val['finaffichage3pv1']);
        } else {
            $this->valF['finaffichage3pv1'] = NULL;
        }
        if ($val['dateconvocationvisite2'] != "") {
            $this->valF['dateconvocationvisite2'] = $this->dateDB($val['dateconvocationvisite2']);
        } else {
            $this->valF['dateconvocationvisite2'] = NULL;
        }
        if ($val['dateconstatpv2'] != "") {
            $this->valF['dateconstatpv2'] = $this->dateDB($val['dateconstatpv2']);
        } else {
            $this->valF['dateconstatpv2'] = NULL;
        }
            $this->valF['heureconstatpv2'] = $val['heureconstatpv2'];
            $this->valF['descriptionpv2'] = $val['descriptionpv2'];
            $this->valF['personnepresentepv2'] = $val['personnepresentepv2'];
        if ($val['datenotificationpv2'] != "") {
            $this->valF['datenotificationpv2'] = $this->dateDB($val['datenotificationpv2']);
        } else {
            $this->valF['datenotificationpv2'] = NULL;
        }
        if ($val['debutaffichagepv2'] != "") {
            $this->valF['debutaffichagepv2'] = $this->dateDB($val['debutaffichagepv2']);
        } else {
            $this->valF['debutaffichagepv2'] = NULL;
        }
        if ($val['finaffichagepv2'] != "") {
            $this->valF['finaffichagepv2'] = $this->dateDB($val['finaffichagepv2']);
        } else {
            $this->valF['finaffichagepv2'] = NULL;
        }
        if ($val['arrete'] == "") {
            $this->valF['arrete'] = NULL;
        } else {
            $this->valF['arrete'] = $val['arrete'];
        }
        if ($val['datearrete'] != "") {
            $this->valF['datearrete'] = $this->dateDB($val['datearrete']);
        } else {
            $this->valF['datearrete'] = NULL;
        }
        if ($val['datearretedebut'] != "") {
            $this->valF['datearretedebut'] = $this->dateDB($val['datearretedebut']);
        } else {
            $this->valF['datearretedebut'] = NULL;
        }
        if ($val['datearretefin'] != "") {
            $this->valF['datearretefin'] = $this->dateDB($val['datearretefin']);
        } else {
            $this->valF['datearretefin'] = NULL;
        }
        if ($val['numrefarrete'] == "") {
            $this->valF['numrefarrete'] = NULL;
        } else {
            $this->valF['numrefarrete'] = $val['numrefarrete'];
        }
        if ($val['datedeliberation'] != "") {
            $this->valF['datedeliberation'] = $this->dateDB($val['datedeliberation']);
        } else {
            $this->valF['datedeliberation'] = NULL;
        }
        if ($val['numrefdeliberation'] == "") {
            $this->valF['numrefdeliberation'] = NULL;
        } else {
            $this->valF['numrefdeliberation'] = $val['numrefdeliberation'];
        }
        if ($val['deliberation'] == "") {
            $this->valF['deliberation'] = NULL;
        } else {
            $this->valF['deliberation'] = $val['deliberation'];
        }
        if ($val['date_fin_prelim'] != "") {
            $this->valF['date_fin_prelim'] = $this->dateDB($val['date_fin_prelim']);
        } else {
            $this->valF['date_fin_prelim'] = NULL;
        }
        if ($val['date_suspendue'] != "") {
            $this->valF['date_suspendue'] = $this->dateDB($val['date_suspendue']);
        } else {
            $this->valF['date_suspendue'] = NULL;
        }
    }

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

    function setId(&$dnu1 = null) {
    //numero automatique
        $qres = $this->f->get_next_id_from_db_sequence(DB_PREFIXE.$this->table, array("origin" => __METHOD__));
        $this->valF[$this->clePrimaire] = $qres['result'];
    }

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

    function verifierAjout($val = array(), &$dnu1 = null) {
    //numero automatique -> pas de verfication de cle primaire
    }

    //==========================
    // Formulaire  [form]
    //==========================
    /**
     *
     */
    function setType(&$form, $maj) {
        // Récupération du mode de l'action
        $crud = $this->get_action_crud($maj);

        // MODE AJOUTER
        if ($maj == 0 || $crud == 'create') {
            $form->setType("reprise_abandon", "hidden");
            if ($this->is_in_context_of_foreign_key("emplacement", $this->retourformulaire)) {
                $form->setType("emplacement", "selecthiddenstatic");
            } else {
                $form->setType("emplacement", "select");
            }
            $form->setType("statut", "text");
            $form->setType("etat", "text");
            $form->setType("datecreation", "date");
            $form->setType("effectuee", "checkbox");
            $form->setType("dateconvocationvisite1", "date");
            $form->setType("dateconstatpv1", "date");
            $form->setType("heureconstatpv1", "text");
            $form->setType("descriptionpv1", "textarea");
            $form->setType("personnepresentepv1", "textarea");
            $form->setType("datenotificationpv1", "date");
            $form->setType("debutaffichage1pv1", "date");
            $form->setType("finaffichage1pv1", "date");
            $form->setType("debutaffichage2pv1", "date");
            $form->setType("finaffichage2pv1", "date");
            $form->setType("debutaffichage3pv1", "date");
            $form->setType("finaffichage3pv1", "date");
            $form->setType("dateconvocationvisite2", "date");
            $form->setType("dateconstatpv2", "date");
            $form->setType("heureconstatpv2", "text");
            $form->setType("descriptionpv2", "textarea");
            $form->setType("personnepresentepv2", "textarea");
            $form->setType("datenotificationpv2", "date");
            $form->setType("debutaffichagepv2", "date");
            $form->setType("finaffichagepv2", "date");
            $form->setType("arrete", "text");
            $form->setType("datearrete", "date");
            $form->setType("datearretedebut", "date");
            $form->setType("datearretefin", "date");
            $form->setType("numrefarrete", "text");
            $form->setType("datedeliberation", "date");
            $form->setType("numrefdeliberation", "text");
            $form->setType("deliberation", "text");
            $form->setType("date_fin_prelim", "date");
            $form->setType("date_suspendue", "date");
        }

        // MDOE MODIFIER
        if ($maj == 1 || $crud == 'update') {
            $form->setType("reprise_abandon", "hiddenstatic");
            if ($this->is_in_context_of_foreign_key("emplacement", $this->retourformulaire)) {
                $form->setType("emplacement", "selecthiddenstatic");
            } else {
                $form->setType("emplacement", "select");
            }
            $form->setType("statut", "text");
            $form->setType("etat", "text");
            $form->setType("datecreation", "date");
            $form->setType("effectuee", "checkbox");
            $form->setType("dateconvocationvisite1", "date");
            $form->setType("dateconstatpv1", "date");
            $form->setType("heureconstatpv1", "text");
            $form->setType("descriptionpv1", "textarea");
            $form->setType("personnepresentepv1", "textarea");
            $form->setType("datenotificationpv1", "date");
            $form->setType("debutaffichage1pv1", "date");
            $form->setType("finaffichage1pv1", "date");
            $form->setType("debutaffichage2pv1", "date");
            $form->setType("finaffichage2pv1", "date");
            $form->setType("debutaffichage3pv1", "date");
            $form->setType("finaffichage3pv1", "date");
            $form->setType("dateconvocationvisite2", "date");
            $form->setType("dateconstatpv2", "date");
            $form->setType("heureconstatpv2", "text");
            $form->setType("descriptionpv2", "textarea");
            $form->setType("personnepresentepv2", "textarea");
            $form->setType("datenotificationpv2", "date");
            $form->setType("debutaffichagepv2", "date");
            $form->setType("finaffichagepv2", "date");
            $form->setType("arrete", "text");
            $form->setType("datearrete", "date");
            $form->setType("datearretedebut", "date");
            $form->setType("datearretefin", "date");
            $form->setType("numrefarrete", "text");
            $form->setType("datedeliberation", "date");
            $form->setType("numrefdeliberation", "text");
            $form->setType("deliberation", "text");
            $form->setType("date_fin_prelim", "date");
            $form->setType("date_suspendue", "date");
        }

        // MODE SUPPRIMER
        if ($maj == 2 || $crud == 'delete') {
            $form->setType("reprise_abandon", "hiddenstatic");
            $form->setType("emplacement", "selectstatic");
            $form->setType("statut", "hiddenstatic");
            $form->setType("etat", "hiddenstatic");
            $form->setType("datecreation", "hiddenstatic");
            $form->setType("effectuee", "hiddenstatic");
            $form->setType("dateconvocationvisite1", "hiddenstatic");
            $form->setType("dateconstatpv1", "hiddenstatic");
            $form->setType("heureconstatpv1", "hiddenstatic");
            $form->setType("descriptionpv1", "hiddenstatic");
            $form->setType("personnepresentepv1", "hiddenstatic");
            $form->setType("datenotificationpv1", "hiddenstatic");
            $form->setType("debutaffichage1pv1", "hiddenstatic");
            $form->setType("finaffichage1pv1", "hiddenstatic");
            $form->setType("debutaffichage2pv1", "hiddenstatic");
            $form->setType("finaffichage2pv1", "hiddenstatic");
            $form->setType("debutaffichage3pv1", "hiddenstatic");
            $form->setType("finaffichage3pv1", "hiddenstatic");
            $form->setType("dateconvocationvisite2", "hiddenstatic");
            $form->setType("dateconstatpv2", "hiddenstatic");
            $form->setType("heureconstatpv2", "hiddenstatic");
            $form->setType("descriptionpv2", "hiddenstatic");
            $form->setType("personnepresentepv2", "hiddenstatic");
            $form->setType("datenotificationpv2", "hiddenstatic");
            $form->setType("debutaffichagepv2", "hiddenstatic");
            $form->setType("finaffichagepv2", "hiddenstatic");
            $form->setType("arrete", "hiddenstatic");
            $form->setType("datearrete", "hiddenstatic");
            $form->setType("datearretedebut", "hiddenstatic");
            $form->setType("datearretefin", "hiddenstatic");
            $form->setType("numrefarrete", "hiddenstatic");
            $form->setType("datedeliberation", "hiddenstatic");
            $form->setType("numrefdeliberation", "hiddenstatic");
            $form->setType("deliberation", "hiddenstatic");
            $form->setType("date_fin_prelim", "hiddenstatic");
            $form->setType("date_suspendue", "hiddenstatic");
        }

        // MODE CONSULTER
        if ($maj == 3 || $crud == 'read') {
            $form->setType("reprise_abandon", "static");
            $form->setType("emplacement", "selectstatic");
            $form->setType("statut", "static");
            $form->setType("etat", "static");
            $form->setType("datecreation", "datestatic");
            $form->setType("effectuee", "checkboxstatic");
            $form->setType("dateconvocationvisite1", "datestatic");
            $form->setType("dateconstatpv1", "datestatic");
            $form->setType("heureconstatpv1", "static");
            $form->setType("descriptionpv1", "textareastatic");
            $form->setType("personnepresentepv1", "textareastatic");
            $form->setType("datenotificationpv1", "datestatic");
            $form->setType("debutaffichage1pv1", "datestatic");
            $form->setType("finaffichage1pv1", "datestatic");
            $form->setType("debutaffichage2pv1", "datestatic");
            $form->setType("finaffichage2pv1", "datestatic");
            $form->setType("debutaffichage3pv1", "datestatic");
            $form->setType("finaffichage3pv1", "datestatic");
            $form->setType("dateconvocationvisite2", "datestatic");
            $form->setType("dateconstatpv2", "datestatic");
            $form->setType("heureconstatpv2", "static");
            $form->setType("descriptionpv2", "textareastatic");
            $form->setType("personnepresentepv2", "textareastatic");
            $form->setType("datenotificationpv2", "datestatic");
            $form->setType("debutaffichagepv2", "datestatic");
            $form->setType("finaffichagepv2", "datestatic");
            $form->setType("arrete", "static");
            $form->setType("datearrete", "datestatic");
            $form->setType("datearretedebut", "datestatic");
            $form->setType("datearretefin", "datestatic");
            $form->setType("numrefarrete", "static");
            $form->setType("datedeliberation", "datestatic");
            $form->setType("numrefdeliberation", "static");
            $form->setType("deliberation", "static");
            $form->setType("date_fin_prelim", "datestatic");
            $form->setType("date_suspendue", "datestatic");
        }

    }


    function setOnchange(&$form, $maj) {
    //javascript controle client
        $form->setOnchange('reprise_abandon','VerifNum(this)');
        $form->setOnchange('emplacement','VerifNum(this)');
        $form->setOnchange('datecreation','fdate(this)');
        $form->setOnchange('dateconvocationvisite1','fdate(this)');
        $form->setOnchange('dateconstatpv1','fdate(this)');
        $form->setOnchange('datenotificationpv1','fdate(this)');
        $form->setOnchange('debutaffichage1pv1','fdate(this)');
        $form->setOnchange('finaffichage1pv1','fdate(this)');
        $form->setOnchange('debutaffichage2pv1','fdate(this)');
        $form->setOnchange('finaffichage2pv1','fdate(this)');
        $form->setOnchange('debutaffichage3pv1','fdate(this)');
        $form->setOnchange('finaffichage3pv1','fdate(this)');
        $form->setOnchange('dateconvocationvisite2','fdate(this)');
        $form->setOnchange('dateconstatpv2','fdate(this)');
        $form->setOnchange('datenotificationpv2','fdate(this)');
        $form->setOnchange('debutaffichagepv2','fdate(this)');
        $form->setOnchange('finaffichagepv2','fdate(this)');
        $form->setOnchange('datearrete','fdate(this)');
        $form->setOnchange('datearretedebut','fdate(this)');
        $form->setOnchange('datearretefin','fdate(this)');
        $form->setOnchange('datedeliberation','fdate(this)');
        $form->setOnchange('date_fin_prelim','fdate(this)');
        $form->setOnchange('date_suspendue','fdate(this)');
    }
    /**
     * Methode setTaille
     */
    function setTaille(&$form, $maj) {
        $form->setTaille("reprise_abandon", 11);
        $form->setTaille("emplacement", 11);
        $form->setTaille("statut", 10);
        $form->setTaille("etat", 10);
        $form->setTaille("datecreation", 12);
        $form->setTaille("effectuee", 1);
        $form->setTaille("dateconvocationvisite1", 12);
        $form->setTaille("dateconstatpv1", 12);
        $form->setTaille("heureconstatpv1", 8);
        $form->setTaille("descriptionpv1", 80);
        $form->setTaille("personnepresentepv1", 80);
        $form->setTaille("datenotificationpv1", 12);
        $form->setTaille("debutaffichage1pv1", 12);
        $form->setTaille("finaffichage1pv1", 12);
        $form->setTaille("debutaffichage2pv1", 12);
        $form->setTaille("finaffichage2pv1", 12);
        $form->setTaille("debutaffichage3pv1", 12);
        $form->setTaille("finaffichage3pv1", 12);
        $form->setTaille("dateconvocationvisite2", 12);
        $form->setTaille("dateconstatpv2", 12);
        $form->setTaille("heureconstatpv2", 8);
        $form->setTaille("descriptionpv2", 80);
        $form->setTaille("personnepresentepv2", 80);
        $form->setTaille("datenotificationpv2", 12);
        $form->setTaille("debutaffichagepv2", 12);
        $form->setTaille("finaffichagepv2", 12);
        $form->setTaille("arrete", 30);
        $form->setTaille("datearrete", 12);
        $form->setTaille("datearretedebut", 12);
        $form->setTaille("datearretefin", 12);
        $form->setTaille("numrefarrete", 30);
        $form->setTaille("datedeliberation", 12);
        $form->setTaille("numrefdeliberation", 30);
        $form->setTaille("deliberation", 30);
        $form->setTaille("date_fin_prelim", 12);
        $form->setTaille("date_suspendue", 12);
    }

    /**
     * Methode setMax
     */
    function setMax(&$form, $maj) {
        $form->setMax("reprise_abandon", 11);
        $form->setMax("emplacement", 11);
        $form->setMax("statut", -5);
        $form->setMax("etat", -5);
        $form->setMax("datecreation", 12);
        $form->setMax("effectuee", 1);
        $form->setMax("dateconvocationvisite1", 12);
        $form->setMax("dateconstatpv1", 12);
        $form->setMax("heureconstatpv1", 8);
        $form->setMax("descriptionpv1", 6);
        $form->setMax("personnepresentepv1", 6);
        $form->setMax("datenotificationpv1", 12);
        $form->setMax("debutaffichage1pv1", 12);
        $form->setMax("finaffichage1pv1", 12);
        $form->setMax("debutaffichage2pv1", 12);
        $form->setMax("finaffichage2pv1", 12);
        $form->setMax("debutaffichage3pv1", 12);
        $form->setMax("finaffichage3pv1", 12);
        $form->setMax("dateconvocationvisite2", 12);
        $form->setMax("dateconstatpv2", 12);
        $form->setMax("heureconstatpv2", 8);
        $form->setMax("descriptionpv2", 6);
        $form->setMax("personnepresentepv2", 6);
        $form->setMax("datenotificationpv2", 12);
        $form->setMax("debutaffichagepv2", 12);
        $form->setMax("finaffichagepv2", 12);
        $form->setMax("arrete", 40);
        $form->setMax("datearrete", 12);
        $form->setMax("datearretedebut", 12);
        $form->setMax("datearretefin", 12);
        $form->setMax("numrefarrete", 255);
        $form->setMax("datedeliberation", 12);
        $form->setMax("numrefdeliberation", 255);
        $form->setMax("deliberation", 40);
        $form->setMax("date_fin_prelim", 12);
        $form->setMax("date_suspendue", 12);
    }


    function setLib(&$form, $maj) {
    //libelle des champs
        $form->setLib('reprise_abandon', __('reprise_abandon'));
        $form->setLib('emplacement', __('emplacement'));
        $form->setLib('statut', __('statut'));
        $form->setLib('etat', __('etat'));
        $form->setLib('datecreation', __('datecreation'));
        $form->setLib('effectuee', __('effectuee'));
        $form->setLib('dateconvocationvisite1', __('dateconvocationvisite1'));
        $form->setLib('dateconstatpv1', __('dateconstatpv1'));
        $form->setLib('heureconstatpv1', __('heureconstatpv1'));
        $form->setLib('descriptionpv1', __('descriptionpv1'));
        $form->setLib('personnepresentepv1', __('personnepresentepv1'));
        $form->setLib('datenotificationpv1', __('datenotificationpv1'));
        $form->setLib('debutaffichage1pv1', __('debutaffichage1pv1'));
        $form->setLib('finaffichage1pv1', __('finaffichage1pv1'));
        $form->setLib('debutaffichage2pv1', __('debutaffichage2pv1'));
        $form->setLib('finaffichage2pv1', __('finaffichage2pv1'));
        $form->setLib('debutaffichage3pv1', __('debutaffichage3pv1'));
        $form->setLib('finaffichage3pv1', __('finaffichage3pv1'));
        $form->setLib('dateconvocationvisite2', __('dateconvocationvisite2'));
        $form->setLib('dateconstatpv2', __('dateconstatpv2'));
        $form->setLib('heureconstatpv2', __('heureconstatpv2'));
        $form->setLib('descriptionpv2', __('descriptionpv2'));
        $form->setLib('personnepresentepv2', __('personnepresentepv2'));
        $form->setLib('datenotificationpv2', __('datenotificationpv2'));
        $form->setLib('debutaffichagepv2', __('debutaffichagepv2'));
        $form->setLib('finaffichagepv2', __('finaffichagepv2'));
        $form->setLib('arrete', __('arrete'));
        $form->setLib('datearrete', __('datearrete'));
        $form->setLib('datearretedebut', __('datearretedebut'));
        $form->setLib('datearretefin', __('datearretefin'));
        $form->setLib('numrefarrete', __('numrefarrete'));
        $form->setLib('datedeliberation', __('datedeliberation'));
        $form->setLib('numrefdeliberation', __('numrefdeliberation'));
        $form->setLib('deliberation', __('deliberation'));
        $form->setLib('date_fin_prelim', __('date_fin_prelim'));
        $form->setLib('date_suspendue', __('date_suspendue'));
    }
    /**
     *
     */
    function setSelect(&$form, $maj, &$dnu1 = null, $dnu2 = null) {

        // emplacement
        $this->init_select(
            $form, 
            $this->f->get_db_reference(),
            $maj,
            null,
            "emplacement",
            $this->get_var_sql_forminc__sql("emplacement"),
            $this->get_var_sql_forminc__sql("emplacement_by_id"),
            false
        );
    }


    //==================================
    // sous Formulaire
    //==================================
    

    function setValsousformulaire(&$form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, &$dnu1 = null, $dnu2 = null) {
        $this->retourformulaire = $retourformulaire;
        if($validation == 0) {
            if($this->is_in_context_of_foreign_key('emplacement', $this->retourformulaire))
                $form->setVal('emplacement', $idxformulaire);
        }// fin validation
        $this->set_form_default_values($form, $maj, $validation);
    }// fin setValsousformulaire

    //==================================
    // cle secondaire
    //==================================
    
    /**
     * Methode clesecondaire
     */
    function cleSecondaire($id, &$dnu1 = null, $val = array(), $dnu2 = null) {
        // On appelle la methode de la classe parent
        parent::cleSecondaire($id);
        // Verification de la cle secondaire : courrier
        $this->rechercheTable($this->f->get_db_reference(), "courrier", "reprise_abandon", $id);
    }


}
