devLog.org 38.6 KB
Newer Older
thomas craipeau's avatar
thomas craipeau committed
1 2


Clément Damiens's avatar
 
Clément Damiens committed
3 4 5 6 7 8 9 10 11
////////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Permanent bash MEP /////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
** Bash sur la mise à jour des jsons costums sur la db
co2/datamigration/ModifyCostumDB
////////////////////////////////////////////////////////////////////////////////////
/////////////////////////// End permanent bash /////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////

thomas craipeau's avatar
thomas craipeau committed
12 13 14 15 16 17
///////////////// BASH VERSION 0.994 - 31/01/2020 //////////////////////////////////
** BASH copie des tags présent dans list dans la collections tags
co2/datamigration/BashforeachActiveTags

///////////////////////// END BASH ////////////////////////////////////////////////

Tibor Katelbach's avatar
tweaks  
Tibor Katelbach committed
18 19 20 21 22 23 24 25


///////////////// BASH VERSION 0.994 - 21/04/2020 //////////////////////////////////
db.getCollection('answers').update({parentSlug:"sommom"},{ $set: {form:"5e9962ef539f225f158b4577"}},{multi:true})
///////////////////////// END BASH ////////////////////////////////////////////////



Clément Damiens's avatar
 
Clément Damiens committed
26 27 28
///////////////// BASH VERSION 0.993 - 18/12/2019 //////////////////////////////////
** BASH sur les groupes du pactes supression des doublons
=> co2/datamigration/RemoveGroupDoublon
Raph El's avatar
Hotfix  
Raph El committed
29

Clément Damiens's avatar
 
Clément Damiens committed
30
///////////////////////// END BASH ////////////////////////////////////////////////
Raph El's avatar
Hotfix  
Raph El committed
31 32 33 34
*** Pour ajouté le parsercsv php 
`composer require parsecsv/php-parsecsv`


Raph El's avatar
Raph El committed
35 36
*** CTENAT 
co2/datamigration/UpdateAnswersIndicateurs
Raph El's avatar
Hotfix  
Raph El committed
37
co2/datamigration/FinancterLabel
Raph El's avatar
Raph El committed
38
co2/datamigration/Financter
Raph El's avatar
Raph El committed
39
co2/datamigration/UpdateAnswersActionCandidateMissing
Raph El's avatar
Raph El committed
40

Clément Damiens's avatar
 
Clément Damiens committed
41 42
/////////////////////////// BASH VERSION 0.99 /////////////////////////////////////

43 44 45 46 47 48 49 50
// This file helps any devlopper to update his environment in order to make it work
// according to the new development
// Add a datetime or better a commit id linked to the modification
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
Clément Damiens's avatar
Clément Damiens committed
51 52 53
*** Bash pour supprimer des liens frauduleux entre deux cteR (datant de la v1)
co2/datamigration/RemoveLinkCterWithCter

Tibor Katelbach's avatar
Tibor Katelbach committed
54 55
*** Bash sur les orgas ctenat pour forcer l'openEdition à false
co2/datamigration/UpdateOrgaOpenEditionCteNat
Tibor Katelbach's avatar
Tibor Katelbach committed
56
db.getCollection('organizations').update({"source.key":"ctenat","preferences.isOpenEdition":"true"},{$set:{"preferences.isOpenEdition":false}}, {multi:true})
57
----------------------------------------------------
Tibor Katelbach's avatar
Tibor Katelbach committed
58 59
co2/datamigration/HotfixLinkCteR
co2/datamigration/HotfixImportAction
60
----------------------------------------------------
Raph El's avatar
Raph El committed
61 62
*** update cibleDD answers ctenat
co2/datamigration/CibleDDAnswers
Clément Damiens's avatar
 
Clément Damiens committed
63 64
*** Bash sur les projets ctenat pour forcer l'openEdition à false
co2/datamigration/UpdateProjectOpenEditionCteNat
Clément Damiens's avatar
 
Clément Damiens committed
65 66
** Bash sur projets territoire du cteNat => Ajout de la category cteR
co2/datamigration/UpdateCategoryOnTerritoryCteNat
Raph El's avatar
Raph El committed
67 68
** Bash sur projets territoire du cteNat => Ajout de la Status
co2/datamigration/StatutCtenat
69 70
** Bash sur categorie badge ++ ajout des tags inexistant
co2/datamigration/UpdateBadgesCteNat
Tibor Katelbach's avatar
twix  
Tibor Katelbach committed
71 72 73

* mettre des slugs sur les elements qui ont le meme slug
db.costum.find().forEach( function(doc){
Raph El's avatar
Raph El committed
74
    if(doc.slug != undefined){
Tibor Katelbach's avatar
twix  
Tibor Katelbach committed
75 76
        print("costum : "+doc.slug);
        db.slugs.find({"name":doc.slug}).forEach(function(el){
Raph El's avatar
Modif  
Raph El committed
77 78 79
            print("el : "+el.type+" : "+el.id);
            db[el.type].update( {"slug":doc.slug}, {'$set':{'costum':{"slug":doc.slug}}} );
        });
Tibor Katelbach's avatar
twix  
Tibor Katelbach committed
80 81
    }
});
Clément Damiens's avatar
 
Clément Damiens committed
82 83
** Bash pacte => update and remove groupe
co2/datamigration/UpdateGroupAndDeleteDouble
84
----------------------------------------------------
Tibor Katelbach's avatar
Tibor Katelbach committed
85
http://127.0.0.1/ph/co2/default/sitemap/host/coco.fr/sourceKey/ctenat
86
----------------------------------------------------
Tibor Katelbach's avatar
Tibor Katelbach committed
87 88
* rajouter les update elemnt sur les slugs (SEO)
http://127.0.0.1/ph/co2/test/updateslugs
89
----------------------------------------------------
Raph El's avatar
Raph El committed
90
* Importer les zones epci
Clément Damiens's avatar
 
