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