1 |
mbroquet |
3730 |
<?php |
2 |
fmichon |
4481 |
/** |
3 |
|
|
* DBFORM - 'parcelle' - Surcharge gen. |
4 |
|
|
* |
5 |
|
|
* Ce script permet de définir la classe 'parcelle'. |
6 |
|
|
* |
7 |
|
|
* @package openads |
8 |
|
|
* @version SVN : $Id$ |
9 |
|
|
*/ |
10 |
mbroquet |
3730 |
|
11 |
fmichon |
4481 |
require_once "../gen/obj/parcelle.class.php"; |
12 |
|
|
|
13 |
mbroquet |
3730 |
class parcelle extends parcelle_gen { |
14 |
|
|
|
15 |
|
|
function setvalF($val){ |
16 |
|
|
parent::setvalF($val); |
17 |
|
|
// enlever les valeurs a ne pas saisir |
18 |
|
|
unset ($this->valF['geom']); |
19 |
|
|
} |
20 |
|
|
|
21 |
|
|
function setType(&$form,$maj) { |
22 |
|
|
parent::setType($form,$maj); |
23 |
|
|
if ($maj < 2) { //ajouter et modifier |
24 |
|
|
$form->setType('geom', 'hidden'); |
25 |
|
|
$form->setType('section', 'hidden'); |
26 |
|
|
$form->setType('commune', 'hidden'); |
27 |
|
|
} |
28 |
|
|
} |
29 |
softime |
8989 |
|
30 |
|
|
/** |
31 |
|
|
* @return void |
32 |
|
|
*/ |
33 |
|
|
function verifier($val = array(), &$dnu1 = null, $dnu2 = null) { |
34 |
|
|
parent::verifier($val); |
35 |
mbroquet |
3730 |
/*Vérifie qu'une parcelle a bien été écrite*/ |
36 |
|
|
if (!preg_match('/^[0-9]{3} [A-Z]{1,3} [0-9]{1,5}$/', $val['parcelle']) && !preg_match('/^[0-9]{3}[A-Z]{1,3}[0-9]{1,5}$/', $val['parcelle'])){ |
37 |
|
|
$this->correct=false; |
38 |
softime |
18876 |
$this->addToMessage("<br>".__("format parcelle incorrect CCC LL CCC ou CCCLLCCC")); |
39 |
mbroquet |
3730 |
} |
40 |
|
|
} |
41 |
fmichon |
4481 |
|
42 |
|
|
} |
43 |
|
|
|
44 |
softime |
7996 |
|