Clément Damiens committed
91
mongoimport --db pixelhumain --collection zones --file zones-epci.json
Tibor Katelbach's avatar
Tibor Katelbach committed
92
mongoimport --db pixelhumain --collection translate --file translate-epci.json
Raph El's avatar
Raph El committed
93 94 95

* remplacer le champs contact par contacts
co2/datamigration/ContactToContacts
Clément Damiens's avatar
 
Clément Damiens committed
96
---------------------------------------
Clément Damiens's avatar
 
Clément Damiens committed
97
---------- VERSION C0.41(Fluidity - CUSTOMIZED) --------------
Clément Damiens's avatar
 
Clément Damiens committed
98 99 100
---------------------------------------
* Batch pour ajouter supprimer les parentId and organizerId et créer les object parent et organizer 
co2/datamigration/ParentObjectInsteadOfString
Raph El's avatar
Hotfix  
Raph El committed
101

Clément Damiens's avatar
 
Clément Damiens committed
102 103 104 105 106 107
* COSTUME A METTRE A JOUR
** Insert the custom in db.collection "costum" : find json in onepage module folder /data 
  ** Leport.json => is now based on project. So you need to create a project with logo and don't forget shortdescription and tags  which will fulfil meta-data
  ** csc.json => just put json in costum db 
  ** Don't forget for every costum that you need to create an entry in each element "custom":"{id}"

