Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 789 → Rev 790

/trunk/papyrus/applications/admin_menu/bibliotheque/adme_menu_classique.fonct.php
32,7 → 32,7
// pris connaissance de la licence CeCILL, et que vous en avez accepté les
// termes.
// ----
// CVS : $Id: adme_menu_classique.fonct.php,v 1.28 2006-03-15 09:30:50 florian Exp $
// CVS : $Id: adme_menu_classique.fonct.php,v 1.29 2006-03-23 20:24:59 ddelon Exp $
/**
* Fonctions de gestion des menus classiques
*
48,7 → 48,7
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
*@author Laurent COUDOUNEAU <lc@gsite.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.28 $ $Date: 2006-03-15 09:30:50 $
*@version $Revision: 1.29 $ $Date: 2006-03-23 20:24:59 $
// +------------------------------------------------------------------------------------------------------+
*/
 
77,6 → 77,8
*/
function ADME_afficherListeMenuClassique($db, $url, $adme_site_id, $adme_menu_id, $adme_action, $id_menu_a_deployer, $bln_premier_appel = true)
{
 
// Initialisation des variables :
$retour = '';
344,6 → 346,10
*/
function ADME_ajouterMenuClassique($db, $auth, $adme_site_id, $adme_menu_id)
{
$url=$GLOBALS['_GEN_commun']['url'];
$url->removeQueryString('adme_action');
//----------------------------------------------------------------------------
// Récupération d'infos sur le site principal.
$objet_site = GEN_lireInfoSitePrincipal($db, $adme_site_id);
575,8 → 581,48
if ($traduction) {
$requete = 'SELECT * '.
'FROM gen_i18n ';
// Recherche liste des menu deja traduits
$requete = 'SELECT distinct gm_ce_i18n '.
'FROM gen_menu_relation, gen_menu '.
'WHERE gmr_id_menu_01 = ' . $adme_menu_id .' '.
'AND gm_id_menu = gmr_id_menu_02 '.
'AND gmr_id_valeur = 2 '; // 2 = "avoir traduction"
$resultat = $db->query($requete) ;
if (DB::isError($resultat)) {
die( BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete) );
}
$not_in_langue='';
if ( $resultat->numRows() == 0 ) {
$not_in_langue="gi_id_i18n not in('".$aso_valeurs['gm_ce_i18n']."')";
}
else {
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$not_in_langue="'".$ligne->gm_ce_i18n."'".",".$not_in_langue;
$end="'".$ligne->gm_ce_i18n."'";
}
if ($not_in_langue) {
$not_in_langue="'".$aso_valeurs['gm_ce_i18n']."'".",".$not_in_langue;
$not_in_langue=' gi_id_i18n not in('.$not_in_langue.$end.')';
}
else {
$not_in_langue="gi_id_i18n not in('".$aso_valeurs['gm_ce_i18n']."')";
}
}
$resultat->free();
$requete = "SELECT * FROM gen_i18n where ".$not_in_langue;
/*$requete = 'SELECT * '.
'FROM gen_i18n ';*/
$resultat = $db->query($requete);
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
1443,7 → 1489,70
}
 
function ADME_verifier_traduction_possible($db, $url, $adme_site_id, $adme_menu_id) {
$aso_valeurs = GEN_lireInfoMenu($db, $adme_menu_id, DB_FETCHMODE_ASSOC);
if ($aso_valeurs === false) {
die('ERREUR Papyrus Administrateur de Menus : '.ADME_LG_ERREUR_INFO_MENU.'<br />'.
'Idenitifiant du menu n° : '. $adme_menu_id .'<br />'.
'Ligne n° : '. __LINE__ .'<br />'.
'Fichier n° : '. __FILE__ .'<br />');
}
// Recherche liste des menu deja traduits
$requete = 'SELECT distinct gm_ce_i18n '.
'FROM gen_menu_relation, gen_menu '.
'WHERE gmr_id_menu_01 = ' . $adme_menu_id .' '.
'AND gm_id_menu = gmr_id_menu_02 '.
'AND gmr_id_valeur = 2 '; // 2 = "avoir traduction"
$resultat = $db->query($requete) ;
if (DB::isError($resultat)) {
die( BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete) );
}
$not_in_langue='';
if ( $resultat->numRows() == 0 ) {
$not_in_langue="gi_id_i18n not in('".$aso_valeurs['gm_ce_i18n']."')";
}
else {
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
$not_in_langue="'".$ligne->gm_ce_i18n."'".",".$not_in_langue;
$end="'".$ligne->gm_ce_i18n."'";
}
if ($not_in_langue) {
$not_in_langue="'".$aso_valeurs['gm_ce_i18n']."'".",".$not_in_langue;
$not_in_langue=' gi_id_i18n not in('.$not_in_langue.$end.')';
}
else {
$not_in_langue="gi_id_i18n not in('".$aso_valeurs['gm_ce_i18n']."')";
}
}
$requete = "SELECT * FROM gen_i18n where ".$not_in_langue;
 
$resultat = $db->query($requete) ;
if (DB::isError($resultat)) {
die( BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete) );
}
$retour = $resultat->numRows();
$resultat->free();
$message='';
if ($retour == 0) {
$message = '<p class="pap_erreur">Plus de traduction possible pour ce menu </p>';
}
return $message;
}
 
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
1452,6 → 1561,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.28 2006/03/15 09:30:50 florian
* suppression des echos, qui entrainaient des problemes d'affichages
*
* Revision 1.27 2006/03/13 21:00:20 ddelon
* Suppression messages d'erreur multilinguisme
*