</H2> <? if ($STEP=="") { ?> <h2>Bonjour !</h2> Cette page va vous permettre de visualiser ou (re)générer la table utilitaire (nommée <b><? echo $TBDname; ?></b>) permettant la description pour édition des autres tables de la base <b><? echo $DBName; ?></b><br><br> <h3><u>Attention:</u> Les operations qui suivent sont excessivement risquees...</b></h3> Selectionner une base dans la liste et cliquez sur le bouton SUITE ci-dessous pour commencer ...<Br> <form action="./CREATE_DESC_TABLES.php" method="post"> <h3>Liste des bases du serveur <I><? echo "$LBHost </I>($DBHost)"; ?><br> <? $tblbas=db_show_bases(); foreach($tblbas as $bas) { $tbldbas[$bas]=$bas; } DispLD($tbldbas,"DBName"); ?> <br><br> <input type="hidden" name="STEP" value="1"> <input type="submit" class="fxbutton" value="SUITE >>"> </form><br> <? } //FIN SI STEP="", ie page d'accueil else if ($STEP=="1") { $_SESSION["DBName"]=$DBName; ?> <? //mysql_select_db($DBName) or die ("Impossible d'ouvrir la base de donn�s $DBName."); ?> <h2>Etape 2</h2>
foreach ($tbltab as $tab) { //$lb = RecupLib($TBDname,"NM_TABLE","LIBELLE",$tab,"","NM_CHAMP='$NmChDT'"); // trop long, ça le fait ramer $tbltab4ld[$tab] = $tab.($lb ? ' ('.$lb.')': ''); } if ($_REQUEST['btv']) { // seulement si table virtuelle ?> <TR class="backredc"><TD>Table physique</TD><TD colspan="4"> <? DispLD($tbltab4ld,"physTable",$Mult="no",$Fccr="LDF"); ?> </TD></TR> <? } ?> <TR><TD>Table cible</TD><TD colspan="4"> <? echo str_ireplace("<select",'<select onchange=" majLdsAjaxFctTable(this.value);" ',DispLD($tbltab4ld,"dTable",$Mult="no",$Fccr="LDF",false)); ?> </TD></TR> <TR><TD>Champ(s) clé(s) dans la table cible</TD><TD colspan="4"> <div id="iddKeys4ajax"></div> </TD></TR> <TR class="THEAD"><td class="th">Variable</td><td class="th">Valeur</td><TD class="th" title="Caractères affichés avant le champ">Séparateur</TD><TD class="th">Classement</TD><TD class="th">Chain.</TD></TR> <? for ($i=1;$i<=nbchpaff;$i++) { // champs affichés?> <TR><TD>Champ affiché n°<?php echo $i; ?> </TD><TD> <div id="idd4ajaxChp<?php echo $i; ?> "></div>
/** /** * le plugin a ��modifi�de fa�n �permettre d'�re ins��plusieurs fois dans une m�e page et que le passage en singleview de l'un n'influence pas les autres */ function main($content, $conf) { $this->uid = substr(strstr($GLOBALS[GLOBALS][TSFE]->currentRecord, ":"), 1); if (strstr($this->cObj->currentRecord, "tt_content")) { $conf["pidList"] = $this->cObj->data["pages"]; $conf["recursive"] = $this->cObj->data["recursive"]; } $this->conf = $conf; // Setting the TypoScript passed to this function in $this->conf $this->pi_setPiVarDefaults(); $this->pi_loadLL(); // Loading the LOCAL_LANG values //$this->pi_moreParams="&pointeruid[".$this->uid."]=".$this->uid; /* !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!- modif: on ne se met et en mode singleView que si showUid!=" ET SURTOUT que si l'uid tt_content pass�correspond // au courant // voir aussi utilisation du dernier argument optionel de la la fonction pi_list_linkSingle qui permet de passer un tableau de hachage contenant autant d'arguments suppl�entaires que l'on veut !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!- */ /* if ($this->piVars["showUid"] && $this->piVars["ttc_uid"]==$this->uid) { // If a single element should be displayed: Maintenant la loupe se fait directement dans la liste */ // Affichage Titre verrue Elodie : si nom du dossier syst�e contenant les actus contient "_noinfo", pas de Logo actu ni titre, ni auteur en mode normal if (!strstr(txRecupLib("pages", "uid", "title", $this->conf['pidList']), "_noinfo")) { $content .= '<H2>' . $this->pi_getLL("titre_fe", "[titre_fe]") . '</H2>'; // <img src="'.$this->conf["extCurDir"].'picto_actu.gif" class="picto"> cette bourrique de Diane veut plus du picto } // si changement de page, on efface le contexte if ($_SESSION['datafvmnews']['pidcour'] != $this->cObj->data['pid']) { unset($_SESSION['datafvmnews']); } // gestion mode archive if (isset($this->piVars['arch_mode'])) { $_SESSION['vmnews_arch_mode'] = $this->piVars['arch_mode']; } $this->arch_mode = $this->cObj->data['layout'] >= 1 || $_SESSION['vmnews_arch_mode'] == 1; /* debug($this->cObj->data['layout'],"this->cObj->data['layout']"); debug($this->piVars,"this->piVars:");*/ //debug ($_SESSION,"sessione"); if ($this->arch_mode) { // mode archive //$GLOBALS["TSFE"]->set_no_cache(); // desactive la cache en mode archive sinon formulairee merde... $content .= '<a name="debform"></a>'; $content .= "<H3>" . $this->pi_getLL("rech_arch", "Rech arhives") . "</H3>"; $content .= $this->buttdisphiddarch(); $content .= "<H4>" . $this->pi_getLL("crit_arch", "Crit arhives") . "</H4>"; //debug($this->conf); //debug($_SESSION['datafvmnews'],"_SESSION['datafvmnews']"); // si formulaire envoyé, on met en session sa valeur; sinon quand on suit un lien vers le détail d'une actu, comme il n'y a pas de submit, on perd les critères courant if (isset($this->piVars['DATA']['test_f_sent'])) { if ($this->piVars['DATA']['datedebp'] != "") { $this->piVars['DATA']['datedebp'] = rmfDateF($this->piVars['DATA']['datedebp']); } if ($this->piVars['DATA']['datefinp'] != "") { $this->piVars['DATA']['datefinp'] = rmfDateF($this->piVars['DATA']['datefinp']); } $tsdtdebp = DateF2tstamp($this->piVars['DATA']['datedebp']); $tsdtfinp = DateF2tstamp($this->piVars['DATA']['datefinp']); if ($tsdtdebp > 0 && $tsdtfinp > 0 && $tsdtdebp > $tsdtfinp) { $errorcd = $this->pi_getLL("err_coher_dates", "erreur de cohérences sur les dates"); $this->piVars['DATA']['datefinp'] = ""; unset($_SESSION['datafvmnews']['datefinp']); } $_SESSION['datafvmnews'] = $this->piVars['DATA']; } if (!isset($_SESSION['datafvmnews']['emplact'])) { $this->piVars['DATA']['emplact'][0] = "'" . $this->cObj->data['pid'] . "'"; // si pas de sélection precedente, prend l'uid de la page courante $_SESSION['datafvmnews']['emplact'][0] = "'" . $this->cObj->data['pid'] . "'"; } $_SESSION['datafvmnews']['pidcour'] = $this->cObj->data['pid']; //debug(in_array($this->cObj->data['pid'],$_SESSION['datafvmnews']['emplact'])); //debug($this->piVars['DATA'],"this->piVars['DATA']:"); //debug($_SESSION['datafvmnews'],"_SESSION['datafvmnews']"); $reqroot = "SELECT pid FROM sys_template WHERE hidden = 0 AND root = 1 AND deleted = 0"; $resroot = mysql(TYPO3_db, $reqroot); if (mysql_num_rows($resroot) == 0) { die("This site seems to contain no root page"); } while ($rep = mysql_fetch_row($resroot)) { $tbpidroot[] = $rep[0]; } // debug root pid tables foreach ($tbpidroot as $pidroot) { $this->retTLDarbo($pidroot); } $this->tbemplact = array("%" => $this->pi_getLL("Indifferent", "Indifferent")) + $this->tbemplact; $LDEmplact = DispLD($this->tbemplact, $this->prefixId . '[DATA][emplact]', "yes", "", false); // liste d�oulante multi // avant DispLD n'etait pas compatible XHTML //$LDEmplact=str_replace("SELECTED",' selected="selected" ',$LDEmplact); $comment_fdate = " <small> ex. : 15/10/2005 </small>"; $cHash = md5(serialize($this->piVars['DATA'])); $content .= '<FORM action="' . $this->pi_getPageLink($GLOBALS["TSFE"]->id) . '?cHash=' . $cHash . '#debform" name="' . $this->prefixId . 'fname" method="POST">'; $content .= ' <INPUT TYPE="hidden" value="coucou" name="' . $this->prefixId . '[DATA][test_f_sent]" /> <TABLE><TR><TD width="120><label for="keywords">' . $this->pi_getLL("keywords", "Mots clés") . '</label></TD><TD><INPUT id="keywords" type="text" size="60" value="' . $_SESSION['datafvmnews']['keywords'] . '" name="' . $this->prefixId . '[DATA][keywords]" /> </TD></TR><TR><TD> <label for="and_or">' . $this->pi_getLL("and_or", "Et/ou") . '</label></TD><TD><INPUT type="radio" id="and_or" ' . ($_SESSION['datafvmnews']["and_or"] != "OR" ? ' checked="checked" ' : '') . ' name="' . $this->prefixId . '[DATA][and_or]" value="AND">' . $this->pi_getLL("AND", "ET") . ' <INPUT type="radio" name="' . $this->prefixId . '[DATA][and_or]" value="OR" ' . ($_SESSION['datafvmnews']["and_or"] == "OR" ? ' checked="checked" ' : '') . '>' . $this->pi_getLL("OR", "OU") . '</TD></TR><TR> <TD> <label for="datedebp">' . $this->pi_getLL("datedebp", "Datedebp") . '</label></TD><TD><INPUT id="datedebp" type="text" size="12" value="' . $_SESSION['datafvmnews']['datedebp'] . '" name="' . $this->prefixId . '[DATA][datedebp]" />' . $comment_fdate . ' </TD</TR><TR><TD> <label for="datefinp">' . $this->pi_getLL("datefinp", "Datefinp") . '</label></TD><TD><INPUT id="datefinp" type="text" size="12" value="' . $_SESSION['datafvmnews']['datefinp'] . '" name="' . $this->prefixId . '[DATA][datefinp]" /> ' . $comment_fdate . ($errorcd ? '<BR><span style="color:red">' . $errorcd . '<span>' : "") . '</TD></TR><TR><TD> <label for="emplact">' . $this->pi_getLL("Emplact", "emplact") . '</label></TD><TD>' . $LDEmplact . ' </TD></TR><TR><TD> <INPUT ' . $this->pi_classParam("submit-button") . ' type="button" name="' . $this->prefixId . '[reset_button]" value="' . $this->pi_getLL("Reset", "Annuler") . '" onclick="getElementById(\'keywords\').value=\'\'; getElementById(\'datedebp\').value=\'\'; getElementById(\'datefinp\').value=\'\';"> </TD><TD> <INPUT ' . $this->pi_classParam("submit-button") . ' type="submit" name="' . $this->prefixId . '[submit_button]" value="' . $this->pi_getLL("rechercher", "Rechercher") . '"> </TD></TR></TABLE> <HR/>'; $content .= '</FORM>'; } //debug($this->cObj->data['pid']); uidd e la page courante //debug($this->uid); //debug($this->piVars); if (!isset($this->piVars["pointer"])) { $this->piVars["pointer"] = 0; } if (!isset($this->piVars["mode"])) { $this->piVars["mode"] = 1; } // Initializing the query parameters: list($this->internal["orderBy"], $this->internal["descFlag"]) = explode(":", $this->piVars["sort"]); //debug($this->piVars); $this->internal["results_at_a_time"] = t3lib_div::intInRange($conf["results_at_a_time"], 0, 1000, 3); // Number of results to show in a listing. $this->internal["maxPages"] = t3lib_div::intInRange($conf["maxPages"], 0, 1000, 2); // The maximum number of "pages" in the browse-box: "Page 1", "Page 2", etc. $this->internal["searchFieldList"] = "title,abstract,bodytext"; $this->internal["orderByList"] = "tstamp,uid,title"; if ($this->arch_mode) { // envoie la requete spéciale if (isset($_SESSION['datafvmnews']['keywords'])) { $_SESSION['datafvmnews']['keywords'] = addslashes($_SESSION['datafvmnews']['keywords']); $tbkeyw = explode(" ", $_SESSION['datafvmnews']['keywords']); foreach ($tbkeyw as $keyw) { $whk .= " __nom_chp__ LIKE '%{$keyw}%' __op__ "; } $whk = vdc($whk, 7); $whk = "(" . str_replace("__op__", $_SESSION['datafvmnews']["and_or"], $whk) . ")"; $whk = "(" . str_replace("__nom_chp__", "title", $whk) . " OR " . str_replace("__nom_chp__", "abstract", $whk) . " OR " . str_replace("__nom_chp__", "bodytext", $whk) . ")"; } if ($_SESSION['datafvmnews']['datedebp'] != "") { $whdp = "( (starttime> " . DateF2tstamp($_SESSION['datafvmnews']['datedebp']) . ") OR ( starttime=0 AND tstamp > " . DateF2tstamp($_SESSION['datafvmnews']['datedebp']) . ") )"; } if ($_SESSION['datafvmnews']['datefinp'] != "") { $whfp = "( (endtime>0 AND endtime < " . DateF2tstamp($_SESSION['datafvmnews']['datefinp']) . ") OR ( endtime=0 AND tstamp < " . DateF2tstamp($_SESSION['datafvmnews']['datefinp']) . ") )"; } $whg = "from tx_vm19news_news WHERE deleted=0 AND hidden=0 "; $whg .= ($whk ? " AND " : "") . $whk; $whg .= ($whdp ? " AND " : "") . $whdp; $whg .= ($whfp ? " AND " : "") . $whfp; if ($_SESSION['datafvmnews']['emplact'][0] != "%") { $whg .= " AND pid IN (" . implode(",", $_SESSION['datafvmnews']['emplact']) . ")"; } //debug ($whg,"where avant :"); $query = $this->pi_list_query("tx_vm19news_news", 1, '', '', '', '', $whg); // le 1 sert a compter seulement //debug ($query,"query apres :"); //pi_list_query($table,$count=0,$addWhere='',$mm_cat='',$groupBy='',$orderBy='',$query='',$returnQueryArray=FALSE) } else { // anciennee methode "normale", ... mais on a rajouté l'affichage sur d'autres pages pr 1 meme actu... //$query = $this->pi_list_query("tx_vm19news_news",1); $whg = "from tx_vm19news_news WHERE deleted=0 AND hidden=0 "; $whg .= "AND ( starttime< " . time() . ' OR starttime=0 )'; $whg .= " AND ( endtime> " . time() . ' OR endtime=0 )'; $pidc = $this->cObj->data['pid']; $whg .= " AND (pid={$pidc} OR otherpages LIKE '{$pidc},%' OR otherpages LIKE '%,{$pidc},%' OR otherpages LIKE '%,{$pidc}')"; $query = $this->pi_list_query("tx_vm19news_news", 1, '', '', '', '', $whg); // le 1 sert a compter seulement //debug($query); } $res = mysql(TYPO3_db, $query); //debug($query); if (mysql_error()) { debug(array(mysql_error(), $query)); } list($this->internal["res_count"]) = mysql_fetch_row($res); # $content.=t3lib_div::view_array($this->piVars); // DEBUG: Output the content of $this->piVars for debug purposes. REMEMBER to comment out the IP-lock in the debug() function in t3lib/config_default.php if nothing happens when you un-comment this line! if ($this->internal["res_count"] > 0) { // Make listing query, pass query to MySQL: //pi_list_query($table, $count=0, $addWhere="", $mm_cat="", $groupBy="", $orderBy="", $query="") if ($this->arch_mode) { $content .= '<div class="nbrep_r">' . $this->pi_getLL("nb_news_r", "[nb_news]") . " : <b>" . $this->internal["res_count"] . "</b></div>"; //$query="SELECT * ".$whg." ORDER BY sorting,tstamp DESC"; // le fait de passer par pi_list_query permet d'utiliser la pagination native $query = $this->pi_list_query("tx_vm19news_news", 0, '', '', '', "ORDER BY sorting,tstamp DESC", $whg); } else { // anciennee methode "normale", ... mais on a rajouté l'affichage sur d'autres pages pr 1 meme actu... //$query = $this->pi_list_query("tx_vm19news_news",0,"","","","ORDER BY sorting,tstamp DESC"); $query = $this->pi_list_query("tx_vm19news_news", 0, '', '', '', "ORDER BY sorting,tstamp DESC", $whg); } $res = mysql(TYPO3_db, $query); if (mysql_error()) { debug(array(mysql_error(), $query)); } $this->internal["currentTable"] = "tx_vm19news_news"; // Adds the mode selector. //$content.=$this->pi_list_modeSelector($items); // Adds the whole list table $content .= $this->makelist($res); // Adds the search box: //$content.=$this->pi_list_searchBox(); // Adds the result browser: // Adds the result browser, seulement s'il y a assez de r�ultats if ($this->internal["res_count"] > $this->internal["results_at_a_time"]) { $content .= $this->pi_list_browseresults(); } } else { $content .= $this->pi_getLL("no_news" . ($this->arch_mode ? "1" : ""), "[no_news]"); } $content .= "<BR/>" . $this->buttdisphiddarch(); //$content.=$this->pi_list_browseresults(); // Returns the content from the plugin. return $this->pi_wrapInBaseClass($content); }
// si adm d'UF et création ou modif // pour la liste d'UF, n'affiche que celle dont il est l'adm if ($TypEdit=="") $CIL[SOC_NUUNITE]->ValChp=$ss_InfoUser[NUUNITEG];// en création, on met tjrs par def l'UF gérée par le user // if (($ss_InfoUser[COPROFIL]=="UF_ADM" || $ss_InfoUser[COPROFIL]=="EXT_GEST") && $TypEdit!="C") { if (($ss_InfoUser[COPROFIL]=="UF_ADM" ) && $TypEdit!="C") { echo "<tr><td>".$CIL[SOC_NUUNITE]->Libelle."</td><td>"; echo " Unité $ss_InfoUser[NUUNITEG]"; $TbUf=TbUFdep($ss_InfoUser[NUUNITEG]); // super fonction qui ramène un tableau associatif foreach ($TbUf as $val) { $tbld[$val]=Recuplib("UNITE_FONCTION","UFO_NUUNITE","UFO_LLUNITE",$val); // detection de la valeur existante if ($CIL[SOC_NUUNITE]->ValChp==$val) $tbld[$val]=$VSLD.$tbld[$val]; } // fin boucle détection valeur DispLD($tbld,"SOC_NUUNITE","no"); } else EchoLig("SOC_NUUNITE"); ?> <tr><td colspan="2" align="center"> <a name="bas"> <br> <a href="javascript:self.close();"><img src="../../intranet/partage/IMAGES/bout_fermer.gif" border="0" width="70" height="11" alt="Fermer cette fenêtre"></a> <? // boutons valider et annuler que quand read only false if ($ss_prmev[ro]!="C") { ?> <A HREF="javascript:ConfReset()" title="RAZ du formulaire"><IMG src="../../intranet/partage/IMAGES/annuler.gif" border="0"></a> <INPUT TYPE="image" src="../../intranet/partage/IMAGES/valider.gif" border="0"> <?} ?> </td></tr></table> </div></BODY>
<td> <? $tbvalsql=array(" SELECT " =>" SELECT "," * " =>" * "," FROM " =>" FROM "," WHERE " =>" WHERE "," ORDER BY " =>" ORDER BY"," LEFT JOIN " =>" LEFT JOIN "); $rqtb=msq("select NM_TABLE,NM_CHAMP,LIBELLE from $TBDname where NM_TABLE NOT LIKE '__reqcust' AND NM_TABLE NOT LIKE '$id_vtb%' AND NM_CHAMP='$NmChDT' ORDER BY ORDAFF_L"); while ($rstb=db_fetch_array($rqtb)) { $tbvalsql[' `'.$rstb['NM_TABLE'].'` ']=$rstb['LIBELLE']; $rqchp=msq("select NM_TABLE,NM_CHAMP,LIBELLE from $TBDname where NM_TABLE='".$rstb['NM_TABLE']."' AND NM_CHAMP!='$NmChDT' ORDER BY ORDAFF"); while ($rschp=db_fetch_array($rqchp)) { $tbvalsql[' `'.$rstb['NM_TABLE'].'`.`'.$rschp['NM_CHAMP'].'` ']="-- ".tradLib($rschp['LIBELLE']); // le nom de table fout la merde avec PYA ??? //$tbvalsql[' `'.$rschp['NM_CHAMP'].'` ']="-- ".$rschp['LIBELLE']; } } // fin boucle sur les tables DispLD($tbvalsql, "sql_words","yes"); ?> <SCRIPT language="JavaScript"> // modifie l'evenement double clic de la liste document.theform.getElementById('sql_words').ondblclick = insertValueQuery; </script> </td> </tr></table> <br/> <h2><?php echo trad(LT_param); ?> </h2> <?php echo trad(LT_nblig_aff_ppage);
echo trad("IND_bddpasswd"); ?> <br> <input type="password" name="lc_parenv[MySqlPasswd]" value="<?php echo isset($ss_parenv['MySqlPasswd']) ? $ss_parenv['MySqlPasswd'] : $DBPass; ?> "></H4> <H4><?php echo trad("IND_pyauser"); ?> <br> <input type="text" name="lc_CO_USMAJ" value="<?php echo ${$VarNomUserMAJ}; ?> "></H4> <H4><? echo trad("IND_choilang")."<br/>"; DispLD($tb_langs,"lc_parenv[lang]")?></H4> <H4><? echo trad("IND_encoding")."<br/>"; DispLD($tb_encodes,"lc_parenv[encoding]")?></H4> <br><br> <input class="fxbutton" type="submit" value="<?php echo trad("BT_valider"); ?> "> </form> </blockquote> <? include ("footer.php"); ?> </BODY> </html>
function DispLDandTxt ($tbval,$nmC,$valC="",$DirEcho=true,$idC="") { global $VSLD; if ($idC=="") $idC=$nmC; $kex = false; foreach ($tbval as $k=>$v) { if ($k == $valC) { $tbval[$k] = $VSLD.$v; $kex = true; } } $tbval = array('OTH' => (!$kex ? $VSLD : "").($_SESSION["NoLang"] > 0 ? "Other" : "Autre")) + $tbval; // CheckLDandTxt est dans php_inc/jQuery/shared_inc.js.php $retVal .= str_replace("<SELECT",'<SELECT onchange="CheckLDandTxt(\''.$idC.'\');"',DispLD($tbval,"assLD4Txt".$idC,"no","LDF",false)); if ($kex) { $type = 'hidden'; } else $type = 'text'; $retVal .= '<input type="'.$type.'" value="'.$valC.'" name="'.$nmC.'" id="'.$idC.'">'; if ($DirEcho) { echo $retVal; } else return $retVal; }
"></b> <h3>Actions disponibles:</h3> <h4>Import de fichiers trk ou wpt (CartoExplorer)</h4> Sélectionner une discpline dans la liste :<br/> <?php // nouvel objet pour sélection liste déroulante disciplines $ObjSeLD = new PYAobj(); $ObjSeLD->NmBase = $dbname; $ObjSeLD->NmTable = "parcours"; $ObjSeLD->NmChamp = "parcours_discp"; $ObjSeLD->InitPO(); $tabLD = ttChpLink($ObjSeLD->Valeurs); $tabLD = array(0 => "Aucun") + $tabLD; DispLD($tabLD, "LDCats", "no", ""); ?> Sélectionner le fichier à importer : <input type="file" name="ce3file"><BR/> <input type="radio" name="actionname" value="impce3file">Import Fichier CE3<BR/> <hr/> <h4>Import du SIG Régional en shp</h4> Opérations à réaliser pour un import Kayak du SIG Regional:<br><pre> - Supprimer la table temporaire zimptmp_parc_kk (plus obligé si option -d passé à shp2pgsql) - exécuter les commandes /usr/local/pgsql/bin/shp2pgsql -d Parcours.shp zimptmp_parc_kk > /tmp/zimptmp_parc_kk.sql - puis (en user pguser) psql etoil < /tmp/zimptmp_parc_kk.sql </pre> <input type="radio" name="actionname" value="impkksigrshp">Import Kayak SIG R (shp)<BR/> <hr/>