Raph El's avatar
Raph El committed
108 109 110 111 112 113 114
---------------------------------------
---------- VERSION C0.4(Les amis d'abord) --------------
---------------------------------------
* Batch pour ajouter le type au links 
co2/datamigration/SearchLinkMissingType


Raph El's avatar
Hotfix  
Raph El committed
115 116 117 118 119
---- CTE
* Unifier les answer 
  co2/datamigration/UnifierAnswers


Clément Damiens's avatar
 
Clément Damiens committed
120 121 122 123 124 125 126 127 128 129 130 131
---------------------------------------
---------- VERSION C0.31 (Les amis d'abord) --------------
---------------------------------------
* Bash de donnée création de folders et ordonnance des fichiers suivant dans les folders 
** Premier bash : "/co2/datamigration/InsertFoldersElement"
  *** S'appuie sur les éléments ayant organiser des fichiers ou des photos dans des dossiers (element.documentations) et crée les entrée folders en db
** Second bash : "/co2/datamigration/CreateFoldersPathAndDocumentPath"
  *** Crée et organise les dossiers dans ph/upload/communecter et déplace les fichiers dans les bons dossiers
** Troisième bash : "/co2/datamigration/UpdateDocsAndDeleteCollection"
  *** Indexe les id des folders dans les entrée document et clean l'ancienne data
** Quatrième Bash : "co2/datamigration/CreateThumbPath"
  *** Ajoute les folders thumb pour les images décalées dans leurs dossiers (si images)
Tibor Katelbach's avatar
Tibor Katelbach committed
132

Clément Damiens's avatar
 
Clément Damiens committed
133
* Bash sur les documents du CTE déjà uploadé
Raph El's avatar
Modif  
Raph El committed
134 135
** : "/co2/datamigration/ChangeFilesCTESurveyDatas"

Clément Damiens's avatar
 
Clément Damiens committed
136
  *** Supprime la data mauvaise et ajoute la clé du survey
137 138 139
---------------------------------------
---------- VERSION C0.30 (warrior flower) --------------
---------------------------------------
140 141 142 143 144 145

* Batch Hotfix
Supprimer le level3 si il n'y a pas de name 
/co2/datamigration/RemoveLevel3Mising 


146 147 148 149 150 151 152 153 154 155 156
* Refactor de classifieds 
Migration des ressources dans classified et refactor sur les "classified" qui deviennent des "classifieds"
***** STEPS ********
1* Créer une collection "classifieds" qui est la copie de la collection "classified"
2* Générer un json de classified/ressources en classifieds unique et le remanier
 **2-1 - Lancer l'url "/co2/datamigration/UpdateClassifiedAndMergeRessources"
    ***Génere le json de classifieds
    ***Affecte les bons les types de classifieds (ressources/classifieds/jobs)
    ***Affecte les anciens "type" à l'entrée "category"
    ***Remplace le chemin des urls d'images par le chemin correspondant à la collection "classifieds" => "upload/communecter/classifieds/" 
  **2-2 - Extraire le json affichés et le mettre dans dans un fichier json 
Raph El's avatar
Modif  
Raph El committed
157
  **2-3 - Renommer les champs section : "category" en "subtype" avec les bonnes clés 
158 159 160 161 162 163 164 165 166
          - Type "classifieds" se référer à eco/assets/js/classifieds/categories.json
          - Type "ressources" se référer à eco/assets/js/ressources/categories.json
          - Type "jobs" se référer à eco/assets/js/jobs/categories.json
  **2-4 - Vider la collection classifieds en prod et import le nouveau json
  **2-5 - Lancer les bash de dates
    *** /co2/datamigration/UpdateDateInDB
    *** /co2/datamigration/UpdateLineInDB
3* Renomer et déplacer les images
  - Renommer le dossier "upload/communecter/classified/" en "upload/communecter/classifieds/"
Raph El's avatar
Modif  
Raph El committed
167 168 169 170
    cp -r upload/communecter/classified/ upload/communecter/classifieds/
  - Déplacer le contenu du dossier "upload/communecter/ressources/" dans "upload/communecter/classifieds/" 
    cd upload/communecter/ressources/
    mv * ../classifieds/
171 172 173
4* Bash des object type dans documents, comments, notifications et news
  =>lancer l'url "/co2/datamigration/UpdateTypeInCollectionsLinkToClassifieds"

174 175
* other batch 
/co2/datamigration/PendingMissing
Raph El's avatar
Modif  
Raph El committed
176

177

Clément Damiens's avatar
 
Clément Damiens committed
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
---------------------------------------
---------- VERSION C0.30 --------------
---------------------------------------
[ ] New architecture of search engine
  [X] Fisrt search - name or #tag
  [X] Second - geographical
  [X] Thirsd - themes
    [ ] Design for 2nd & 3rd filter
  [X] App all search
  [X] App search with page and counter
    [ ] Design of all entity
    [ ] Function of social connect
  [ ] Market app  
  [ ] Rebesco app
  [X] Live app
    [X] Search by tag and name
[ ] RebesCo
[X] Mergin all branches - Terla / Territorial / Lieux 2.0 / Dev / Master
[ ] Preferences

Clément Damiens's avatar
 
Clément Damiens committed
198
[ ] Check on prod Db if data users.preferences.publicFields is well an array for user and not an object 
Clément Damiens's avatar
 
Clément Damiens committed
199 200


Clément Damiens's avatar
 
Clément Damiens committed
201 202 203
---------------------------------------
----- BASH DE REPRISE DES DONNEES -----
---------------------------------------
204

Raph El's avatar
Raph El committed
205 206
* Version C0.23

Raph El's avatar
Raph El committed
207 208 209 210
Dans paramsconfig.php
remplacer "logoUrl2" => "/images/logoLTxt.jpg", => "logoUrl2" => "/images/headerPlaquette.png",


Raph El's avatar
Raph El committed
211 212 213
*** Corrige les geo des poi mal formaté
/co2/datamigration/PoiGeoFormat

Raph El's avatar
Raph El committed
214 215 216
*** Ajoute public a tout les events
co2/datamigration/PublicEvent

Raph El's avatar
Raph El committed
217 218 219
*** Ajout le nom des cp dans tranlates
co2/datamigration/UpdateTranslatewithNAmeCP

Raph El's avatar
Raph El committed
220 221 222 223 224
*** Ajout les nom des zones manquant
co2/datamigration/UpdateZoneMissingNameLevel1
co2/datamigration/UpdateZoneMissingNameLevel2
co2/datamigration/UpdateZoneMissingNameLevel3

Raph El's avatar
Raph El committed
225 226
*** Corrige le probleme de level avec Occitanie
co2/datamigration/BatchCorrectionLevel/id/597b1c4a6ff992f0038b45d4
Raph El's avatar
Raph El committed
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
co2/datamigration/BatchCorrectionLevel/id/597b1d566ff992f0038b4610
co2/datamigration/BatchCorrectionLevel/id/597b1be16ff992f0038b45b6
co2/datamigration/BatchCorrectionLevel/id/597b1bac6ff992f0038b45a8
co2/datamigration/BatchCorrectionLevel/id/597b1bb36ff992f0038b45a9
co2/datamigration/BatchCorrectionLevel/id/597b1c136ff992f0038b45c2
co2/datamigration/BatchCorrectionLevel/id/597b1c4e6ff992f0038b45d5
co2/datamigration/BatchCorrectionLevel/id/597b1cc26ff992f0038b45f2
co2/datamigration/BatchCorrectionLevel/id/597b1d106ff992f0038b4600
co2/datamigration/BatchCorrectionLevel/id/597b1d266ff992f0038b4604
co2/datamigration/BatchCorrectionLevel/id/597b1d326ff992f0038b4607
co2/datamigration/BatchCorrectionLevel/id/597b1d3f6ff992f0038b460a
co2/datamigration/BatchCorrectionLevel/id/597b1d456ff992f0038b460c

*** tranforme les scopes au nouveau format
co2/datamigration/UpdateMultiScope

*** tranforme les scopes des news au nouveau format
co2/datamigration/UpdateScopeNews

Raph El's avatar
Hotfix  
Raph El committed
246 247 248 249
*** Citoyen qui non pas de Code country dans leur addresse et sont toujours dans l'ancien format
co2/datamigration/BatchCountryMissing
*** Ajout de la variable language
co2/datamigration/BatchLanguage
Raph El's avatar
Raph El committed
250

Raph El's avatar
Raph El committed
251 252 253
*** Ajout de la variable type au orga qui n'en n'ont pas
co2/datamigration/OrganizationMissing

Raph El's avatar
Raph El committed
254

Raph El's avatar
Raph El committed
255

256 257 258 259 260 261 262 263 264
* Version C0.22

** @Rapha
*** Batch qui tranforme les adresses des elements dans le nouveau formats
co2/datamigration/BatchInterElement

*** Batch qui tranforme les adresses des news dans le nouveau formats
co2/datamigration/BatchInterNews

Tibor Katelbach's avatar
Tibor Katelbach committed
265 266
----------------------------------------------------

267 268
* Version C0.21.7

Clément Damiens's avatar
 
Clément Damiens committed
269
** @BOUBOULE
Clément Damiens's avatar
 
Clément Damiens committed
270
*** [!!!A passer le slugelement + SUPPRESSION DES CITOYENS SANS NOOOOM!!!] Bash de reprise sur les slugs citoyens et supprime les citoyens sans nom !!!!
Clément Damiens's avatar
 
Clément Damiens committed
271 272 273 274 275 276 277
** Crée les slugs à partir des usernames et si n'y a pas d'username (premiers utilisateurs) crée les usernames à la volée
co2/datamigration/slugifycitoyens

*** Bash de reprise sur les slugs organizations, projects, events
** Crée les slugs à partir des name + entrée dans les collections
co2/datamigration/slugifyelement

Clément Damiens's avatar
 
Clément Damiens committed
278 279
*** Bash de reprise du les notifications avec ajout du param updated dans toutes les notifs et suppression des notifs sans params $created
co2/datamigration/CreatorUpdatedOnNotifications
Clément Damiens's avatar
 
Clément Damiens committed
280

Clément Damiens's avatar
 
Clément Damiens committed
281 282
*** Bash sur les clés des event en francais: "concours"=>"contest" et "exposition"=>"exhibition"
co2/datamigration/ChangeEventFrenchType
Clément Damiens's avatar
Clément Damiens committed
283 284
*** Bash sur les type des poi: si type existe pas => "other", si type == poi => "other", si clé francaise => clé anglaise etc
co2/datamigration/ChangePoiType
Clément Damiens's avatar
 
Clément Damiens committed
285

Clément Damiens's avatar
Clément Damiens committed
286 287
*** A faire Bash de reprise des clés francaises POI (ex ressourceMaterielle to materialRessource) et CLASSIFIED
TODO @TIBOR @BOUBOULE
Clément Damiens's avatar
 
Clément Damiens committed
288

Clément Damiens's avatar
Clément Damiens committed
289 290
*** Bash on document used for profil and banner of element => Add boolean current : true
co2/dataMigration/AddCurrentToDoc
Clément Damiens's avatar
 
Clément Damiens committed
291

Clément Damiens's avatar
 
Clément Damiens committed
292 293 294 295
*** Script de relance des 2000 citoyens en attente d'inscription suite à invitation
** Enregistrement de cron avec le template relaunchInvitation
co2/dataMigration/relaunchinvitation 

Clément Damiens's avatar
 
Clément Damiens committed
296 297

* MISE EN PRODUCTION CO2 
Raphael's avatar
Raphael committed
298
** @Rapha
Raph El's avatar
Modif  
Raph El committed
299 300
*** Ajoute un zeo au cp
/co2/datamigration/AddZeroPostalCode
Raphael's avatar
Raphael committed
301 302
*** initialise les multiscopes
/co2/datamigration/InitMultiScope
303 304
*** ajout des geoShape au ville qui en ont pas
/co2/datamigration/AddGeoShapeMissing
Raphael's avatar
Raphael committed
305 306
*** change le type des telephones de object en array
/co2/datamigration/ChangePhoneObjectToArray
307 308
*** departement manquant
/co2/datamigration/ChangePhoneObjectToArray
Raphael's avatar
Raphael committed
309

Clément Damiens's avatar
 
Clément Damiens committed
310 311
** @Bouboule : 
**** Bash de reprise des data dans les chart des projets
Raph El's avatar
Modif  
Raph El committed
312
/co2/datamigration/RefactorChartProjectData
Clément Damiens's avatar
 
Clément Damiens committed
313 314
**** Bash de reprise des data dans notifications 
****** Create notify.id as object with isUnread and isUnseen
Raph El's avatar
Modif  
Raph El committed
315
/co2/datamigration/UpOldNotifications
Clément Damiens's avatar
 
Clément Damiens committed
316
**** Bash of object.type inbstead of object.objectType on news(!!!important with notification reactor!!!!)
Raph El's avatar
Modif  
Raph El committed
317
/co2/datamigration/ObjectObjectTypeNewsToObjectType
Clément Damiens's avatar
 
Clément Damiens committed
318 319
**** Bash of sharedBy on news (refactor share) - create an array sharedBy with the author and date
/co2/datamigration/SharedByRefactor
Clément Damiens's avatar
 
Clément Damiens committed
320 321
**** Bash delete organizations properties !!
co2/datamigration/RemovePropertiesOfOrganizations
Clément Damiens's avatar
 
Clément Damiens committed
322 323 324
**** Params config => Mettre les deux variables à jour (celle ci sont bonnes pour la prod) => utliser dans l'accueil
    "openatlasId" => "555eba56c655675cdd65bf19",
    "communecterId" => "55dafac4e41d75571d848360"
Clément Damiens's avatar
 
Clément Damiens committed
325 326 327 328 329
**** Supprimer les news avec un media string
db.getCollection('news').find({ "media" : {'$type': 2},"created":{'$lt':new Date('Jun 01, 2016')}}).count()
152 news avec un media de type string enregistrer entre janvier 2016 et mai 2016 (avant la mise en ligne de Juin)
qui font sauté les fils des pages !! 
**** Supprimer les news de type needs (après avoir lancer le bash ObjectObjectTypeNewsToObjectType) 
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362
db.getCollection('news').find("object.type":"needs") 

----------------------------------------------------
* Version 0.2

[ ] MEQA 
  [X] tagging : ph,ctk, communecter master actuel en v0.17 : v.0.17 PH-DORY 

          tag v0.0.17     co2         prod
                    |     |           |
  master ---------------------     ------------
                        /             \ 
                       /               \
  dev -----------------                 ---------
                                          \
                                           future devs 
                                           ---- internationalisation ----------------  
                                           tiers lieux ------------
                                           dda ---------------
MEQA
  [X] master en v.02 
  [X] paramsQA en v.02
  [X] copy BDD PROD to QA
    [X] dump PROD 
    [X] restore QA + drop
  [ ] transfert des images
  [X] update ph, ctk , co2  
  [X] script de devlog 

MEP 
  [X] update code
  [X] paramsconfigPROD en v.02
  [X] script de devlog 
Clément Damiens's avatar
 
Clément Damiens committed
363

364 365 366 367 368 369
----------------------------------------------------

* Version 0.17
** @Rapha : Ajout un attribu descriptionHtml = true
/communecter/datamigration/DescInHtml

Raphael's avatar
Raphael committed
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
* Hot fix 0.16.3
** @Rapha : Corrige les mauvais types des organisations
db.organizations.find({$and: [ { type :  { $ne: "NGO" } }, { type :  { $ne: "Group" } } , { type :  { $ne: "LocalBusiness" } }, { type :  { $ne: "GovernmentOrganization" } } ] }
).forEach(function(doc)
{
  if(typeof doc.type != "undefined"){
    if(doc.type == "Entreprise" )
      db.organizations.update({"_id":doc._id},{'$set':{'type': 'LocalBusiness'}});

    if(doc.type == "Association" )
      db.organizations.update({"_id":doc._id},{'$set':{'type': 'NGO'}});

    if(doc.type == "Groupe Gouvernemental" )
      db.organizations.update({"_id":doc._id},{'$set':{'type': 'GovernmentOrganization'}});

    if(doc.type == "Groupe" )
      db.organizations.update({"_id":doc._id},{'$set':{'type': 'Group'}});

    print( '"'+doc.name+'" => '+ doc.type ); 
  }else{
    db.organizations.update({"_id":doc._id},{'$set':{'type': 'Group'}});
    print( '"'+doc.name+'" => else' ); 
  }
});

395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522
* Hot Fix 0.16.1
** @Rapha : enleve l'encodage en html sur les noms des éléments
/communecter/datamigration/NameHtmlSpecialCharsDecode

** @Rapha : Ajoute les nom des dep et régions au addresse des elements
/communecter/datamigration/AddDepAndRegionAndCountryInAddress

** @Sylvain : ajout des paramètres rocketChat dans paramsconfig
//rocketchat params
'rocketchatEnabled' => false,
'rocketchatURL' => "http://chat.lescommuns.org",

* Hot Fix 0.16
** @Rapha : Fix Organisation avec country = Réunion
/communecter/datamigration/FixBugCoutryReunion

----------------------------------------------------
* Notragora
add params in protected/config/
-- paramsconfig.php => redirect/filter/logoUrl in $mailConfig 
                    => front in $params
----------------------------------------------------
* Version 0.16
** @Rapha : Suppression des links en doublons sur les orgas
/communecter/datamigration/DeleteLinksHimSelf

** @tango : Batch de reprise des geo.Point sur les elements
exécuter updateGeoPosElement.org sur la base
Exemple : 
mongo localhost:10019/bdname --username user --password pass updateGeoPosElements.org > result.txt

** @Rapha : Update Geo Belgique sur les codes postal
/communecter/datamigration/UpdateCitiesBelgiqueGeo

----------------------------------------------------
* Version 0.15

** @Rapha : Séparer Mayotte et la Réunion au niveau de la régions
db.cities.find({'region': '04'}).forEach(function(doc)
{
  if(typeof doc.insee != "undefined"){
    if(doc.insee.indexOf("976")>=0 )
        db.cities.update({"_id":doc._id},{'$set':{'region': '06'}});
  }
});

** @Rapha : Mettre les bon numéro de département 
db.cities.find({'dep': '97'}).forEach(function(doc)
{
  if(typeof doc.insee != "undefined"){
    if(doc.insee.indexOf("971")>=0 )
        db.cities.update({"_id":doc._id},{'$set':{'dep':'971'}});
    else if(doc.insee.indexOf("972")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'dep':'972'}});
    else if(doc.insee.indexOf("973")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'dep':'973'}});
    else if(doc.insee.indexOf("974")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'dep':'974'}});
    else if(doc.insee.indexOf("975")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'dep':'975'}});
    else if(doc.insee.indexOf("976")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'dep':'976'}});
  }
});

