<?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 $nature="";
    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['nature'] = substr($val['dossier'],0,2);
        $this->valF['annee'] = substr($val['dossier'],2,2);
        $this->nature=$this->valF['nature'];
        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 nature
            if($this->valF['nature']!="PC"
               and $this->valF['nature']!="PA"
               and $this->valF['nature']!= "DP"
               and $this->valF['nature'] != "PD"){
                $this->correct=false;
                $this->msg= $this->msg." "._("Nature")." ".$this->valF['nature']." ".
                _("inexistante");            
            }
            // 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('types','hidden');
        $form->setType('objet_dossier','hidden');
        $form->setType('instructeur','hidden');     
        $form->setType('date_complet','hidden');
        $form->setType('date_rejet','hidden');
        $form->setType('date_notification_delai','hidden');
        $form->setType('delai','hidden');
        $form->setType('date_limite','hidden');
        $form->setType('accord_tacite','hidden');
        $form->setType('date_decision','hidden');
        $form->setType('avis','hidden');
        $form->setType('date_validite','hidden');
        $form->setType('date_chantier','hidden');
        $form->setType('date_achevement','hidden');
        $form->setType('date_conformite','hidden');
        $form->setType('demandeur_civilite','hidden');
        $form->setType('demandeur_societe','hidden');
        $form->setType('demandeur_adresse','hidden');
        $form->setType('demandeur_cp','hidden');
        $form->setType('demandeur_ville','hidden');
        $form->setType('demandeur_pays','hidden');
        $form->setType('demandeur_telephone','hidden');
        $form->setType('demandeur_email','hidden');
        $form->setType('demandeur_categorie','hidden');
        $form->setType('delegataire','hidden');
        $form->setType('delegataire_civilite','hidden');
        $form->setType('delegataire_nom','hidden');
        $form->setType('delegataire_societe','hidden');
        $form->setType('delegataire_adresse','hidden');
        $form->setType('delegataire_cp','hidden');
        $form->setType('delegataire_ville','hidden');
        $form->setType('delegataire_pays','hidden');
        $form->setType('delegataire_telephone','hidden');
        $form->setType('delegataire_email','hidden');
        $form->setType('terrain_numero','hidden');
        $form->setType('terrain_numero_complement','hidden');
        $form->setType('terrain_adresse','hidden');
        $form->setType('terrain_adresse_complement','hidden');
        $form->setType('terrain_cp','hidden');
        $form->setType('terrain_ville','hidden');
        $form->setType('architecte','hidden');
        $form->setType('terrain_surface','hidden');
        $form->setType('terrain_surface_calcul','hidden');
        $form->setType('rivoli','hidden');
        $form->setType('travaux','hidden');
        $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('architecte_nom','hidden'); // ****
        $form->setType('saisie_architecte','hidden'); // ****
        $form->setType('siglien','hidden'); // ****
        $form->setType('parcelle_archive','hidden');
        // no manuel
        $form->setType('dossier','text');
        $form->setType('nature','hidden');
        $form->setType('annee','hidden');
        $form->setType('demandeur_nom','text');
        $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('nature',_('nature'));
        $form->setLib('annee',_('annee'));
        $form->setLib('date_demande',_('date_demande'));
        $form->setLib('date_depot',_('date_depot'));
        $form->setLib('demandeur_nom',_('demandeur_nom'));
    }

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

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

}// fin de classe
?>