"._("division"); $om_validite = true; if(!isset($premier)) $premier=''; if(!isset($recherche1)) $recherche1=''; if(!isset($tricolsf)) $tricolsf=''; if(!isset($premiersf)) $premiersf=''; if(!isset($selection)) $selection=''; if(!isset($retourformulaire)) $retourformulaire=''; if (isset($idx) && $idx != ']' && trim($idx) != '') { $ent .= "-> ".$idx." "; } if (isset($idz) && trim($idz) != '') { $ent .= " ".strtoupper($idz)." "; } // FROM $table = DB_PREFIXE."division LEFT JOIN ".DB_PREFIXE."direction ON division.direction=direction.direction "; // SELECT $champAffiche = array( 'division.division as "'._("division").'"', 'division.code as "'._("code").'"', 'division.libelle as "'._("libelle").'"', 'division.chef as "'._("chef").'"', 'direction.libelle as "'._("direction").'"', 'to_char(division.om_validite_debut ,\'DD/MM/YYYY\') as "'._("om_validite_debut").'"', 'to_char(division.om_validite_fin ,\'DD/MM/YYYY\') as "'._("om_validite_fin").'"', ); // $champNonAffiche = array( 'division.description as "'._("description").'"', ); // $champRecherche = array( 'division.division as "'._("division").'"', 'division.code as "'._("code").'"', 'division.libelle as "'._("libelle").'"', 'division.chef as "'._("chef").'"', 'direction.libelle as "'._("direction").'"', ); $tri="ORDER BY division.libelle ASC NULLS LAST"; $edition="division"; /** * Gestion de la clause WHERE => $selection */ // Filtre listing standard $selection = " WHERE ((division.om_validite_debut IS NULL AND (division.om_validite_fin IS NULL OR division.om_validite_fin > CURRENT_DATE)) OR (division.om_validite_debut <= CURRENT_DATE AND (division.om_validite_fin IS NULL OR division.om_validite_fin > CURRENT_DATE)))"; $where_om_validite = " WHERE ((division.om_validite_debut IS NULL AND (division.om_validite_fin IS NULL OR division.om_validite_fin > CURRENT_DATE)) OR (division.om_validite_debut <= CURRENT_DATE AND (division.om_validite_fin IS NULL OR division.om_validite_fin > CURRENT_DATE)))"; // Liste des clés étrangères avec leurs éventuelles surcharges $foreign_keys_extended = array( "direction" => array("direction", ), ); // Filtre listing sous formulaire - direction if (in_array($retourformulaire, $foreign_keys_extended["direction"])) { $selection = " WHERE (division.direction = '".$idx."') AND ((division.om_validite_debut IS NULL AND (division.om_validite_fin IS NULL OR division.om_validite_fin > CURRENT_DATE)) OR (division.om_validite_debut <= CURRENT_DATE AND (division.om_validite_fin IS NULL OR division.om_validite_fin > CURRENT_DATE)))"; $where_om_validite = " AND ((division.om_validite_debut IS NULL AND (division.om_validite_fin IS NULL OR division.om_validite_fin > CURRENT_DATE)) OR (division.om_validite_debut <= CURRENT_DATE AND (division.om_validite_fin IS NULL OR division.om_validite_fin > CURRENT_DATE)))"; } // Gestion OMValidité - Suppression du filtre si paramètre if (isset($_GET["valide"]) and $_GET["valide"] == "false") { if (!isset($where_om_validite) or (isset($where_om_validite) and $where_om_validite == "")) { if (trim($selection) != "") { $selection = ""; } } else { $selection = trim(str_replace($where_om_validite, "", $selection)); } } /** * Gestion SOUSFORMULAIRE => $sousformulaire */ $sousformulaire = array( 'dossier', 'instructeur', ); ?>