** @Rapha
Update Region 
http://qa.communecter.org/communecter/datamigration/updateRegion

** @tib : Update sur element
db.citoyens.find({}).forEach(function(doc){ 
    if(!doc.updated){
        var d = new Date();
        db.citoyens.update({"_id":doc._id},{'$set':{'updated': Math.round(d.getTime()/1000)-1814400} })
        //print(doc.email+" | "+d.getTime() )
     }
})
db.projects.find({}).forEach(function(doc){ 
    if(!doc.updated){
        var d = new Date();
        db.projects.update({"_id":doc._id},{'$set':{'updated': Math.round(d.getTime()/1000)-1814400} })
        //print(doc.email+" | "+d.getTime() )
     }
})
db.events.find({}).forEach(function(doc){ 
    if(!doc.updated){
        var d = new Date();
        db.events.update({"_id":doc._id},{'$set':{'updated': Math.round(d.getTime()/1000)-1814400} })
        //print(doc.email+" | "+d.getTime() )
     }
})
db.organizations.find({}).forEach(function(doc){ 
    if(!doc.updated){
        var d = new Date();
        db.organizations.update({"_id":doc._id},{'$set':{'updated': Math.round(d.getTime()/1000)-1814400} })
        //print(doc.email+" | "+d.getTime() )
     }
})

