1 |
<?php |
2 |
//$Id$ |
3 |
//gen openMairie le 10/02/2011 20:37 |
4 |
require_once ("../gen/obj/travaux.class.php"); |
5 |
|
6 |
class travaux extends travaux_gen { |
7 |
|
8 |
function travaux($id,&$db,$debug) { |
9 |
$this->constructeur($id,$db,$debug); |
10 |
}// fin constructeur |
11 |
|
12 |
function setType(&$form,$maj) { |
13 |
parent::setType($form,$maj); |
14 |
if ($maj < 2) { //ajouter et modifier |
15 |
$form->setType('solde', 'select'); |
16 |
} |
17 |
} |
18 |
|
19 |
|
20 |
function setTaille(&$form,$maj) { |
21 |
parent::setTaille($form,$maj); |
22 |
$form->setTaille('codelascot',1); |
23 |
} |
24 |
|
25 |
function setMax(&$form,$maj) { |
26 |
parent::setMax($form,$maj); |
27 |
$form->setMax('codelascot',1); |
28 |
} |
29 |
|
30 |
function setSelect(&$form, $maj,&$db,$debug) { |
31 |
parent::setSelect($form, $maj,&$db,$debug); |
32 |
// solde |
33 |
$contenu=array(); |
34 |
$contenu[0]=array('Non','Oui'); |
35 |
$contenu[1]=array(_('Non'),_('Oui')); |
36 |
$form->setSelect("solde",$contenu); |
37 |
} |
38 |
|
39 |
|
40 |
function clesecondaire($id,$db,$val,$debug){ |
41 |
parent::cleSecondaire($id,&$db,$val,$debug); |
42 |
// controle de cle secondaire particulier |
43 |
$sql = "select * from regle where id =".$id." and controle='travaux'"; |
44 |
$res = $db->query($sql); |
45 |
if($debug==1) echo $sql; |
46 |
if (database::isError($res)) |
47 |
die($res->getMessage(). " => Echec ".$sql); |
48 |
else{ |
49 |
$nbligne=$res->numrows(); |
50 |
$this->msg = $this->msg."<br>"._('il_y_a')." ".$nbligne. |
51 |
" "._('enregistrement').' '._('table')." \"regle\" ". |
52 |
_('travaux')." [". |
53 |
$id."]<br>"; |
54 |
if ($nbligne>0) |
55 |
$this->correct=false; |
56 |
} |
57 |
} |
58 |
} // fin class |
59 |
?> |