<?php
/**
 * 
 *
 * @package opencimetiere
 * @version SVN : $Id$
 */

//
require_once "../gen/obj/autorisation.class.php";

class autorisation extends autorisation_gen {

    function setType(&$form,$maj) {
        //
        parent::setType($form, $maj);
        //
        $form->setType('emplacement', 'hidden');
        $form->setType('nature', 'hidden');  
        //
        if ($maj < 2) {
            $form->setType('autorisation', 'hiddenstatic');
        }
    }

    function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){
        //
        parent::setValsousformulaire($form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,$db,$DEBUG=null);
        //
        if ($validation==0) {
            if ($maj == 0){
                $form->setVal('autorisation', "[...]");
                $form->setVal('nature', $this->nature);
                $form->setVal('emplacement', $idxformulaire);
            }
        }
    }

    function setLib(&$form, $maj) {
        //
        parent::setLib($form, $maj);
        //
        $form->setLib('autorisation', _("Id"));
    }

    function setOnchange(&$form,$maj){
        //
        parent::setOnchange($form, $maj);
        //
        $form->setOnchange("nom","this.value=this.value.toUpperCase()");
        $form->setOnchange("prenom","this.value=this.value.toUpperCase()");
        $form->setOnchange("marital","this.value=this.value.toUpperCase()");
        $form->setOnchange("adresse1","this.value=this.value.toUpperCase()");
        $form->setOnchange("adresse2","this.value=this.value.toUpperCase()");
        $form->setOnchange("ville","this.value=this.value.toUpperCase()");
    }

    function setLayout(&$form, $maj) {
        //
        $bloc_global_width_full = "span12";
        $bloc_global_width_half = "span6";

        //// CONTAINER GLOBAL - START
        $this->form->setBloc("autorisation", "D", "", "emplacement-form autorisation-form form-action-".$maj);

        //// LIGNE ID - START
        $this->form->setBloc("autorisation", "D", "", "row-fluid");
            //// BLOC ID - START
            $this->form->setBloc("autorisation", "D", "", $bloc_global_width_full." emplacement-bloc emplacement-bloc-identification ");
                //// BLOC ID - START
                $this->form->setBloc("autorisation", "D", "", "span12");
                $this->form->setBloc("nature", "F");
                //// BLOC ID - END
            $this->form->setBloc("nature", "F");
            //// BLOC ID - END
        $this->form->setBloc("nature", "F");
        //// LIGNE ID - END

        //// LIGNE PERSONNE + INFOS + ADRESSE - START
        $this->form->setBloc("titre", "D", "", "row-fluid");
            //// BLOC PERSONNE + INFOS + ADRESSE - START
            $this->form->setBloc("titre", "D", "", $bloc_global_width_full." emplacement-bloc emplacement-bloc-infos ");
                //// LIGNE PERSONNE + INFOS + ADRESSE - START
                $this->form->setBloc("titre", "D", "", "row-fluid");
                    //// BLOC PERSONNE + INFOS - START
                    $this->form->setBloc("titre", "D", "", $bloc_global_width_half);
                        //// LIGNE PERSONNE - START
                        $this->form->setBloc("titre", "D", "", "row-fluid");
                            //// BLOC PERSONNE - START
                            $this->form->setBloc("titre", "D", _($this->nature), " emplacement-bloc-personne span12");
                                $this->form->setBloc("titre", "D", "", "span12");
                                $this->form->setBloc("datenaissance", "F");
                            $this->form->setBloc("datenaissance", "F");
                            //// BLOC PERSONNE - END
                        $this->form->setBloc("datenaissance", "F");
                        //// LIGNE PERSONNE - END
                        //// LIGNE INFOS - START
                        $this->form->setBloc("dcd", "D", "", "row-fluid");
                            //// BLOC INFOS - START
                            $this->form->setBloc("dcd", "D", _("Informations"), "emplacement-bloc-personnne-infos span12 ");
                                $this->form->setBloc("dcd", "D", "", "span12");
                                $this->form->setBloc("parente", "F");
                            $this->form->setBloc("parente", "F");
                            //// BLOC INFOS - END
                        $this->form->setBloc("parente", "F");
                        //// LIGNE INFOS - END
                    $this->form->setBloc("parente", "F");
                    //// BLOC PERSONNE + INFOS - END
                    //// BLOC ADRESSE - START
                    $this->form->setBloc("adresse1", "D", "", $bloc_global_width_half);
                        //// LIGNE ADRESSE - START
                        $this->form->setBloc("adresse1", "D", "", "row-fluid");
                            //// BLOC ADRESSE - START
                            $this->form->setBloc("adresse1", "D", _("Adresse"), "emplacement-bloc-adresse span12");
                                $this->form->setBloc("adresse1", "D", "", "span12");
                                $this->form->setBloc("telephone", "F");
                            $this->form->setBloc("telephone", "F");
                            //// BLOC ADRESSE - END
                        $this->form->setBloc("telephone", "F");
                        //// LIGNE ADRESSE - END
                    $this->form->setBloc("telephone", "F");
                    //// BLOC ADRESSE - END
                $this->form->setBloc("telephone", "F");
                //// LIGNE PERSONNE + INFOS + ADRESSE - END
            $this->form->setBloc("telephone", "F");
            //// BLOC PERSONNE + INFOS + ADRESSE - END
        $this->form->setBloc("telephone", "F");
        //// LIGNE PERSONNE + INFOS + ADRESSE - END

        //// LIGNE OBSERVATION - START
        $this->form->setBloc("observation", "D", "", "row-fluid");
            //// BLOC OBSERVATION - START
            $this->form->setBloc("observation", "D", "", $bloc_global_width_full." emplacement-bloc emplacement-bloc-observation ");
                $this->form->setBloc("observation", "DF", "", "group span12");
            $this->form->setBloc("observation", "F");
            // BLOC OBSERVATION - END
        $this->form->setBloc("observation", "F");
        //// LIGNE OBSERVATION - START

        //// CONTAINER GLOBAL - END
        $this->form->setBloc("observation", "F");
    }

}

?>