<?php
//$Id$
//gen openMairie le 18/10/2011 11:58
require_once ("../obj/operation.class.php");

class transfert extends operation {

    var $categorie= 'transfert';

    // concession

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

    function setType(&$form,$maj) {
        parent::setType($form,$maj);
        if ($maj < 2) { //ajouter et modifier
            $form->setType('emplacement_transfert_famille','comboG');
            $form->setType('emplacement_transfert', 'comboD'); // pb de cle numerique
        }
        if ($maj == 3) {
            $form->setType('emplacement_transfert', 'hiddenstatic');
            $form->setType('emplacement_transfert_famille', 'hiddenstatic');
        }
    }


    function setSelect(&$form, $maj,&$db,$debug) {
        parent::setSelect($form, $maj,$db,$debug);
        if($maj<2){
             $contenu="";
             $contenu[0][0]="emplacement";
             $contenu[0][1]="emplacement";
             $contenu[1][0]="famille";
             $contenu[1][1]="emplacement_transfert_famille";
             $form->setSelect("emplacement_transfert",$contenu);

             $contenu="";
             $contenu[0][0]="emplacement";
             $contenu[0][1]="famille";
             $contenu[1][0]="emplacement";
             $contenu[1][1]="emplacement_transfert";
             $form->setSelect("emplacement_transfert_famille",$contenu);
         }
    }

    function setLib(&$form,$maj) {
        parent::setLib($form,$maj);
        $form->setLib('emplacement_transfert',_("emplacement_transfert"));
        $form->setLib('emplacement_transfert_famille',_("emplacement_transfert_famille"));
    }

    function setOnchange(&$form,$maj){
        parent::setOnchange($form,$maj);
        $form->setOnchange("emplacement_transfert_famille","this.value=this.value.toUpperCase();");
    }

    function setGroupe(&$form,$maj){
        parent::setGroupe($form,$maj);
        $form->setGroupe('emplacement_transfert','D');
        $form->setGroupe('emplacement_transfert_famille','F');
    }

    function setRegroupe (&$form, $maj) {
        parent::setRegroupe ($form, $maj);
        $form->setRegroupe('emplacement_transfert','D'," "._("emplacement")." "._("transfert"), "collapsible");
        $form->setRegroupe('emplacement_transfert_famille','F','');
    }
}// fin classe
?>