|
@@ -17,6 +17,7 @@ use Logipro\CaptainLearning\Entity\Type\EnumSessionPlanType;
|
17
|
17
|
use Logipro\CaptainLearning\Entity\Type\EnumPersonStatutType;
|
18
|
18
|
use Logipro\CaptainLearning\Entity\Type\EnumTrainingTypeType;
|
19
|
19
|
use Logipro\CaptainLearning\Entity\Type\EnumUserCivilityType;
|
|
20
|
+use Logipro\CaptainLearning\Entity\Type\EnumEstimateStatutType;
|
20
|
21
|
use Logipro\CaptainLearning\Entity\Type\EnumTrainingStatutType;
|
21
|
22
|
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
22
|
23
|
use Logipro\CaptainLearning\Entity\Type\EnumTrainingCertificationType;
|
|
@@ -211,6 +212,18 @@ class MigrateCommand extends ContainerAwareCommand
|
211
|
212
|
$result = $this->oldconnection->query($query);
|
212
|
213
|
while ($row = $result->fetch())
|
213
|
214
|
{
|
|
215
|
+ // corrige les références erronées
|
|
216
|
+ $refSession = $row['ref_session'];
|
|
217
|
+ if (!$this->testDistRef('session',$refSession))
|
|
218
|
+ {
|
|
219
|
+ $refSession = null;
|
|
220
|
+ }
|
|
221
|
+ $refEstimate = $row['ref_devis'];
|
|
222
|
+ if (!$this->testDistRef('estimate',$refEstimate))
|
|
223
|
+ {
|
|
224
|
+ continue;
|
|
225
|
+ }
|
|
226
|
+
|
214
|
227
|
// ajoute le devis
|
215
|
228
|
$newCountry = array(
|
216
|
229
|
"estimateLine_id" => $row['id_ligne_devis'],
|
|
@@ -219,8 +232,8 @@ class MigrateCommand extends ContainerAwareCommand
|
219
|
232
|
"tva" => $row['tva'],
|
220
|
233
|
"designation" => $row['designation'],
|
221
|
234
|
"reference" =>$row['reference'],
|
222
|
|
- "ref_session" => $this->setValueIfEqual(null,$row['ref_session']),
|
223
|
|
- "ref_estimate" => $row['ref_devis'],
|
|
235
|
+ "ref_session" => $this->setValueIfEqual(null,$refSession),
|
|
236
|
+ "ref_estimate" => $refEstimate,
|
224
|
237
|
"order_line" => $row['ordre'],
|
225
|
238
|
);
|
226
|
239
|
|
|
@@ -228,6 +241,19 @@ class MigrateCommand extends ContainerAwareCommand
|
228
|
241
|
}
|
229
|
242
|
}
|
230
|
243
|
|
|
244
|
+ private function getEnumValue($options,$value,$defaultValue)
|
|
245
|
+ {
|
|
246
|
+ if (!isset($options[$value]))
|
|
247
|
+ {
|
|
248
|
+ if (!$defaultValue)
|
|
249
|
+ {
|
|
250
|
+ return reset($options);
|
|
251
|
+ }
|
|
252
|
+ return $defaultValue;
|
|
253
|
+ }
|
|
254
|
+ return $options[$value];
|
|
255
|
+ }
|
|
256
|
+
|
231
|
257
|
protected function migrateEstimate()
|
232
|
258
|
{
|
233
|
259
|
$newTableName = 'cpt_estimate';
|
|
@@ -244,18 +270,49 @@ class MigrateCommand extends ContainerAwareCommand
|
244
|
270
|
"F" => EnumUserCivilityType::CIVILITY_MS,
|
245
|
271
|
);
|
246
|
272
|
|
|
273
|
+ $statut = array(
|
|
274
|
+ 'DEMANDE_EN_ATTENTE' => EnumEstimateStatutType::STATUT_WAITING,
|
|
275
|
+ 'DEMANDE_REFUSEE' => EnumEstimateStatutType::STATUT_REFUSED,
|
|
276
|
+ 'DEVIS_A_EMETTRE' => EnumEstimateStatutType::STATUT_FOR_EMIT,
|
|
277
|
+ 'DEVIS_EMIS' => EnumEstimateStatutType::STATUT_EMIT,
|
|
278
|
+ 'PAIEMENT_EN_COURS' => EnumEstimateStatutType::STATUT_PAYMENT,
|
|
279
|
+ 'PAIEMENT_SUCCES' => EnumEstimateStatutType::STATUT_PAYMENT_SUCCES,
|
|
280
|
+ 'PAIEMENT_ECHEC' => EnumEstimateStatutType::STATUT_PAYMENT_FAIL
|
|
281
|
+ );
|
|
282
|
+
|
247
|
283
|
$query = 'SELECT * FROM ' . $oldTableName;
|
248
|
284
|
$result = $this->oldconnection->query($query);
|
249
|
285
|
while ($row = $result->fetch())
|
250
|
286
|
{
|
|
287
|
+ $row['ref_formation_intra'];
|
|
288
|
+
|
|
289
|
+ // corrige les références erronées
|
|
290
|
+ $refTraining = $row['ref_formation_intra'];
|
|
291
|
+ if (!$this->testDistRef('training',$refTraining))
|
|
292
|
+ {
|
|
293
|
+ $refTraining = null;
|
|
294
|
+ }
|
|
295
|
+
|
|
296
|
+ $refClient = $row['ref_client'];
|
|
297
|
+ if (!$this->testDistRef('client',$refClient))
|
|
298
|
+ {
|
|
299
|
+ continue;
|
|
300
|
+ }
|
|
301
|
+
|
|
302
|
+ $refTrainingOrganization = $row['ref_organisme_formation'];
|
|
303
|
+ if (!$this->testDistRef('training_organization',$refTrainingOrganization))
|
|
304
|
+ {
|
|
305
|
+ continue;
|
|
306
|
+ }
|
|
307
|
+
|
251
|
308
|
// ajoute le devis
|
252
|
309
|
$newEstimate = array(
|
253
|
310
|
"estimate_id" => $row['id_devis'],
|
254
|
311
|
"date_create" => $row['date_creation'],
|
255
|
312
|
"date_edit" => $this->setValueIfEqual(null,$row['date_modification'],"0000-00-00 00:00:00"),
|
256
|
|
- "statut" => $row['statut'],
|
|
313
|
+ "statut" => $this->getEnumValue($statut,$row['statut'],EnumEstimateStatutType::STATUT_WAITING),
|
257
|
314
|
"coment" => $row['commentaire'],
|
258
|
|
- "client_civility" => $civilities[$row['client_genre']],
|
|
315
|
+ "client_civility" => $this->getEnumValue($civilities,$row['client_genre'],EnumUserCivilityType::CIVILITY_NA),
|
259
|
316
|
"client_name" => $row['client_nom'],
|
260
|
317
|
"client_first_name" => $row['client_prenom'],
|
261
|
318
|
"client_denomination" => $row['client_denomination'],
|
|
@@ -267,9 +324,9 @@ class MigrateCommand extends ContainerAwareCommand
|
267
|
324
|
"client_phone" => $row['client_tel'],
|
268
|
325
|
"reference" => $row['reference'],
|
269
|
326
|
"object" => $row['objet'],
|
270
|
|
- "ref_training_organization" => $row['ref_organisme_formation'],
|
271
|
|
- "ref_client" => $row['ref_client'],
|
272
|
|
- "ref_training" => $row['ref_formation_intra'],
|
|
327
|
+ "ref_training_organization" => $refTrainingOrganization,
|
|
328
|
+ "ref_client" => $refClient,
|
|
329
|
+ "ref_training" => $refTraining,
|
273
|
330
|
);
|
274
|
331
|
$this->insertData($newTableName,$newEstimate);
|
275
|
332
|
}
|
|
@@ -304,6 +361,12 @@ class MigrateCommand extends ContainerAwareCommand
|
304
|
361
|
$result = $this->oldconnection->query($query);
|
305
|
362
|
while ($row = $result->fetch())
|
306
|
363
|
{
|
|
364
|
+ $refFormation = $row['ref_formation'];
|
|
365
|
+ if (!$this->testDistRef('training',$refFormation))
|
|
366
|
+ {
|
|
367
|
+ continue;
|
|
368
|
+ }
|
|
369
|
+
|
307
|
370
|
// ajoute le nouveau pays
|
308
|
371
|
$newCountry = array(
|
309
|
372
|
"session_id" => $row['id_session'],
|
|
@@ -313,19 +376,31 @@ class MigrateCommand extends ContainerAwareCommand
|
313
|
376
|
"date_end_subscribe" => $this->setValueIfEqual(null,$row['date_cloture_inscription'],"0000-00-00 00:00:00"),
|
314
|
377
|
"minimal_place_number" => $this->setValueIfEqual(0,$row['nombre_place_min']),
|
315
|
378
|
"maximal_place_number" => $this->setValueIfEqual(0,$row['nombre_place_max']),
|
316
|
|
- "statut" => $statut[$row['statut']],
|
|
379
|
+ "statut" => $this->getEnumValue($statut,$row['statut'],EnumTrainingStatutType::STATUT_NOT_PUBLISHED),
|
317
|
380
|
"price" => $row['prix_ht'],
|
318
|
381
|
"duration" => $row['duree'],
|
319
|
382
|
"staggering" => $row['etalement'],
|
320
|
383
|
"code" => $row['code'],
|
321
|
384
|
"ref_place" => $this->setValueIfEqual(null,$row['ref_lieu']),
|
322
|
|
- "ref_training" => $row['ref_formation'],
|
|
385
|
+ "ref_training" => $refFormation,
|
323
|
386
|
);
|
324
|
387
|
|
325
|
388
|
$this->insertData($newTableName,$newCountry);
|
326
|
389
|
}
|
327
|
390
|
}
|
328
|
391
|
|
|
392
|
+ protected function testDistRef($symfonyObject,$ref)
|
|
393
|
+ {
|
|
394
|
+ $query = "SELECT 1 FROM cpt_" . $symfonyObject . " WHERE " . $symfonyObject . "_id=" . (int)$ref;
|
|
395
|
+ $result = $this->connection->query($query);
|
|
396
|
+ $row = $result->fetch();
|
|
397
|
+ if (!$row)
|
|
398
|
+ {
|
|
399
|
+ return false;
|
|
400
|
+ }
|
|
401
|
+ return true;
|
|
402
|
+ }
|
|
403
|
+
|
329
|
404
|
protected function migrateSessionPlan()
|
330
|
405
|
{
|
331
|
406
|
$newTableName = 'cpt_sessionplan';
|
|
@@ -346,6 +421,13 @@ class MigrateCommand extends ContainerAwareCommand
|
346
|
421
|
$result = $this->oldconnection->query($query);
|
347
|
422
|
while ($row = $result->fetch())
|
348
|
423
|
{
|
|
424
|
+ // corrige les références erronées
|
|
425
|
+ $refEntreprise = $row['ref_entreprise'];
|
|
426
|
+ if (!$this->testDistRef('company',$refEntreprise))
|
|
427
|
+ {
|
|
428
|
+ $refEntreprise = null;
|
|
429
|
+ }
|
|
430
|
+
|
349
|
431
|
if ($row['date_debut'] == "0000-00-00 00:00:00")
|
350
|
432
|
{
|
351
|
433
|
continue;
|
|
@@ -358,10 +440,10 @@ class MigrateCommand extends ContainerAwareCommand
|
358
|
440
|
"date_end" => $row['date_fin'],
|
359
|
441
|
"duration" => $row['duree'],
|
360
|
442
|
"date_create" => $this->setValueIfEqual(date("Y-m-d h:i:s"),$row['date_creation'],"0000-00-00 00:00:00"),
|
361
|
|
- "type" => $types[$row['type']],
|
|
443
|
+ "type" => $this->getEnumValue($types,$row['type'],EnumSessionPlanType::TYPE_USER_WISH),
|
362
|
444
|
"description" => $row['description'],
|
363
|
445
|
"ref_session" => $this->setValueIfEqual(null,$row['ref_session']),
|
364
|
|
- "ref_company" => $this->setValueIfEqual(null,$row['ref_entreprise']),
|
|
446
|
+ "ref_company" => $this->setValueIfEqual(null,$refEntreprise),
|
365
|
447
|
"ref_training" => $this->setValueIfEqual(null,$row['ref_formation']),
|
366
|
448
|
"ref_user" => $this->setValueIfEqual(null,$row['ref_utilisateur']),
|
367
|
449
|
);
|
|
@@ -373,8 +455,13 @@ class MigrateCommand extends ContainerAwareCommand
|
373
|
455
|
$result = $this->oldconnection->query($query);
|
374
|
456
|
while ($row = $result->fetch())
|
375
|
457
|
{
|
|
458
|
+ $refSessionPlan = $row['ref_session_plan'];
|
|
459
|
+ if (!$this->testDistRef('sessionplan',$refSessionPlan))
|
|
460
|
+ {
|
|
461
|
+ continue;
|
|
462
|
+ }
|
376
|
463
|
$data = array(
|
377
|
|
- "ref_session_plan" => $row['ref_session_plan'],
|
|
464
|
+ "ref_session_plan" => $refSessionPlan,
|
378
|
465
|
"ref_person" => $row['ref_personne'],
|
379
|
466
|
);
|
380
|
467
|
|
|
@@ -416,7 +503,7 @@ class MigrateCommand extends ContainerAwareCommand
|
416
|
503
|
"ref_client" => $refClient,
|
417
|
504
|
"size" => $row['taille'],
|
418
|
505
|
"name" => $row['nom'],
|
419
|
|
- "type" => $types[$row['type']],
|
|
506
|
+ "type" => $this->getEnumValue($types,$row['type'],EnumRecordType::TYPE_OTHER),
|
420
|
507
|
);
|
421
|
508
|
|
422
|
509
|
$this->insertData($newTableName,$newCountry);
|
|
@@ -428,10 +515,10 @@ class MigrateCommand extends ContainerAwareCommand
|
428
|
515
|
{
|
429
|
516
|
$data = array(
|
430
|
517
|
"ref_training" => $row['ref_formation'],
|
431
|
|
- "ref_list" => $row['ref_liste'],
|
|
518
|
+ "ref_record" => $row['ref_liste'],
|
432
|
519
|
);
|
433
|
520
|
|
434
|
|
- $this->insertData('cpt_map_list_training',$data);
|
|
521
|
+ $this->insertData('cpt_map_record_training',$data);
|
435
|
522
|
}
|
436
|
523
|
|
437
|
524
|
$query = 'SELECT * FROM cpt_map_liste_personne';
|
|
@@ -493,14 +580,14 @@ class MigrateCommand extends ContainerAwareCommand
|
493
|
580
|
// ajoute le nouveau pays
|
494
|
581
|
$newCountry = array(
|
495
|
582
|
"person_id" => $row['id_personne'],
|
496
|
|
- "civility" => $civilities[$row['civilite']],
|
|
583
|
+ "civility" => $this->getEnumValue($civilities,$row['civilite'],EnumUserCivilityType::CIVILITY_NA),
|
497
|
584
|
"name" => $row['nom'],
|
498
|
585
|
"first_name" => $row['prenom'],
|
499
|
586
|
"email" => $row['email'],
|
500
|
587
|
"address" => $row['adresse'],
|
501
|
588
|
"postal_code" => $row['code_postal'],
|
502
|
589
|
"city" => $row['ville'],
|
503
|
|
- "statut" => $statuts[$row['statut']],
|
|
590
|
+ "statut" => $this->getEnumValue($statuts,$row['statut'],EnumPersonStatutType::TYPE_DEMAND),
|
504
|
591
|
"date_create" => $this->setValueIfEqual(date("Y-m-d h:i:s"),$row['date_creation'],"0000-00-00 00:00:00"),
|
505
|
592
|
"ref_user" => $refUser,
|
506
|
593
|
"ref_company" => $row['ref_entreprise'],
|
|
@@ -566,14 +653,27 @@ class MigrateCommand extends ContainerAwareCommand
|
566
|
653
|
"QUALIFIANTE" => EnumTrainingCertificationType::CERTIFICATION_QUALIFYING
|
567
|
654
|
);
|
568
|
655
|
|
569
|
|
- $query = 'SELECT * FROM ' . $oldTableName;
|
|
656
|
+ $query = 'SELECT *,cover.vue_file as cover,logo.vue_file as logo FROM ' . $oldTableName .
|
|
657
|
+ ' left outer join vue as logo on ' . $oldTableName . '.vue_logo=logo.id_vue'.
|
|
658
|
+ ' left outer join vue as cover on ' . $oldTableName . '.vue_couverture=cover.id_vue';
|
570
|
659
|
$result = $this->oldconnection->query($query);
|
571
|
660
|
while ($row = $result->fetch())
|
572
|
661
|
{
|
|
662
|
+ $refFormation = $row['id_formation'];
|
|
663
|
+ $queryMap = 'SELECT vue.vue_file as vue_file FROM cpt_map_vue_formation
|
|
664
|
+ inner join vue on vue.id_vue=cpt_map_vue_formation.ref_vue
|
|
665
|
+ WHERE ref_formation=' . $refFormation . ' ORDER BY ordre ASC';
|
|
666
|
+ $resultMap = $this->oldconnection->query($queryMap);
|
|
667
|
+ $pictures = array();
|
|
668
|
+ while ($rowMap = $resultMap->fetch())
|
|
669
|
+ {
|
|
670
|
+ $pictures[] = $rowMap["vue_file"];
|
|
671
|
+ }
|
|
672
|
+
|
573
|
673
|
// ajoute le nouveau pays
|
574
|
674
|
$newCountry = array(
|
575
|
675
|
"training_id" => $row['id_formation'],
|
576
|
|
- "statut" => $statut[$row['statut']],
|
|
676
|
+ "statut" => $this->getEnumValue($statut,$row['statut'],EnumTrainingStatutType::STATUT_NOT_PUBLISHED),
|
577
|
677
|
"code" => $row['code'],
|
578
|
678
|
"name" => $row['nom'],
|
579
|
679
|
"hook" => $row['accroche'],
|
|
@@ -593,9 +693,9 @@ class MigrateCommand extends ContainerAwareCommand
|
593
|
693
|
"acquired_evaluation" => $row['evaluation_acquis'],
|
594
|
694
|
"level" => $row['niveau'],
|
595
|
695
|
"border_modalities" => $row['modalites_encadrement'],
|
596
|
|
- "type" => $type[$row['type']],
|
597
|
|
- "optionnal_type" => $type[$row['type_optionnel']],
|
598
|
|
- "certification" => $certification[$row['certification']],
|
|
696
|
+ "type" => $this->getEnumValue($type,$row['type'],EnumTrainingTypeType::TYPE_NA),
|
|
697
|
+ "optionnal_type" => $this->getEnumValue($type,$row['type_optionnel'],EnumTrainingTypeType::TYPE_NA),
|
|
698
|
+ "certification" => $this->getEnumValue($certification,$row['certification'],EnumTrainingCertificationType::CERTIFICATION_NONE),
|
599
|
699
|
"date_create" => $row['date_creation'],
|
600
|
700
|
"date_edit" => $this->setValueIfEqual(null,$row['date_modification'],'0000-00-00 00:00:00'),
|
601
|
701
|
"date_es" => $this->setValueIfEqual(null,$row['date_synchronisation_elasticsearch'],'0000-00-00 00:00:00'),
|
|
@@ -608,8 +708,21 @@ class MigrateCommand extends ContainerAwareCommand
|
608
|
708
|
"ref_category" => $this->setValueIfEqual(null,$row['ref_categorie']),
|
609
|
709
|
"ref_buisness_category" => $this->setValueIfEqual(null,$row['ref_categorie_metier']),
|
610
|
710
|
"ref_place" => $this->setValueIfEqual(null,$row['ref_lieu']),
|
611
|
|
- "ref_training_organization" => $row['ref_organisme_formation']
|
|
711
|
+ "ref_training_organization" => $row['ref_organisme_formation'],
|
|
712
|
+
|
|
713
|
+ "logo" => $row['logo'],
|
|
714
|
+ "cover" => $row['cover'],
|
|
715
|
+
|
|
716
|
+ "picture_one" => @$pictures[0],
|
|
717
|
+ "picture_two" => @$pictures[1],
|
|
718
|
+ "picture_tree" => @$pictures[2],
|
|
719
|
+ "picture_four" => @$pictures[3],
|
|
720
|
+ "picture_five" => @$pictures[4],
|
612
|
721
|
);
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
613
|
726
|
$this->insertData($newTableName,$newCountry);
|
614
|
727
|
}
|
615
|
728
|
}
|
|
@@ -684,7 +797,7 @@ class MigrateCommand extends ContainerAwareCommand
|
684
|
797
|
);
|
685
|
798
|
|
686
|
799
|
$query = 'SELECT * FROM ' . $oldTableName .
|
687
|
|
- 'left outer join vue on mod_utilisateur.ref_vue=vue.id_vue';
|
|
800
|
+ ' left outer join vue on mod_utilisateur.vue_photo=vue.id_vue';
|
688
|
801
|
$result = $this->oldconnection->query($query);
|
689
|
802
|
while ($row = $result->fetch())
|
690
|
803
|
{
|
|
@@ -692,7 +805,7 @@ class MigrateCommand extends ContainerAwareCommand
|
692
|
805
|
$newUser = array(
|
693
|
806
|
"user_id" => $row['id_utilisateur'],
|
694
|
807
|
"email" => $row['mail'],
|
695
|
|
- "civility" => $civilities[$row['civilite']],
|
|
808
|
+ "civility" => $this->getEnumValue($civilities,$row['civilite'],EnumUserCivilityType::CIVILITY_NA),
|
696
|
809
|
"name" => $row['nom_utilisateur'],
|
697
|
810
|
"first_name" => $row['prenom'],
|
698
|
811
|
"role" => EnumRoleType::ROLE_USER,
|
|
@@ -787,7 +900,9 @@ class MigrateCommand extends ContainerAwareCommand
|
787
|
900
|
return;
|
788
|
901
|
}
|
789
|
902
|
|
790
|
|
- $query = 'SELECT * FROM ' . $oldTableName;
|
|
903
|
+ $query = 'SELECT * FROM ' . $oldTableName .
|
|
904
|
+ ' left outer join vue on ' . $oldTableName . '.vue_logo=vue.id_vue';
|
|
905
|
+
|
791
|
906
|
$result = $this->oldconnection->query($query);
|
792
|
907
|
while ($row = $result->fetch())
|
793
|
908
|
{
|
|
@@ -805,9 +920,10 @@ class MigrateCommand extends ContainerAwareCommand
|
805
|
920
|
"submit_tva" => $row['soumis_tva'],
|
806
|
921
|
"intra_community_tva" => $row['tva_intracommunautaire'],
|
807
|
922
|
"date_create" => $row['date_creation_fiche'],
|
808
|
|
- "type" => $types[$row['type_societe']],
|
|
923
|
+ "type" => $this->getEnumValue($types,$row['type_societe'],EnumCompanyType::TYPE_COMPANY),
|
809
|
924
|
"salaried_number" => $row['nombre_salarie'],
|
810
|
925
|
"ref_country" => $row['ref_pays'],
|
|
926
|
+ "logo" => $row['vue_file']
|
811
|
927
|
);
|
812
|
928
|
|
813
|
929
|
/* @FIXME pour les vues
|
|
@@ -864,14 +980,20 @@ class MigrateCommand extends ContainerAwareCommand
|
864
|
980
|
return;
|
865
|
981
|
}
|
866
|
982
|
|
867
|
|
- $query = 'SELECT * FROM ' . $oldTableName;
|
|
983
|
+ $query = 'SELECT *,cover.vue_file as cover,logo.vue_file as logo,kbis.vue_file as kbis,identite.vue_file as identite,banner.vue_file as banner FROM ' . $oldTableName .
|
|
984
|
+ ' left outer join vue as cover on ' . $oldTableName . '.vue_couverture=cover.id_vue'.
|
|
985
|
+ ' left outer join vue as logo on ' . $oldTableName . '.vue_logo=logo.id_vue'.
|
|
986
|
+ ' left outer join vue as kbis on ' . $oldTableName . '.vue_kbis=kbis.id_vue'.
|
|
987
|
+ ' left outer join vue as identite on ' . $oldTableName . '.vue_identite=identite.id_vue'.
|
|
988
|
+ ' left outer join vue as banner on ' . $oldTableName . '.vue_banniere=banner.id_vue';
|
|
989
|
+
|
868
|
990
|
$result = $this->oldconnection->query($query);
|
869
|
991
|
while ($row = $result->fetch())
|
870
|
992
|
{
|
871
|
993
|
// ajoute le nouvel of
|
872
|
994
|
$newTrainingOrganization = array(
|
873
|
995
|
"training_organization_id" => $row['id_organisme_formation'],
|
874
|
|
- "valid" => $typesValid[$row['valide']],
|
|
996
|
+ "valid" => $this->getEnumValue($typesValid,$row['valide'],EnumTrainingOrganizationValidType::VALID_WAITING),
|
875
|
997
|
"number" => $row['numero'],
|
876
|
998
|
"number_quality_agreement" => $row['numero_agrement_qualite'],
|
877
|
999
|
//"date_quality_agreement" => $dateAgreement,
|
|
@@ -892,7 +1014,15 @@ class MigrateCommand extends ContainerAwareCommand
|
892
|
1014
|
"stripe_publishable_key" => $row['stripe_publishable_key'],
|
893
|
1015
|
"is_datadocked" => $row['est_datadock'],
|
894
|
1016
|
"accept_subrogation" => $row['accept_paiement_subrogation'],
|
895
|
|
- "description" => $row['description']
|
|
1017
|
+ "description" => $row['description'],
|
|
1018
|
+
|
|
1019
|
+ "cover" => $row['cover'],
|
|
1020
|
+ "logo" => $row['logo'],
|
|
1021
|
+ "kbis" => $row['kbis'],
|
|
1022
|
+ "identity" => $row['identite'],
|
|
1023
|
+ "banner" => $row['banner']
|
|
1024
|
+
|
|
1025
|
+
|
896
|
1026
|
);
|
897
|
1027
|
|
898
|
1028
|
$dateAgreement = $row['date_agrement_qualite'];
|
|
@@ -982,7 +1112,9 @@ class MigrateCommand extends ContainerAwareCommand
|
982
|
1112
|
$newTableName = 'cpt_category';
|
983
|
1113
|
$oldTableName = 'cpt_categorie';
|
984
|
1114
|
|
985
|
|
- $query = "SELECT * FROM $oldTableName WHERE ref_categorie=" . (int)$refCategory;
|
|
1115
|
+ $query = "SELECT * FROM $oldTableName " .
|
|
1116
|
+ ' left outer join vue on ' . $oldTableName . '.vue_image=vue.id_vue' .
|
|
1117
|
+ " WHERE ref_categorie=" . (int)$refCategory;
|
986
|
1118
|
$result = $this->oldconnection->query($query);
|
987
|
1119
|
|
988
|
1120
|
$classifications = array(
|
|
@@ -999,7 +1131,7 @@ class MigrateCommand extends ContainerAwareCommand
|
999
|
1131
|
"category_id" => $idCategorie,
|
1000
|
1132
|
"name" => $row["nom"],
|
1001
|
1133
|
"level" => $row["niveau"],
|
1002
|
|
- "type_classification" => $classifications[$row["type_classification"]],
|
|
1134
|
+ "type_classification" => $this->getEnumValue($classifications,$row["type_classification"],EnumCategoryType::TYPE_CATEGORY),
|
1003
|
1135
|
"keywords" => $row["mots_cles"],
|
1004
|
1136
|
"buisness_code" => $row["code_metier"],
|
1005
|
1137
|
"meta_title" => $row["meta_title"],
|
|
@@ -1007,6 +1139,7 @@ class MigrateCommand extends ContainerAwareCommand
|
1007
|
1139
|
"meta_og_title" => $row["meta_og_title"],
|
1008
|
1140
|
"meta_og_description" => $row["meta_og_description"],
|
1009
|
1141
|
"ref_category" => $this->setValueIfEqual(null,$row["ref_categorie"],0),
|
|
1142
|
+ "picture" => $row['vue_file'],
|
1010
|
1143
|
);
|
1011
|
1144
|
|
1012
|
1145
|
$this->insertData($newTableName,$newCategory);
|