db.cities.find({dep:/987/}).forEach(function(doc)
{
    print( '"'+doc.name+'" => array("'+doc.regionName+'","'+doc.region+'"),' ); 
   db.cities.update({"_id":doc._id},{'$set':{'region': '07','regionName':'POLYNESIE'} })
});
db.cities.find({dep:/986/}).forEach(function(doc)
{
    print( '"'+doc.name+'" => array("'+doc.regionName+'","'+doc.region+'"),' ); 
   db.cities.update({"_id":doc._id},{'$set':{'region': '07','regionName':'POLYNESIE'} })
});
db.cities.find({dep:/988/}).forEach(function(doc)
{
    print( '"'+doc.name+'" => array("'+doc.regionName+'","'+doc.region+'"),' ); 
   db.cities.update({"_id":doc._id},{'$set':{'region': '08','regionName':'NOUVELLE-CALEDONIE'} })
});

** @Sylvain/Thomas/Tib : Créer les index corrects sur cities
db.cities.dropIndexes();
db.cities.createIndex({"geoPosition": "2dsphere"});
db.cities.createIndex({"postalCodes.geoPosition": "2dsphere"});
db.cities.createIndex({"geoShape" : "2dsphere" });
db.cities.createIndex({"insee" : 1});
db.cities.createIndex({"region" : 1});
db.cities.createIndex({"dep" : 1});
db.cities.createIndex({"cp" : 1});
db.cities.createIndex({"country" : 1});
db.cities.createIndex({"postalCodes.name" : 1});
db.cities.createIndex({"postalCodes.postalCode" : 1});

Raph El's avatar
Hotfix  
Raph El committed
523

