[SPIP Zone] [Spip-zone-commit] r28606 - /_plugins_/_dev_/gis/inc/parte_privada.php

Bonjour,

en lisant

je me suis rendu compte que ton email 'impersonnel' était peu pratique pour savoir qui avait commit puisque trac n'affiche plus maintenant que
'listes@…'
Ce serait cool si tu pouvais proposer un email plus signifiant et plus identifiant pour tes commits (je parle surtout de la partie avant le @)

Merci
Cédric

Le 12 mai 09 à 13:52, listes@nouveauxterritoires.fr a écrit :

Author: listes@nouveauxterritoires.fr
Date: Tue May 12 13:52:20 2009
New Revision: 28606

Log:
meilleure gestion des puces pour les cartes GoogleMaps

Modified:
   _plugins_/_dev_/gis/inc/parte_privada.php

Modified: _plugins_/_dev_/gis/inc/parte_privada.php

--- _plugins_/_dev_/gis/inc/parte_privada.php (original)
+++ _plugins_/_dev_/gis/inc/parte_privada.php Tue May 12 13:52:20 2009
@@ -14,6 +14,7 @@
function gis_cambiar_coord($id,$table,$exec) {
  global $spip_lang_left, $spip_lang_right;
  
+
  $pkey = id_table_objet($table);
  
  $glat = NULL;
@@ -41,17 +42,80 @@
    sql_delete("spip_gis", array("$pkey = " . sql_quote($id)));
  }
  if ($glat!==NULL){
- $resultMots = spip_query("SELECT * FROM spip_mots_{$table}s WHERE $pkey = ".intval($id));
- while ($rowMot = spip_fetch_array($resultMots)) {
- $resultMotIcon = spip_query("SELECT * FROM spip_mots WHERE type ='marker_icon' AND id_mot=".$rowMot['id_mot']);
- if ($rowMotIcon = spip_fetch_array($resultMotIcon)){
- if (file_exists("../IMG/"."moton".$rowMot['id_mot'].".png")) {
- $gicon = "moton".$rowMot['id_mot'].".png";
- } else if (file_exists("../IMG/"."moton".$rowMot['id_mot'].".gif")) {
- $gicon = "moton".$rowMot['id_mot'].".gif";
+ // on cherche un mot clŽ pour cet(te) article/rubrique
+ $nbMots = sql_countsel("spip_mots_{$table}s smt, spip_mots sm","smt.$pkey=".intval($id)." and smt.id_mot=sm.id_mot and sm.type='marker_icon'");
+ //echo "nbMots : ", $nbMots,"<br>";
+ if ($nbMots > 0) {
+ // il existe un mot-clŽ pour cet(te) article/rubrique du groupe de mots 'marker_icon'
+ // on recherche son identifiant
+ $id_mot = sql_getfetsel("smt.id_mot","spip_mots_{$table}s smt, spip_mots sm","smt.$pkey=".intval($id)." and smt.id_mot=sm.id_mot and sm.type='marker_icon'");
+ if ($id_mot != '') {
+ if (file_exists(_DIR_IMG."/moton$id_mot.png")) {
+ $gicon = "moton$id_mot.png";
+ } else if (file_exists(_DIR_IMG."/moton$id_mot.gif")) {
+ $gicon = "moton$id_mot.gif";
+ }
+ }
+ } else {
+ // l'article/ rubrique n'a pas de puce associŽ --> on cherche dans sa hiŽrarchie
+ $nomTable = table_objet($table);
+ $parents = array();
+ $id_parent = 0;
+ if ($nomTable == 'articles') {
+ // table articles
+ $id_parent = sql_getfetsel("id_rubrique","spip_articles","id_article=".intval($id));
+ $parents = $id_parent;
+ } else if ($nomTable == 'rubriques') {
+ // table rubriques
+ $id_parent = sql_getfetsel("id_parent","spip_rubriques","id_rubrique=".intval($id));
+ $parents = $id_parent;
+ }
+
+ // ensuite on cherche toutes les rubriques parent de cet objet
+ while ($id_parent != 0) {
+ $id_parent = sql_getfetsel("id_parent","spip_rubriques","id_rubrique=".intval($id_parent));
+ if ($id_parent != 0) {
+ $parents = $id_parent;
+ }
+ }
+
+ if (count($parents) > 0) {
+ // on a donc des rubriques parents, on en cherche une qui a un mot clŽ de type 'marker_icon'
+ foreach ($parents as $id_parent) {
+ $nbMots = sql_countsel("spip_mots_rubriques smr, spip_mots sm","smr.id_rubrique=".intval($id_parent)." and smr.id_mot=sm.id_mot and sm.type='marker_icon'");
+ if ($nbMots > 0) {
+ // il existe un mot-clŽ pour cette rubrique du groupe de mots 'marker_icon'
+ // on recherche son identifiant
+ $id_mot = sql_getfetsel("smr.id_mot","spip_mots_rubriques smr, spip_mots sm","smr.id_rubrique=".intval($id_parent)." and smr.id_mot=sm.id_mot and sm.type='marker_icon'");
+ if ($id_mot != '') {
+ if (file_exists(_DIR_IMG."/moton$id_mot.png")) {
+ $gicon = "moton$id_mot.png";
+ break;
+ } else if (file_exists(_DIR_IMG."/moton$id_mot.gif")) {
+ $gicon = "moton$id_mot.gif";
+ break;
        }
      }
    }
+ }
+ }
+
+ if ($gicon == '') {
+ // pas d'icone trouvŽ
+ // on recherche le mot clŽ 'default' de type 'marker_icon'
+ $id_mot = sql_getfetsel("id_mot","spip_mots","titre='default' and sm.type='marker_icon'");
+ if ($id_mot != '') {
+ if (file_exists(_DIR_IMG."/moton$id_mot.png")) {
+ $gicon = "moton$id_mot.png";
+ } else if (file_exists(_DIR_IMG."/moton$id_mot.gif")) {
+ $gicon = "moton$id_mot.gif";
+ }
+ }
+ }
+
+ // si pas d'icone, on laisse google la gŽrer
+ }
+
    if ($api_carte) {
      $gis_append_view_map = charger_fonction($api_carte.'_append_view_map','inc');
      $mapa = '<div id="viewMap" style="width: 477px; height: 100px; border:1px solid #000"></div>';
@@ -68,11 +132,11 @@
  
  // On teste la version de SPIP utilisee 2 ou 1.9
  if(function_exists('bouton_block_depliable')){
- $s .= debut_cadre('e', _DIR_PLUGIN_GIS."img_pack/correxir.png",'',bouton_block_depliable('&nbsp;&nbsp;&nbsp;<span style="text-transform: uppercase;">'._T('gis:cambiar').'</span>', false, "cadroFormulario"));
+ $s .= debut_cadre('e', _DIR_PLUGIN_GIS."img_pack/correxir.png",'',bouton_block_depliable('&nbsp;&nbsp;&nbsp;<span>'._T('gis:cambiar').'</span>', false, "cadroFormulario"));
  }else{
    $s .= debut_cadre('r', _DIR_PLUGIN_GIS."img_pack/correxir.png");
    $s .= bouton_block_invisible("ajouter_form");
- $s .= '&nbsp;&nbsp;&nbsp;<strong class="verdana3" style="text-transform: uppercase;">' . _T('gis:cambiar') . ' <a onclick="$(\'#cadroFormulario\').slideToggle(\'slow\')">(' . _T('gis:clic_desplegar') . ')</a></strong>';
+ $s .= '&nbsp;&nbsp;&nbsp;<strong class="verdana3">' . _T('gis:cambiar') . ' <a onclick="$(\'#cadroFormulario\').slideToggle(\'slow\')">(' . _T('gis:clic_desplegar') . ')</a></strong>';
  }
  
  $s .= debut_block_visible("ajouter_form");
@@ -136,7 +200,7 @@
  
  $s .= debut_cadre('r', _DIR_PLUGIN_GIS."img_pack/correxir.png");
  $s .= bouton_block_invisible("ajouter_form");
- $s .= '&nbsp;&nbsp;&nbsp;<strong class="verdana3" style="text-transform: uppercase;">'. _T("gis:cambiar") .' '. $id_mot .' <a onclick="$(\'#cadroFormulario\').slideToggle(\'slow\')">('. _T('gis:clic_desplegar') .')</a></strong>';
+ $s .= '&nbsp;&nbsp;&nbsp;<strong class="verdana3">'. _T("gis:cambiar") .' '. $id_mot .' <a onclick="$(\'#cadroFormulario\').slideToggle(\'slow\')">('. _T('gis:clic_desplegar') .')</a></strong>';
  $s .= debut_block_visible("ajouter_form");
  $s .= '<div class="verdana2">'. _T("gis:clic_mapa") .'</div>';
  $s .= debut_block_visible("ajouter_form");

_______________________________________________
Spip-zone-commit@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-zone-commit

En lisant

sur une recherche dans le trac, je m'aperçois que webmaster@... est tout aussi peu identifiant :frowning: ...
Difficile de savoir qui a commit quoi du coup .

Cédric

Le 12 mai 09 à 15:12, cedric.morin@yterium.com a écrit :

Bonjour,

en lisant
Connexion · GitLab

je me suis rendu compte que ton email 'impersonnel' était peu pratique pour savoir qui avait commit puisque trac n'affiche plus maintenant que
'listes@…'
Ce serait cool si tu pouvais proposer un email plus signifiant et plus identifiant pour tes commits (je parle surtout de la partie avant le @)

Merci
Cédric

Le 12 mai 09 à 13:52, listes@nouveauxterritoires.fr a écrit :

Author: listes@nouveauxterritoires.fr
Date: Tue May 12 13:52:20 2009
New Revision: 28606

Log:
meilleure gestion des puces pour les cartes GoogleMaps

Modified:
  _plugins_/_dev_/gis/inc/parte_privada.php

Modified: _plugins_/_dev_/gis/inc/parte_privada.php

--- _plugins_/_dev_/gis/inc/parte_privada.php (original)
+++ _plugins_/_dev_/gis/inc/parte_privada.php Tue May 12 13:52:20 2009
@@ -14,6 +14,7 @@
function gis_cambiar_coord($id,$table,$exec) {
  global $spip_lang_left, $spip_lang_right;
  
+
  $pkey = id_table_objet($table);
  
  $glat = NULL;
@@ -41,17 +42,80 @@
    sql_delete("spip_gis", array("$pkey = " . sql_quote($id)));
  }
  if ($glat!==NULL){
- $resultMots = spip_query("SELECT * FROM spip_mots_{$table}s WHERE $pkey = ".intval($id));
- while ($rowMot = spip_fetch_array($resultMots)) {
- $resultMotIcon = spip_query("SELECT * FROM spip_mots WHERE type ='marker_icon' AND id_mot=".$rowMot['id_mot']);
- if ($rowMotIcon = spip_fetch_array($resultMotIcon)){
- if (file_exists("../IMG/"."moton".$rowMot['id_mot'].".png")) {
- $gicon = "moton".$rowMot['id_mot'].".png";
- } else if (file_exists("../IMG/"."moton".$rowMot['id_mot'].".gif")) {
- $gicon = "moton".$rowMot['id_mot'].".gif";
+ // on cherche un mot clŽ pour cet(te) article/rubrique
+ $nbMots = sql_countsel("spip_mots_{$table}s smt, spip_mots sm","smt.$pkey=".intval($id)." and smt.id_mot=sm.id_mot and sm.type='marker_icon'");
+ //echo "nbMots : ", $nbMots,"<br>";
+ if ($nbMots > 0) {
+ // il existe un mot-clŽ pour cet(te) article/rubrique du groupe de mots 'marker_icon'
+ // on recherche son identifiant
+ $id_mot = sql_getfetsel("smt.id_mot","spip_mots_{$table}s smt, spip_mots sm","smt.$pkey=".intval($id)." and smt.id_mot=sm.id_mot and sm.type='marker_icon'");
+ if ($id_mot != '') {
+ if (file_exists(_DIR_IMG."/moton$id_mot.png")) {
+ $gicon = "moton$id_mot.png";
+ } else if (file_exists(_DIR_IMG."/moton$id_mot.gif")) {
+ $gicon = "moton$id_mot.gif";
+ }
+ }
+ } else {
+ // l'article/ rubrique n'a pas de puce associŽ --> on cherche dans sa hiŽrarchie
+ $nomTable = table_objet($table);
+ $parents = array();
+ $id_parent = 0;
+ if ($nomTable == 'articles') {
+ // table articles
+ $id_parent = sql_getfetsel("id_rubrique","spip_articles","id_article=".intval($id));
+ $parents = $id_parent;
+ } else if ($nomTable == 'rubriques') {
+ // table rubriques
+ $id_parent = sql_getfetsel("id_parent","spip_rubriques","id_rubrique=".intval($id));
+ $parents = $id_parent;
+ }
+
+ // ensuite on cherche toutes les rubriques parent de cet objet
+ while ($id_parent != 0) {
+ $id_parent = sql_getfetsel("id_parent","spip_rubriques","id_rubrique=".intval($id_parent));
+ if ($id_parent != 0) {
+ $parents = $id_parent;
+ }
+ }
+
+ if (count($parents) > 0) {
+ // on a donc des rubriques parents, on en cherche une qui a un mot clŽ de type 'marker_icon'
+ foreach ($parents as $id_parent) {
+ $nbMots = sql_countsel("spip_mots_rubriques smr, spip_mots sm","smr.id_rubrique=".intval($id_parent)." and smr.id_mot=sm.id_mot and sm.type='marker_icon'");
+ if ($nbMots > 0) {
+ // il existe un mot-clŽ pour cette rubrique du groupe de mots 'marker_icon'
+ // on recherche son identifiant
+ $id_mot = sql_getfetsel("smr.id_mot","spip_mots_rubriques smr, spip_mots sm","smr.id_rubrique=".intval($id_parent)." and smr.id_mot=sm.id_mot and sm.type='marker_icon'");
+ if ($id_mot != '') {
+ if (file_exists(_DIR_IMG."/moton$id_mot.png")) {
+ $gicon = "moton$id_mot.png";
+ break;
+ } else if (file_exists(_DIR_IMG."/moton$id_mot.gif")) {
+ $gicon = "moton$id_mot.gif";
+ break;
        }
      }
    }
+ }
+ }
+
+ if ($gicon == '') {
+ // pas d'icone trouvŽ
+ // on recherche le mot clŽ 'default' de type 'marker_icon'
+ $id_mot = sql_getfetsel("id_mot","spip_mots","titre='default' and sm.type='marker_icon'");
+ if ($id_mot != '') {
+ if (file_exists(_DIR_IMG."/moton$id_mot.png")) {
+ $gicon = "moton$id_mot.png";
+ } else if (file_exists(_DIR_IMG."/moton$id_mot.gif")) {
+ $gicon = "moton$id_mot.gif";
+ }
+ }
+ }
+
+ // si pas d'icone, on laisse google la gŽrer
+ }
+
    if ($api_carte) {
      $gis_append_view_map = charger_fonction($api_carte.'_append_view_map','inc');
      $mapa = '<div id="viewMap" style="width: 477px; height: 100px; border:1px solid #000"></div>';
@@ -68,11 +132,11 @@
  
  // On teste la version de SPIP utilisee 2 ou 1.9
  if(function_exists('bouton_block_depliable')){
- $s .= debut_cadre('e', _DIR_PLUGIN_GIS."img_pack/correxir.png",'',bouton_block_depliable('&nbsp;&nbsp;&nbsp;<span style="text-transform: uppercase;">'._T('gis:cambiar').'</span>', false, "cadroFormulario"));
+ $s .= debut_cadre('e', _DIR_PLUGIN_GIS."img_pack/correxir.png",'',bouton_block_depliable('&nbsp;&nbsp;&nbsp;<span>'._T('gis:cambiar').'</span>', false, "cadroFormulario"));
  }else{
    $s .= debut_cadre('r', _DIR_PLUGIN_GIS."img_pack/correxir.png");
    $s .= bouton_block_invisible("ajouter_form");
- $s .= '&nbsp;&nbsp;&nbsp;<strong class="verdana3" style="text-transform: uppercase;">' . _T('gis:cambiar') . ' <a onclick="$(\'#cadroFormulario\').slideToggle(\'slow\')">(' . _T('gis:clic_desplegar') . ')</a></strong>';
+ $s .= '&nbsp;&nbsp;&nbsp;<strong class="verdana3">' . _T('gis:cambiar') . ' <a onclick="$(\'#cadroFormulario\').slideToggle(\'slow\')">(' . _T('gis:clic_desplegar') . ')</a></strong>';
  }
  
  $s .= debut_block_visible("ajouter_form");
@@ -136,7 +200,7 @@
  
  $s .= debut_cadre('r', _DIR_PLUGIN_GIS."img_pack/correxir.png");
  $s .= bouton_block_invisible("ajouter_form");
- $s .= '&nbsp;&nbsp;&nbsp;<strong class="verdana3" style="text-transform: uppercase;">'. _T("gis:cambiar") .' '. $id_mot .' <a onclick="$(\'#cadroFormulario\').slideToggle(\'slow\')">('. _T('gis:clic_desplegar') .')</a></strong>';
+ $s .= '&nbsp;&nbsp;&nbsp;<strong class="verdana3">'. _T("gis:cambiar") .' '. $id_mot .' <a onclick="$(\'#cadroFormulario\').slideToggle(\'slow\')">('. _T('gis:clic_desplegar') .')</a></strong>';
  $s .= debut_block_visible("ajouter_form");
  $s .= '<div class="verdana2">'. _T("gis:clic_mapa") .'</div>';
  $s .= debut_block_visible("ajouter_form");

_______________________________________________
Spip-zone-commit@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-zone-commit

_______________________________________________
Spip-zone-commit@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-zone-commit

je me suis rendu compte que ton email 'impersonnel' était peu pratique
pour savoir qui avait commit puisque trac n'affiche plus maintenant que
'listes@…'
Ce serait cool si tu pouvais proposer un email plus signifiant et plus
identifiant pour tes commits (je parle surtout de la partie avant le @)

sur une recherche dans le trac, je m'aperçois que webmaster@... est tout
aussi peu identifiant :frowning: ...
Difficile de savoir qui a commit quoi du coup .

N'hésitez pas à utiliser spip.org (http://spip.org) pour créer un
alias email sympa

-- Fil