<?php
/* $Id: dossier_numeromanuel.class.php,v 1.8 2008-08-18 14:39:32 jbastide Exp $
*/
require_once ("dossier.class.php");


class dossier_numeromanuel extends dossier{
    var $required_field=array(
        "dossier",
        "date_depot",
        "demandeur_nom"
    );

    function dossier_numeromanuel($id,&$db,$DEBUG) {
        $this->constructeur($id,$db,$DEBUG);
    } // fin constructeur

    function setValFAjout($val = array()) {
    }

    function setvalF($val){
        $this->valF['dossier'] = $val['dossier'];
        $this->valF['annee'] = substr($val['dossier'],2,2);
        if($val['date_demande']!=""){
           $this->valF['date_demande'] = $this->dateDB($val['date_demande']);
        }
        if($val['date_depot']!=""){
           $this->valF['date_depot'] = $this->dateDB($val['date_depot']);
        }
        $this->valF['demandeur_nom'] = $val['demandeur_nom'];
        $this->valF['etat'] = $val['etat'];
    }

    function verifier($val,&$db,$DEBUG){
        dbform::verifier($val,$db,$DEBUG);

        if($val['date_depot']!=""){
           $this->valF['date_depot'] = $this->dateDB($val['date_depot']);
        }
        if ($this->valF['dossier']!=""){
            // verif annee
            if($this->valF['annee']>= date('y')){
                $this->correct=false;
                $this->msg= $this->msg." "._("Annee")." ".$this->valF['annee']." ".
                _("en cours");            
            }
        } 
    }

    function setId($db){
    }

    function retour($premier,$recherche){

        // mise a niveau om4
        echo "\n<a class=\"retour\" ";
        echo "href=\"";
        echo "tab.php?obj=PC_accueil";
        echo "\"";
        echo ">";
        echo _("Retour");
        echo "</a>\n";
    }

    function setType(&$form,$maj) {
        parent::setType($form,$maj);
        $form->setType('etat','hiddenstatic');
        $form->setType('instructeur','hidden');     
        $form->setType('date_complet','hiddendate');
        $form->setType('date_rejet','hiddendate');
        $form->setType('date_notification_delai','hiddendate');
        $form->setType('delai','hidden');
        $form->setType('date_limite','hiddendate');
        $form->setType('accord_tacite','hidden');
        $form->setType('date_decision','hiddendate');
        $form->setType('avis_decision','hidden');
        $form->setType('date_validite','hiddendate');
        $form->setType('date_chantier','hiddendate');
        $form->setType('date_achevement','hiddendate');
        $form->setType('date_conformite','hiddendate');
        $form->setType('parcelle','hidden');
        $form->setType('pos','hidden');
        $form->setType('sig','hidden');
        $form->setType('batiment_nombre','hidden');
        $form->setType('logement_nombre','hidden');
        $form->setType('shon','hidden');
        $form->setType('shon_calcul','hidden');
        $form->setType('shob','hidden');
        $form->setType('lot','hidden');
        $form->setType('hauteur','hidden');
        $form->setType('piece_nombre','hidden');
        $form->setType('amenagement','hidden');
        $form->setType('description','hidden');
        $form->setType('temp1','hidden');
        $form->setType('temp2','hidden');
        $form->setType('temp3','hidden');
        $form->setType('temp4','hidden');
        $form->setType('temp5','hidden');
        $form->setType('geom','hidden');
        $form->setType('siglien','hidden'); // ****
        $form->setType('parcelle_archive','hidden');
        // no manuel
        $form->setType('dossier','text');
        $form->setType('annee','hidden');
        $form->setType('date_demande','date');
        $form->setType('date_depot','date');
        $form->setType('parcelle_lot','hidden');
        $form->setType('parcelle_lot_lotissement','hidden');                
        $form->setType('parcelle_lot_archive','hidden');
        $form->setType('servitude','hidden');
    }

    function setLib(&$form,$maj) {
        $form->setLib('dossier',_('dossier'));
        $form->setLib('annee',_('annee'));
        $form->setLib('date_demande',_('date_demande'));
        $form->setLib('date_depot',_('date_depot'));
    }

    function setGroupe(&$form,$maj) {
    }

    function setRegroupe(&$form,$maj) {
    }

}// fin de classe
?>