524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954
----------------------------------------------------
//deja mis sur dev
db.cities.find().forEach(function(doc)
{
  if(typeof doc.insee != "undefined"){
    //print(doc.country+"_"+doc.insee); 
    
    if(doc.postalCodes){
        doc.postalCodes.forEach(function(v)
        {
        //print(">>"+doc.country+"_"+doc.insee+"_"+v.postalCode); 
            //if(v.postalCode == "97450")
            //{
                var d = new Date();
                var categs = ["Agriculture / Alimentation", "Santé","Déchets","Aménagement, Transport, Construction","Éducation, Petite-enfance","Citoyenneté","Economie Social et Solidaire","Energie-Climat","Culture / Animation ","Biodiversité "];
                categs.forEach(function(c)
                {
                    print(c+">>"+doc.country+"_"+doc.insee+"_"+v.postalCode);
                    db.actionRooms.insert({
                        "email" : "contact@communecter.org",
                        "name" : c,
                        "type" : "vote",
                        "parentType" : "cities",
                        "parentId" : doc.country+"_"+doc.insee+"-"+v.postalCode,
                        "created" : parseInt(Math.round(d.getTime()/1000)),
                        "updated" : parseInt(Math.round(d.getTime()/1000))
                    });
                });
            //}
        });
    }  
  }
});
 var t = {};
db.cities.find().forEach(function(doc)
{
  if(!t[ doc.region ] ){
      t[ doc.region ] = doc.regionName;
    print( '"'+doc.regionName+'" => array("'+doc.regionName+'","'+doc.region+'"),' ); 
  }
});

----------------------------------------------------
Version 0.14

@Bouboule:
1.ph/communecter/test/addpersonmediumimage will run actionAddPersonMediumImage()
		=> Add medium Image for each entity (Person/Organization/Event/Project)
		=> Create image in folder /medium and size 400px x 400 px
2.communecter/test/addeventmediumimage actionAddEventMediumImage()
3.communecter/test/addprojectmediumimage actionAddProjectMediumImage()
5.communecter/test/addorgamediumimage actionAddOrgaMediumImage()

@Rapha Ajout et Modification des préférences pour Orga/Project/Event
db.organizations.find({"preferences" : {$exists : false}}).forEach(function(doc){ 
    db.organizations.update({"_id":doc._id},{
                '$set':{'preferences': {"publicFields" : [], "privateFields" : [], "isOpenData" : true}}
         })
});

db.organizations.find({"preferences" : {$exists : true}}).forEach(function(doc){ 
    db.organizations.update({"_id":doc._id},{
                '$set':{'preferences': {"publicFields" : doc.preferences.publicFields, "privateFields" : doc.preferences.privateFields, "isOpenData" : true}}
         })
});

db.events.find({"preferences" : {$exists : false}}).forEach(function(doc){ 
    db.events.update({"_id":doc._id},{
                '$set':{'preferences': {"publicFields" : [], "privateFields" : [], "isOpenData" : true}}
         })
});

db.events.find({"preferences" : {$exists : true}}).forEach(function(doc){ 
    db.events.update({"_id":doc._id},{
                '$set':{'preferences': {"publicFields" : doc.preferences.publicFields, "privateFields" : doc.preferences.privateFields, "isOpenData" : true}}
         })
});


db.projects.find({"preferences" : {$exists : false}}).forEach(function(doc){ 
    db.projects.update({"_id":doc._id},{
                '$set':{'preferences': {"publicFields" : [], "privateFields" : [], "isOpenData" : true}}
         })
});

db.projects.find({"preferences" : {$exists : true}}).forEach(function(doc){ 
    db.projects.update({"_id":doc._id},{
                '$set':{'preferences': {"publicFields" : doc.preferences.publicFields, "privateFields" : doc.preferences.privateFields, "isOpenData" : true}}
         })
});


Version 0.13
----------------------------------------------------
@Rapha
Transforme les telephones au format String dans le nouveaux format
db.citoyens.find().forEach(function(doc){ 
    if(typeof doc.telephone == "string") { 
         print(doc.name);
         db.citoyens.update({"_id":doc._id},{
                '$set':{'telephone': {"fixe" : {0 : doc.telephone } }}
         })
    }
});

db.organizations.find().forEach(function(doc){ 
    if(typeof doc.telephone == "string") { 
         print(doc.name);
         db.organizations.update({"_id":doc._id},{
                '$set':{'telephone': {"fixe" : {0 : doc.telephone } }}
         })
    }
});

@Chil
Efface le flag "refactorAction" mis dans comment et news via la précédente fonction RefractorNewsCommentsActions
Executer l'url /communecter/test/DeleteAttributRefactorAction 


db.getCollection('events').find({"geoPosition.type":"point"});

//script d'inversion coordinates
db.events.find({}).forEach( function(c){ 
    if( c.geo && c.geo.longitude ){
        print(c.geo.longitude)
        
        db.events.update({_id:c._id}, {$set: {'geoPosition': {
            type: "Point",
            'coordinates': [parseFloat(c.geo.longitude), parseFloat(c.geo.latitude)]
          }}});
  geoPos}
})
---------------------------------------------------
Version 0.12

@Bouboule (clement.damiens@gmail.com)
1.Push in params config 'communeventUrl' => "https://communevent.communecter.org"
2.Bash on news (already done on qa and dev)
	21-ph/communecter/datamigration/refactornews will run actionRefactorNews()
		=> Remove all id and type in and object target.id, target.type
		=> Modify target type city to target.id=author, target.type=Person::COLLECTION
		=> Add @params type string "news" OR "activityStream"
		
	22-ph/communecter/datamigration/deletenewsganttsneeds will run actionDeleteNewsGanttsNeeds()
		=> Delete news type "activityStream" where object.objectType is "needs" OR "gantts"
		
	23-ph/communecter/datamigration/washingnewsnoscopetype will run actionWashingNewsNoScopeType() (CAREFULLY CAUSE NO CHECK)
		=> Delete news where scope is undefined
		
	24-ph/communecter/datamigration/washingnewstargetnotexist will run actionWashingNewsTargetNotExist()
		=> Delete news where target object is undefined
		=> Check if target is defined else delete news
		
		
