1 |
<?php |
<?php |
2 |
//$Id$ |
//$Id$ |
|
//gen openMairie le 04/11/2010 17:47 |
|
3 |
include('../gen/sql/pgsql/om_etat.inc.php'); |
include('../gen/sql/pgsql/om_etat.inc.php'); |
|
$table=DB_PREFIXE."om_etat inner join ".DB_PREFIXE."om_collectivite on om_collectivite.om_collectivite = om_etat.om_collectivite"; |
|
4 |
|
|
5 |
$champAffiche=array('om_etat','om_collectivite.libelle as collectivite','id','om_etat.libelle','om_etat.actif'); |
// |
6 |
$champRecherche=array('id','om_etat.libelle','om_collectivite.libelle','om_etat.actif','niveau'); |
$champAffiche = array( |
7 |
$href[3] = array( |
'om_etat.om_etat as "'._("om_etat").'"', |
8 |
"lien" => "../scr/valid_copie.php?obj=".$obj."&idx=", |
'om_etat.id as "'._("id").'"', |
9 |
"id" => "", |
'om_etat.libelle as "'._("libelle").'"', |
10 |
"lib" => "<span class=\"om-icon om-icon-16 om-icon-fix copy-16\" title=\""._("Copier")."\">"._("Copier")."</span>", |
"case om_etat.actif when 't' then 'Oui' else 'Non' end as \""._("actif")."\"", |
11 |
|
'om_collectivite.niveau as "'._("niveau").'"', |
12 |
); |
); |
13 |
if ($_SESSION['niveau']== '2') |
// |
14 |
$selection=''; |
if ($_SESSION['niveau'] == '2') { |
15 |
else{ |
array_push($champAffiche, "om_collectivite.libelle as \""._("collectivite")."\""); |
16 |
$selection=" where om_etat.om_collectivite = '".$_SESSION['collectivite']."' or niveau ='2'"; |
} |
17 |
|
// |
18 |
|
$champRecherche = array( |
19 |
|
'om_etat.om_etat as "'._("om_etat").'"', |
20 |
|
'om_etat.id as "'._("id").'"', |
21 |
|
'om_etat.libelle as "'._("libelle").'"', |
22 |
|
'om_collectivite.niveau as "'._("niveau").'"', |
23 |
|
); |
24 |
|
// |
25 |
|
if ($_SESSION['niveau'] == '2') { |
26 |
|
array_push($champRecherche, "om_collectivite.libelle as \""._("collectivite")."\""); |
27 |
|
} |
28 |
|
// |
29 |
|
if (isset($f) && $f->isAccredited(array($obj, $obj."_copier"), "OR")) { |
30 |
|
// |
31 |
|
$href_copie = array( |
32 |
|
"lien" => "../scr/valid_copie.php?obj=".$obj."&idx=", |
33 |
|
"id" => "", |
34 |
|
"lib" => "<span class=\"om-icon om-icon-16 om-icon-fix copy-16\" title=\""._("Copier")."\">"._("Copier")."</span>", |
35 |
|
); |
36 |
|
// |
37 |
|
$href[3] = $href_copie; |
38 |
|
} else { |
39 |
|
// |
40 |
|
$href_copie = array("lien" => "", "id" => "", "lib" => ""); |
41 |
|
} |
42 |
|
|
43 |
|
/** |
44 |
|
* Options |
45 |
|
*/ |
46 |
|
if ($_SESSION['niveau'] == '2') { |
47 |
|
$selection = ""; |
48 |
|
} else { |
49 |
|
$selection = " where (".$obj.".om_collectivite='".$_SESSION['collectivite']."' or niveau='2')"; |
50 |
$options = array(); |
$options = array(); |
51 |
$option = array( |
$option = array( |
52 |
"type" => "condition", |
"type" => "condition", |
53 |
"field" => "niveau", |
"field" => "om_collectivite.niveau", |
54 |
"case" => array( |
"case" => array( |
55 |
"0" => array( |
"0" => array( |
56 |
"values" => array('2', ), |
"values" => array('2', ), |
59 |
0 => array("lien" => "", "id" => "", "lib" => ""), |
0 => array("lien" => "", "id" => "", "lib" => ""), |
60 |
1 => array("lien" => "", "id" => "", "lib" => ""), |
1 => array("lien" => "", "id" => "", "lib" => ""), |
61 |
2 => array("lien" => "", "id" => "", "lib" => ""), |
2 => array("lien" => "", "id" => "", "lib" => ""), |
62 |
3 => array("lien" => "xxx", "id" => "", "lib" => "sss"), |
3 => $href_copie, |
63 |
), |
), |
64 |
), |
), |
65 |
), |
), |
66 |
); |
); |
67 |
array_push($options, $option); |
array_push($options, $option); |
68 |
} |
} |
|
?> |
|
69 |
|
|
70 |
|
?> |