Changeset 95813 in spip-zone
- Timestamp:
- Mar 6, 2016, 9:09:56 PM (5 years ago)
- Location:
- _plugins_/itineraires/trunk
- Files:
-
- 33 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/itineraires/trunk/base/itineraires.php
r79284 r95813 24 24 function itineraires_declarer_tables_interfaces($interfaces) { 25 25 $interfaces['table_des_tables']['itineraires'] = 'itineraires'; 26 $interfaces['table_des_tables']['itineraires_etapes'] = 'itineraires_etapes'; 26 27 $interfaces['table_des_tables']['itineraires_locomotions'] = 'itineraires_locomotions'; 27 28 $interfaces['table_des_traitements']['LONGUEUR']['itineraires'] = 'floatval(%s)'; … … 87 88 'texte_changer_statut' => 'itineraire:texte_changer_statut_itineraire', 88 89 ); 90 91 $tables['spip_itineraires_etapes'] = array( 92 'type' => 'itineraires_etape', 93 'principale' => "oui", 94 'field'=> array( 95 'id_itineraires_etape' => 'bigint(21) NOT NULL', 96 'id_itineraire' => 'bigint(21) NOT NULL default 0', 97 'titre' => 'text NOT NULL DEFAULT ""', 98 'texte' => 'text NOT NULL DEFAULT ""', 99 'rang' => 'int not null default 0', 100 'maj' => 'TIMESTAMP', 101 ), 102 'key' => array( 103 'PRIMARY KEY' => 'id_itineraires_etape', 104 ), 105 'titre' => "titre AS titre, '' AS lang", 106 'champs_editables' => array('id_itineraire', 'rang', 'titre', 'texte',), 107 'champs_versionnes' => array('titre', 'texte',), 108 'rechercher_champs' => array('titre' => 8, 'texte' => 5), 109 'tables_jointures' => array(), 110 ); 89 111 90 112 return $tables; … … 102 124 */ 103 125 function itineraires_declarer_tables_auxiliaires($tables_auxiliaires){ 104 //-- Table organisations_contacts ------------------------------------- 105 $itineraires_locomotions = array( 106 "id_itineraire" => "bigint(21) not null", 107 "type_locomotion" => "varchar(25) not null default ''", 108 "duree" => "int(11) not null default 0", 126 // Choix des infos de locomotions pour un itinéraire 127 $tables_auxiliaires['spip_itineraires_locomotions'] = array( 128 'field' => array( 129 "id_itineraire" => "bigint(21) not null", 130 "type_locomotion" => "varchar(25) not null default ''", 131 "duree" => "int(11) not null default 0", 132 ), 133 'key' => array( 134 "PRIMARY KEY" => "id_itineraire, type_locomotion", 135 "KEY id_itineraire" => "id_itineraire", 136 "KEY type_locomotion" => "type_locomotion" 137 ), 109 138 ); 110 $itineraires_locomotions_key = array( 111 "PRIMARY KEY" => "id_itineraire, type_locomotion", 112 "KEY id_itineraire" => "id_itineraire", 113 "KEY type_locomotion" => "type_locomotion" 114 ); 115 $tables_auxiliaires['spip_itineraires_locomotions'] = 116 array('field' => &$itineraires_locomotions, 'key' => &$itineraires_locomotions_key); 139 140 /* On verra ça plus tard 141 // Liaison entre les étapes et des contenus 142 $tables['spip_itineraires_etapes_liens'] = array( 143 'field' => array( 144 'id_itineraires_etape' => 'bigint(21) DEFAULT "0" NOT NULL', 145 'id_objet' => 'bigint(21) DEFAULT "0" NOT NULL', 146 'objet' => 'VARCHAR(25) DEFAULT "" NOT NULL', 147 'vu' => 'VARCHAR(6) DEFAULT "non" NOT NULL', 148 ), 149 'key' => array( 150 'PRIMARY KEY' => 'id_itineraires_etape,id_objet,objet', 151 'KEY id_itineraires_etape' => 'id_itineraires_etape', 152 ) 153 );*/ 117 154 118 155 return $tables_auxiliaires; 119 156 } 120 121 ?> -
_plugins_/itineraires/trunk/formulaires/editer_itineraire.php
r76805 r95813 340 340 return $retours; 341 341 } 342 343 344 ?> -
_plugins_/itineraires/trunk/itineraires_administrations.php
r76805 r95813 25 25 $maj = array(); 26 26 27 $maj['create'] = array(array('maj_tables', array('spip_itineraires', 'spip_itineraires_locomotions'))); 27 $maj['create'] = array( 28 array('maj_tables', array('spip_itineraires', 'spip_itineraires_locomotions')), 29 ); 30 31 // Ajouter les étapes 32 $maj['1.1.0'] = array( 33 array('maj_tables', array('spip_itineraires_etapes')), 34 ); 28 35 29 36 include_spip('base/upgrade'); … … 40 47 **/ 41 48 function itineraires_vider_tables($nom_meta_base_version) { 42 43 49 sql_drop_table("spip_itineraires"); 44 50 sql_drop_table("spip_itineraires_locomotions"); 51 sql_drop_table("spip_itineraires_etapes"); 45 52 46 53 # Nettoyer les versionnages et forums … … 51 58 effacer_meta($nom_meta_base_version); 52 59 } 53 54 ?> -
_plugins_/itineraires/trunk/itineraires_autorisations.php
r76719 r95813 125 125 126 126 127 128 129 ?> 127 // ----------------- 128 // Objet itineraires_etapes 129 130 131 /** 132 * Autorisation de créer une étape dans un itinéraire : pouvoir modifier l'itinéraire 133 * 134 * @param string $faire Action demandée 135 * @param string $type Type d'objet sur lequel appliquer l'action 136 * @param int $id Identifiant de l'objet 137 * @param array $qui Description de l'auteur demandant l'autorisation 138 * @param array $opt Options de cette autorisation 139 * @return bool true s'il a le droit, false sinon 140 **/ 141 function autoriser_itineraire_creeretapedans_dist($faire, $type, $id, $qui, $opt) { 142 return autoriser('modifier', 'itineraire', $id, $qui, $opt); 143 } 144 145 /** 146 * Autorisation de créer une étape : il faut avoir un contexte d'itinéraire 147 * 148 * @param string $faire Action demandée 149 * @param string $type Type d'objet sur lequel appliquer l'action 150 * @param int $id Identifiant de l'objet 151 * @param array $qui Description de l'auteur demandant l'autorisation 152 * @param array $opt Options de cette autorisation 153 * @return bool true s'il a le droit, false sinon 154 **/ 155 function autoriser_itinerairesetape_creer_dist($faire, $type, $id, $qui, $opt) { 156 if (isset($opt['id_itineraire']) and $id_itineraire =intval($opt['id_itineraire'])) { 157 return autoriser('creeretapedans', 'itineraire', $id_itineraire, $qui, $opt); 158 } 159 else { 160 return false; 161 } 162 } 163 164 /** 165 * Autorisation de voir (itinerairesetape) 166 * 167 * @param string $faire Action demandée 168 * @param string $type Type d'objet sur lequel appliquer l'action 169 * @param int $id Identifiant de l'objet 170 * @param array $qui Description de l'auteur demandant l'autorisation 171 * @param array $opt Options de cette autorisation 172 * @return bool true s'il a le droit, false sinon 173 **/ 174 function autoriser_itinerairesetape_voir_dist($faire, $type, $id, $qui, $opt) { 175 return true; 176 } 177 178 /** 179 * Autorisation de modifier une étape : pouvoir modifier l'itinéraire parent 180 * 181 * @param string $faire Action demandée 182 * @param string $type Type d'objet sur lequel appliquer l'action 183 * @param int $id Identifiant de l'objet 184 * @param array $qui Description de l'auteur demandant l'autorisation 185 * @param array $opt Options de cette autorisation 186 * @return bool true s'il a le droit, false sinon 187 **/ 188 function autoriser_itinerairesetape_modifier_dist($faire, $type, $id, $qui, $opt) { 189 if (isset($opt['id_itineraire'])) { 190 $id_itineraire = $opt['id_itineraire']; 191 } 192 else { 193 $id_itineraire = sql_getfetsel( 194 'id_itineraire', 195 'spip_itineraires_etapes', 196 'id_itineraires_etape = '.intval($id) 197 ); 198 } 199 200 return autoriser('modifier', 'itineraire', $id_itineraire, $qui, $opt); 201 } 202 203 /** 204 * Autorisation de supprimer (itinerairesetape) 205 * 206 * @param string $faire Action demandée 207 * @param string $type Type d'objet sur lequel appliquer l'action 208 * @param int $id Identifiant de l'objet 209 * @param array $qui Description de l'auteur demandant l'autorisation 210 * @param array $opt Options de cette autorisation 211 * @return bool true s'il a le droit, false sinon 212 **/ 213 function autoriser_itinerairesetape_supprimer_dist($faire, $type, $id, $qui, $opt) { 214 return $qui['statut'] == '0minirezo' AND !$qui['restreint']; 215 } -
_plugins_/itineraires/trunk/lang/itineraire_fr.php
r95641 r95813 69 69 'titre_logo_itineraire' => 'Logo de cet itinéraire', 70 70 ); 71 72 ?> -
_plugins_/itineraires/trunk/lang/paquet-itineraires_fr.php
r76719 r95813 2 2 // This is a SPIP language file -- Ceci est un fichier langue de SPIP 3 3 4 if (!defined('_ECRIRE_INC_VERSION')) return; 4 if (!defined('_ECRIRE_INC_VERSION')) { 5 return; 6 } 5 7 6 8 $GLOBALS[$GLOBALS['idx_lang']] = array( 7 8 9 // I 9 10 'itineraires_description' => 'Ce plugin ajoute un nouvel objet éditorial permettant de décrire un itinéraire (distance, difficulté, etc).', … … 11 12 'itineraires_slogan' => 'Lister des itinéraires de randonnées, vélo, cheval…', 12 13 ); 13 14 ?> -
_plugins_/itineraires/trunk/paquet.xml
r95641 r95813 2 2 prefix="itineraires" 3 3 categorie="divers" 4 version="1. 0.4"4 version="1.1.0" 5 5 etat="test" 6 6 compatibilite="[3.0.0;3.1.*]" 7 7 logo="prive/themes/spip/images/itineraires-64.png" 8 8 documentation="" 9 schema="1. 0.0"9 schema="1.1.0" 10 10 > 11 <!--12 Paquet genere le 2013-09-27 16:12:3613 -->14 15 11 <nom>Itinéraires</nom> 16 12 … … 21 17 <necessite nom="verifier" compatibilite="[1.0.3;]" /> 22 18 <necessite nom="yaml" compatibilite="[1.5.1;]" /> 19 <utilise nom="gis" compatibilite="[4.32.5;]" /> 23 20 24 21 <pipeline nom="autoriser" inclure="itineraires_autorisations.php" /> -
_plugins_/itineraires/trunk/prive/objets/liste/itineraires.html
r77953 r95813 7 7 #ANCRE_PAGINATION 8 8 <div class="liste-objets itineraires"> 9 <table class= 'spip liste'>9 <table class="spip liste"> 10 10 [<caption><strong class="caption">(#ENV*{titre,#GRAND_TOTAL|singulier_ou_pluriel{itineraire:info_1_itineraire,itineraire:info_nb_itineraires}})</strong></caption>] 11 11 <thead> 12 <tr class= 'first_row'>13 <th class= 'statut' scope='col'>[(#TRI{statut,<span title="<:lien_trier_statut|attribut_html:>">#</span>,ajax})]</th>14 <th class= 'titre' scope='col'>[(#TRI{titre,<:itineraire:champ_titre_label:>,ajax})]</th>15 <th class= 'date' scope='col'>[(#TRI{date,<:date:>,ajax})]</th>16 <th class= 'id' scope='col'>[(#TRI{id_itineraire,<:info_numero_abbreviation:>,ajax})]</th>12 <tr class="first_row"> 13 <th class="statut" scope="col">[(#TRI{statut,<span title="<:lien_trier_statut|attribut_html:>">#</span>,ajax})]</th> 14 <th class="titre" scope="col">[(#TRI{titre,<:itineraire:champ_titre_label:>,ajax})]</th> 15 <th class="date" scope="col">[(#TRI{date,<:date:>,ajax})]</th> 16 <th class="id" scope="col">[(#TRI{id_itineraire,<:info_numero_abbreviation:>,ajax})]</th> 17 17 </tr> 18 18 </thead> 19 19 <tbody> 20 20 <BOUCLE_liste_itineraires(ITINERAIRES){id_mot?}{id_auteur?}{where?}{statut?}{recherche?}{tri #ENV{par,num titre},#GET{defaut_tri}}{par titre}{pagination #ENV{nb,10}}> 21 <tr class= '[(#COMPTEUR_BOUCLE|alterner{row_odd,row_even})]'>22 <td class= 'statut'>[(#STATUT|puce_statut{itineraire,#ID_ITINERAIRE})]</td>23 <td class= 'titre principale'>[(#LOGO_ITINERAIRE|image_reduire{20,26})]<a href="[(#ID_ITINERAIRE|generer_url_entite{itineraire})]" title="<:info_numero_abbreviation|attribut_html:> #ID_ITINERAIRE">[(#RANG). ]#TITRE</a></td>24 <td class= 'date secondaire'>[(#DATE|affdate_jourcourt)]</td>25 <td class= 'id'>[(#AUTORISER{modifier,itineraire,#ID_ITINERAIRE}|?{21 <tr class="[(#COMPTEUR_BOUCLE|alterner{row_odd,row_even})]"> 22 <td class="statut">[(#STATUT|puce_statut{itineraire,#ID_ITINERAIRE})]</td> 23 <td class="titre principale">[(#LOGO_ITINERAIRE|image_reduire{20,26})]<a href="[(#ID_ITINERAIRE|generer_url_entite{itineraire})]" title="<:info_numero_abbreviation|attribut_html:> #ID_ITINERAIRE">[(#RANG). ]#TITRE</a></td> 24 <td class="date secondaire">[(#DATE|affdate_jourcourt)]</td> 25 <td class="id">[(#AUTORISER{modifier,itineraire,#ID_ITINERAIRE}|?{ 26 26 <a href="[(#URL_ECRIRE{itineraire_edit,id_itineraire=#ID_ITINERAIRE})]">#ID_ITINERAIRE</a>, 27 27 #ID_ITINERAIRE … … 31 31 </tbody> 32 32 </table> 33 [<p class= 'pagination'>(#PAGINATION{prive})</p>]33 [<p class="pagination">(#PAGINATION{prive})</p>] 34 34 </div> 35 35 </B_liste_itineraires>[ -
_plugins_/itineraires/trunk/prive/squelettes/contenu/itineraire.html
r76719 r95813 39 39 40 40 #BOITE_FERMER 41 42 43 #SET{enfants,''} 44 [(#VAL{prive/objets/contenu/itineraire-enfants}|trouver_fond|oui) 45 [(#SET{enfants,[(#INCLURE{fond=prive/objets/contenu/itineraire-enfants,id_itineraire,env})]})] 46 ] 47 [(#PIPELINE{affiche_enfants,[(#ARRAY{args,#ARRAY{exec,itineraire,id_itineraire,#ID_ITINERAIRE,objet,itineraire,id_objet,#ID_ITINERAIRE},data,#GET{enfants}})]})] 48 49 41 50 [(#EVAL{_AJAX}|oui) 42 51 <script type="text/javascript">/*<!\\[CDATA\\[*/reloadExecPage('#ENV{exec}','#navigation,#chemin');/*\\]\\]>*/</script>
Note: See TracChangeset
for help on using the changeset viewer.