3.Bash on documents (only on qa)
	31-ph/communecter/datamigration/WashIncorrectAndOldDataDocument will run WashIncorrectAndOldDataDocument()
		=> Wash data with array in params @size which could be string
		=> Wash data with no type or no id, represent the target of the document
		=> Wash data with no contentKey
	32-ph/communecter/datamigration/changesizedocumenttobytesnumber will run actionChangeSizeDocumentToBytesNumber() 
		=> Modify @params string $size to a number in bytes
	33- [!!!!!!!!!!!! CAREFULLY THIS METHOD IS FOR COMMUNECTER AND NOT FOR GRANDDIR !!!!!!!!!!!!!!!!!]
	ph/communecter/datamigration/refactorcontentkey will run actionRefactorContentKey() 
		=> Update @params string contentKey type "person.dashboard.profil" to "profil"
		=> String use is "profil" OR "slider"

@Sylvain
Create index on citizen email
db.citizen.createIndex({"email": 1} , { unique: true })

----------------------------------------------------
2016/05/23 => Récupérer statistiques sur les logs
@Chil
Executer l'url /communecter/test/CreateLastLogStatistics

----------------------------------------------------
2016/05/20 => Structure en tableau + insertion de la date du jour pour les actions + dans la collections news et comments
@Chil
Executer l'url /communecter/test/RefactorNewsCommentsActions

----------------------------------------------------
2016/05/20 => Suppression des password dans la collection log
@Chil
Executer l'url /communecter/test/LogDeletePasswordCitoyen



----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------

@Rapha
Ajout du type course dans la liste des events
db.getCollection('lists').find({name : "eventTypes"}).forEach(function(doc){
    if(typeof  doc.listcourse == "undefined" ){
        db.lists.update({"_id":doc._id},{
            '$set':{'list.course': "Formation" }
        }) 
    }
});
@Rapha
Change le type Array en Object de socialNetwork 
db.citoyens.find().forEach(function(doc){ 
    if(doc.socialNetwork instanceof Array == true) { 
         print(doc.name);
         db.citoyens.update({"_id":doc._id},{
                '$set':{'socialNetwork': {} }
         })
    }
});

@Tib
db.cities.find().forEach(function(doc)
{
  if(typeof doc.insee != "undefined"){
    print(doc.country+"_"+doc.insee); 
    db.organizations.update({"_id":doc._id},{
        '$set':{'_id': doc.country+"_"+doc.insee}
    })
  }
});

SBA - Add numberOfInvit on every citizen
db.citoyens.find().forEach(function(doc){ 
    if(doc.numberOfInvit == null) { 
         print(doc.name); 
         db.citoyens.update({"_id":doc._id},{
                '$set':{'numberOfInvit': NumberLong(10)}
         }) 
    }
});
---------------------------------------------------
2016/03/18

Mettre en cron les statistiques
communecter/stat/createglobalstat

----------------------------------------------------


2016/03/01
@Raphael
Add "'isOpendata': true" for all projects which have sourceKey == "patapouf"

db.organizations.find().forEach(function(doc){ 
    if(doc.source != null) { 
        if(doc.source.key == "patapouf"){ 
            print(doc.name); 
            db.organizations.update({"_id":doc._id},{
                '$set':{'isOpendata': true}
            }) 
        } 
    }
});



----------------------------------------------------
set up indexes 
db.cities.createIndex({"geoPosition": "2dsphere"});
db.cities.createIndex({"postalCodes.geoPosition": "2dsphere"});
----------------------------------------------------
benchmarkin mongo 

var timeStart = new Date();
for(var i = 0 ; i < 70000 ; i++){
    //db.test.insert({name:"test"+i}); //prend 30s > 
    db.test.insert({name:"test"+i,email:"test"+i,toto:"test"+i,coco:"test"+i});//prend 33s  > 7Mb
    db.test.insert({name:"test"+i,email:"test"+i,toto:"test"+i,coco:"test"+i,namex:"test"+i,emailx:"test"+i,totox:"test"+i,cocox:"test"+i});   // 36s > 13Mb
    //pour 200K entré : 108s et 38Mb
}
var timeEnd = new Date();
print(timeEnd-timeStart);
----------------------------------------------------
//adding countries to cities
db.cities.find().forEach(function(doc)
{
  if(typeof doc.insee != "undefined"){
    if(doc.insee.indexOf("971")>=0 )
        db.cities.update({"_id":doc._id},{'$set':{'country':'GP'}});
    else if(doc.insee.indexOf("972")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'country':'MQ'}});
    else if(doc.insee.indexOf("973")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'country':'GF'}});
    else if(doc.insee.indexOf("974")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'country':'RE'}});
    else if(doc.insee.indexOf("975")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'country':'PM'}});
    else if(doc.insee.indexOf("976")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'country':'YT'}});
    else if(doc.insee.indexOf("988")==0 )
        db.cities.update({"_id":doc._id},{'$set':{'country':'NC'}});
    else
        db.cities.update({"_id":doc._id},{'$set':{'country':'FR'}});
  }
});
----------------------------------------------------
//adding regionName to cities Nouvelle-Caledonie
db.cities.find().forEach(function(doc)
{
    if(typeof doc.insee != "undefined"){
        if(doc.insee.indexOf("988")==0 )
            db.cities.update({"_id":doc._id},{'$set':{'regionName':'Nouvelle-Calédonie', 'depName':'Nouvelle-Calédonie'}});
    }
});
----------------------------------------------------
Update username on citizen collection.
To launch with mongodb

db.citoyens.find().forEach(function(doc){
    if(doc.username == null) { 
        var username = doc.email.substr(0, doc.email.indexOf('@'));
        print(doc.name+" :  "+doc.email+": "+username);
        db.citoyens.update({"_id":doc._id},{'$set':{'username':username}})
    }
});

----------------------------------------------------
Init scripts

#import lists 
cd communecter/data
mongoimport --db pixelhumain --collection lists lists.json --jsonArray;

