Your IP : 216.73.217.64
<?php
/**
*
*
* @package openmairie_exemple
* @version SVN : $Id: om_lettretype.inc.php 2726 2014-03-07 08:59:25Z fmichon $
*/
//
include "../gen/sql/pgsql/om_lettretype.inc.php";
//
$champAffiche = array(
'om_lettretype.om_lettretype as "'._("om_lettretype").'"',
'om_lettretype.id as "'._("id").'"',
'om_lettretype.libelle as "'._("libelle").'"',
"case om_lettretype.actif when 't' then 'Oui' else 'Non' end as \""._("actif")."\"",
'om_collectivite.niveau as "'._("niveau").'"',
);
//
if ($_SESSION['niveau'] == '2') {
array_push($champAffiche, "om_collectivite.libelle as \""._("collectivite")."\"");
}
//
$champRecherche = array(
'om_lettretype.om_lettretype as "'._("om_lettretype").'"',
'om_lettretype.id as "'._("id").'"',
'om_lettretype.libelle as "'._("libelle").'"',
'om_collectivite.niveau as "'._("niveau").'"',
);
//
if ($_SESSION['niveau'] == '2') {
array_push($champRecherche, "om_collectivite.libelle as \""._("collectivite")."\"");
}
//
if (isset($f) && $f->isAccredited(array($obj, $obj."_copier"), "OR")) {
//
$href_copie = array(
"lien" => "../scr/valid_copie.php?obj=".$obj."&idx=",
"id" => "",
"lib" => "<span class=\"om-icon om-icon-16 om-icon-fix copy-16\" title=\""._("Copier")."\">"._("Copier")."</span>",
);
//
$href[3] = $href_copie;
} else {
//
$href_copie = array("lien" => "", "id" => "", "lib" => "");
}
/**
* Options
*/
if ($_SESSION['niveau'] == '2') {
$selection = "";
if ($retourformulaire== 'om_requete') {
$selection .= " WHERE (".$obj.".om_sql ='".$idx."')";
}
} else {
$selection = " WHERE (".$obj.".om_collectivite='".$_SESSION['collectivite']."' or niveau='2')";
if ($retourformulaire== 'om_requete') {
$selection .= " AND (".$obj.".om_sql ='".$idx."')";
}
}
if ($_SESSION['niveau'] == '1') {
$options = array();
$option = array(
"type" => "condition",
"field" => "om_collectivite.niveau",
"case" => array(
"0" => array(
"values" => array('2', ),
"style" => "tab_desactive",
"href" => array(
0 => array("lien" => "", "id" => "", "lib" => ""),
1 => array("lien" => "", "id" => "", "lib" => ""),
2 => array("lien" => "", "id" => "", "lib" => ""),
3 => $href_copie,
),
),
),
);
array_push($options, $option);
}
?>