1 |
fraynaud |
3 |
<?php |
2 |
fmichon |
2265 |
/** |
3 |
|
|
* |
4 |
|
|
* |
5 |
|
|
* @package openmairie_exemple |
6 |
|
|
* @version SVN : $Id: om_etat.inc.php 2467 2013-09-09 08:01:04Z fmichon $ |
7 |
|
|
*/ |
8 |
fraynaud |
3 |
|
9 |
nhaye |
391 |
// |
10 |
fmichon |
2265 |
include "../gen/sql/pgsql/om_etat.inc.php"; |
11 |
|
|
|
12 |
|
|
// |
13 |
nhaye |
391 |
$champAffiche = array( |
14 |
|
|
'om_etat.om_etat as "'._("om_etat").'"', |
15 |
|
|
'om_etat.id as "'._("id").'"', |
16 |
|
|
'om_etat.libelle as "'._("libelle").'"', |
17 |
|
|
"case om_etat.actif when 't' then 'Oui' else 'Non' end as \""._("actif")."\"", |
18 |
|
|
'om_collectivite.niveau as "'._("niveau").'"', |
19 |
fraynaud |
3 |
); |
20 |
nhaye |
391 |
// |
21 |
|
|
if ($_SESSION['niveau'] == '2') { |
22 |
|
|
array_push($champAffiche, "om_collectivite.libelle as \""._("collectivite")."\""); |
23 |
|
|
} |
24 |
|
|
// |
25 |
|
|
$champRecherche = array( |
26 |
|
|
'om_etat.om_etat as "'._("om_etat").'"', |
27 |
|
|
'om_etat.id as "'._("id").'"', |
28 |
|
|
'om_etat.libelle as "'._("libelle").'"', |
29 |
|
|
'om_collectivite.niveau as "'._("niveau").'"', |
30 |
|
|
); |
31 |
|
|
// |
32 |
|
|
if ($_SESSION['niveau'] == '2') { |
33 |
|
|
array_push($champRecherche, "om_collectivite.libelle as \""._("collectivite")."\""); |
34 |
|
|
} |
35 |
|
|
// |
36 |
|
|
if (isset($f) && $f->isAccredited(array($obj, $obj."_copier"), "OR")) { |
37 |
|
|
// |
38 |
|
|
$href_copie = array( |
39 |
|
|
"lien" => "../scr/valid_copie.php?obj=".$obj."&idx=", |
40 |
|
|
"id" => "", |
41 |
|
|
"lib" => "<span class=\"om-icon om-icon-16 om-icon-fix copy-16\" title=\""._("Copier")."\">"._("Copier")."</span>", |
42 |
|
|
); |
43 |
|
|
// |
44 |
|
|
$href[3] = $href_copie; |
45 |
|
|
} else { |
46 |
|
|
// |
47 |
|
|
$href_copie = array("lien" => "", "id" => "", "lib" => ""); |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
/** |
51 |
|
|
* Options |
52 |
|
|
*/ |
53 |
|
|
if ($_SESSION['niveau'] == '2') { |
54 |
|
|
$selection = ""; |
55 |
fmichon |
2265 |
if ($retourformulaire== 'om_requete') { |
56 |
|
|
$selection .= " WHERE (".$obj.".om_sql ='".$idx."')"; |
57 |
|
|
} |
58 |
nhaye |
391 |
} else { |
59 |
fmichon |
2265 |
$selection = " WHERE (".$obj.".om_collectivite='".$_SESSION['collectivite']."' or niveau='2')"; |
60 |
fmichon |
1381 |
if ($retourformulaire== 'om_requete') { |
61 |
fmichon |
2265 |
$selection .= " AND (".$obj.".om_sql ='".$idx."')"; |
62 |
fmichon |
1381 |
} |
63 |
fmichon |
2265 |
} |
64 |
|
|
|
65 |
|
|
if ($_SESSION['niveau'] == '1') { |
66 |
fraynaud |
3 |
$options = array(); |
67 |
|
|
$option = array( |
68 |
|
|
"type" => "condition", |
69 |
nhaye |
391 |
"field" => "om_collectivite.niveau", |
70 |
fraynaud |
3 |
"case" => array( |
71 |
|
|
"0" => array( |
72 |
|
|
"values" => array('2', ), |
73 |
|
|
"style" => "tab_desactive", |
74 |
|
|
"href" => array( |
75 |
|
|
0 => array("lien" => "", "id" => "", "lib" => ""), |
76 |
|
|
1 => array("lien" => "", "id" => "", "lib" => ""), |
77 |
|
|
2 => array("lien" => "", "id" => "", "lib" => ""), |
78 |
nhaye |
391 |
3 => $href_copie, |
79 |
fraynaud |
3 |
), |
80 |
|
|
), |
81 |
|
|
), |
82 |
|
|
); |
83 |
|
|
array_push($options, $option); |
84 |
|
|
} |
85 |
nhaye |
391 |
|
86 |
|
|
?> |