----------------------------------------------------
https://www.google.com/url?q=https%3A%2F%2Fgit-scm.com%2Fbook%2Ffr%2Fv1%2FLes-branches-avec-Git-Les-branches-distantes&sa=D&sntz=1&usg=AFQjCNHT0E5vbg_-BUC7xIm7guTVRBzG1Q

//1. Créer une branche locale
git branch granddir-V.0.1
//2. Pusher la branche sur le serveur distant
git push origin granddir-V.0.1
//3. Si besoin checkout d'une branche distante sur une branche en local 
//3.1 Récupérer les branches distantes nouvellement créée
git fetch origin
//3.2 récupérer le contenu d'une branche distante
git checkout -b granddir-V.0.1 origin/granddir-V.0.1


//Azot live branch
git checkout -b azot-live-0.1 origin/azot-live-0.1


git remote show origin
If the remote branch you want to checkout is under "New remote branches" and not "Tracked remote branches" then you need to fetch them first:
git remote update
git fetch
Now it should work:
git checkout -b local-name origin/remote-name
----------------------------------------------------

//SBA : 12/08/2015
New role object on Citoyen collection
1/Backup your citoyen collection
2/Launch the following code on your mongodb 
db.citoyens.find().forEach(function(citoyen){
    if(citoyen.roles == null) { 
        print(citoyen.name+" roles is null ");
        db.citoyens.update({"_id":citoyen._id}, 
                    {'$set':{'roles': { 
                        "standalonePageAccess" : true
                    }}}
        );
    }
});

//SBA : 30/04/2015
Update your config/main.php
Now all the parameters link to your environment are stored in paramsconfig.php

----------------------------------------------------

//SBA : 30/04/2015 :
How to Load cities collection
Download the ville de france file on git : https://raw.githubusercontent.com/pixelhumain/Villes-de-France/master/cities.js
Drop or rename any existing "cities" collection
Load the new collection
mongoimport --db pixelhumain --collection cities PATH_TO_MY_FILE\cities.js --jsonArray

----------------------------------------------------
//TKA : 28/04/2015  : 
execute composer update to install Captcha libs
and add the secret key to your paramsconfig.php
----------------------------------------------------
#TKA : 28/04/2015  : mettre a jour les cp dans cities

db.cities.find().forEach(function(doc){
    if(doc.insee.length == 4){ 
        print(doc.name+" cp "+doc.insee.length+": "+doc.insee);
        db.cities.update({"_id":doc._id},{'$set':{'insee':"0"+doc.insee}})
    }
});

db.cities.find().forEach(function(doc){
    if(doc.cp.length == 4){ 
        print(doc.name+" cp "+doc.cp.length+": "+doc.cp);
        db.cities.update({"_id":doc._id},{'$set':{'cp':"0"+doc.cp}})
    }
});

----------------------------------------------------
//TKA - 24/2/15
db.organizations.update({type:"entreprise"},{"$set":{type:"LocalBusiness"}},{"multi":1})
db.organizations.update({type:"association"},{"$set":{type:"NGO"}},{"multi":1})
db.organizations.update({type:"group"},{"$set":{type:"Group"}},{"multi":1})

DB lists update documents
{
    "name" : "organisationTypes",
    "list" : {
        "NGO" : "Association",
        "LocalBusiness" : "Entreprise",
        "Group" : "Group"
    }
}

---------------------------------------------------

Modifier un mail
db.organizations.find().forEach(function(doc){ 
    if(doc.email == "vanespen.amaury@gmail.com"){ 
        print(doc.name+" :: " + doc.email); 
        db.organizations.update({"_id":doc._id},{
            '$set':{'email':""}
        }) 
    } 
});

Kgneo's avatar
Kgneo committed
955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978
TANGO - 22/05/2017
---------------------------------------------------
batch refactor news for SHARE
---------------------------------------------------

db.news.find({}).forEach(function(doc){ 
    if(typeof doc.targetIsAuthor !="undefined" && doc.targetIsAuthor == "true"){
        db.news.update({"_id":doc._id},{'$set':
        {'sharedBy':[
            {'id': doc.target.id,
             'type':doc.target.type,
             'updated': doc.created 
            }]
        }})
    }else{
        db.news.update({"_id":doc._id},{'$set':
        {'sharedBy':[
            {'id': doc.author,
             'type':'citoyens',
             'updated': doc.created 
            }]
        }})
     }
})
979 980


Kgneo's avatar
Kgneo committed
981 982 983 984 985 986 987 988 989 990 991 992 993 994 995
TANGO - 22/05/2017
---------------------------------------------------
set localityid to all NC cities
---------------------------------------------------

db.cities.find().forEach(function(doc){ 
    if(doc.country == "NC"){ 
        print(doc.name+" :: " + doc.country + " - " + doc._id.str); 
        db.cities.update({"_id":doc._id},{
            '$set':{'localityId':doc._id.str}
        }) 
    } 
});


Kgneo's avatar
Kgneo committed
996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012
db.cities.find().forEach(function(doc){ 
    if(doc.country == "NC"){ 
        print(doc.name+" :: " + doc.postalCodes[0].kanakName); 

        if(typeof doc.postalCodes[0].kanakName != "undefined"){
          db.cities.update({"_id":doc._id},{
              '$set':{'kanakName':doc.postalCodes[0].kanakName}
          });
        } else {
          db.cities.update({"_id":doc._id},{
              '$set':{'kanakName':doc.postalCodes[0].name}
          });
        }
    } 
});


1013 1014 1015 1016 1017 1018 1019 1020
---------------------------------------------------
Activer / Désactiver MAPBOX

In file : pixelhumain/ph/protected/config/paramsconfig.php
Default params :
  'mapboxActive'      => true, //set to false to disable MapBox on no-local-server = prod || dev || qa (use OSM)
  'forceMapboxActive' => false,//set to true  to use MapBox on local-server
  'mapboxToken' => '', //pense à mettre le Token sur QA et prod pour utiliser mapbox