1 |
<?php |
2 |
/** |
3 |
* |
4 |
* |
5 |
* @package openmairie_exemple |
6 |
* @version SVN : $Id: om_etat.inc.php 2467 2013-09-09 08:01:04Z fmichon $ |
7 |
*/ |
8 |
|
9 |
// |
10 |
include "../gen/sql/pgsql/om_etat.inc.php"; |
11 |
|
12 |
// |
13 |
$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 |
); |
20 |
// |
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 |
if ($retourformulaire== 'om_requete') { |
56 |
$selection .= " WHERE (".$obj.".om_sql ='".$idx."')"; |
57 |
} |
58 |
} else { |
59 |
$selection = " WHERE (".$obj.".om_collectivite='".$_SESSION['collectivite']."' or niveau='2')"; |
60 |
if ($retourformulaire== 'om_requete') { |
61 |
$selection .= " AND (".$obj.".om_sql ='".$idx."')"; |
62 |
} |
63 |
} |
64 |
|
65 |
if ($_SESSION['niveau'] == '1') { |
66 |
$options = array(); |
67 |
$option = array( |
68 |
"type" => "condition", |
69 |
"field" => "om_collectivite.niveau", |
70 |
"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 |
3 => $href_copie, |
79 |
), |
80 |
), |
81 |
), |
82 |
); |
83 |
array_push($options, $option); |
84 |
} |
85 |
|
86 |
?> |