raphael 4 years ago
parent
commit
48760ab4b5

+ 185
- 72
assets/exclusive/js/backOffice/seller/training_form.js View File

@@ -61,7 +61,7 @@ $(document).ready(function()
61 61
 
62 62
 
63 63
 			var selectSousDomaine = $("#training_categorySubDomain");
64
-			selectSousDomaine.parent().addClass('content_load');
64
+			selectSousDomaine.prop('disabled', 'disabled').parent().addClass('content_load');
65 65
 			getChildCategoryBuisness(idCategory, function(categories)
66 66
 			{
67 67
 				if (categories)
@@ -69,6 +69,7 @@ $(document).ready(function()
69 69
 					$.each(categories, function(id, categorie) {
70 70
 						$("<option>", {value:id, text:categorie}).appendTo(selectSousDomaine);
71 71
 					});
72
+					selectSousDomaine.prop('disabled', false);
72 73
 				}
73 74
 				selectSousDomaine.parent().removeClass('content_load');
74 75
 			});
@@ -100,7 +101,7 @@ $(document).ready(function()
100 101
 			$("#training_categoryBuisness option:not([value=''])").remove();
101 102
 			
102 103
 			var selectSousDomaine = $("#training_categoryBuisnessDomain");
103
-			selectSousDomaine.parent().addClass('content_load');
104
+			selectSousDomaine.prop('disabled', 'disabled').parent().addClass('content_load');
104 105
 			getChildCategoryBuisness(idCategory, function(categories)
105 106
 			{
106 107
 				if (categories)
@@ -108,6 +109,7 @@ $(document).ready(function()
108 109
 					$.each(categories, function(id, categorie) {
109 110
 						$("<option>", {value:id, text:categorie}).appendTo(selectSousDomaine);
110 111
 					});
112
+					selectSousDomaine.prop('disabled', false);
111 113
 				}
112 114
 				selectSousDomaine.parent().removeClass('content_load');
113 115
 			});
@@ -137,7 +139,7 @@ $(document).ready(function()
137 139
 			$("#training_categoryBuisness option:not([value=''])").remove();
138 140
 
139 141
 			var selectSousDomaine = $("#training_categoryBuisness");
140
-			selectSousDomaine.parent().addClass('content_load');
142
+			selectSousDomaine.prop('disabled', 'disabled').parent().addClass('content_load');
141 143
 			getChildCategoryBuisness(idCategory, function(categories)
142 144
 			{
143 145
 				if (categories)
@@ -145,6 +147,7 @@ $(document).ready(function()
145 147
 					$.each(categories, function(id, categorie) {
146 148
 						$("<option>", {value:id, text:categorie}).appendTo(selectSousDomaine);
147 149
 					});
150
+					selectSousDomaine.prop('disabled', false);
148 151
 				}
149 152
 				selectSousDomaine.parent().removeClass('content_load');
150 153
 			});
@@ -228,7 +231,7 @@ $(document).ready(function()
228 231
 		// Mise en attente de chargement
229 232
 		$.each(inputsCategory, function(id, category) {
230 233
 			if (id) {
231
-				category.parent().addClass('content_load');
234
+				category.prop('disabled', 'disabled').parent().addClass('content_load');
232 235
 			}
233 236
 		});
234 237
 
@@ -275,17 +278,19 @@ $(document).ready(function()
275 278
 						$.each(categories, function(id, categorie) {
276 279
 							$("<option>", {value:id, text:categorie}).appendTo(inputsCategory[idArray+1]);
277 280
 						});
278
-						// Selectionner sa valeur
279
-						inputsCategory[idArray+1].val(categoriesParentsId[idArray+1]);
280 281
 
281 282
 						// Contenu chargé
282
-						inputsCategory[idArray+1].parent().removeClass('content_load');
283
+						inputsCategory[idArray+1].prop('disabled', false).parent().removeClass('content_load');
284
+
285
+						// Selectionner sa valeur
286
+						inputsCategory[idArray+1].val(categoriesParentsId[idArray+1]);
283 287
 					}
284 288
 				});
285 289
 			}
286 290
 		});
287 291
 	}
288 292
 
293
+
289 294
 	/**
290 295
 	 * Stock, de façon récursive, les id des parents de la catégory dans la table categoriesParentsId
291 296
 	 * @param {int} categoryId
@@ -315,6 +320,69 @@ $(document).ready(function()
315 320
 
316 321
 
317 322
 
323
+	/**********************************/
324
+	/************ Accroche ************/
325
+	/**********************************/
326
+
327
+	// Si l'accroche correspond au 170 premiers caractères de la description placé la valeur de l'accroche en placeholder
328
+	//var accrocheVal = $("#training_hook").val();
329
+	var descriptionVal = $("#training_description").val().substr(0, 170);
330
+
331
+	/*if (descriptionVal.indexOf(accrocheVal) === 0)
332
+	{
333
+		$("#training_hook").val(accrocheVal);
334
+	}*/
335
+
336
+	$("#training_description").on( 'change keyup paste cut', function (){
337
+		var value = $(this).val();
338
+		
339
+		if (descriptionVal == $("#training_hook").val()) {
340
+			$("#training_hook").val(value.substr(0, 170));
341
+		}
342
+
343
+		descriptionVal = value.substr(0, 170);
344
+	});
345
+
346
+	// Si l'accroche change et qu'elle est vide
347
+	$("#training_hook").on( 'change', function (){
348
+		if ($.trim($(this).val()) == '') {
349
+			$(this).val($("#training_description").val().substr(0, 170));
350
+		}
351
+	});
352
+
353
+
354
+
355
+
356
+
357
+
358
+	/**********************************/
359
+	/********* TYPE OPTIONNEL *********/
360
+	/**********************************/
361
+	$("input[name='training[optionnalType]'][value='NA'] + label").hide();
362
+	if ($("input[name='training[type]'][value='INTRA']:checked").length > 0) {
363
+		$("input[name='training[optionnalType]'][value='INTRA'] + label").hide().attr('disabled', false);
364
+	}
365
+	if ($("input[name='training[type]'][value='INTER']:checked").length > 0) {
366
+		$("input[name='training[optionnalType]'][value='INTER'] + label").hide().attr('disabled', false);
367
+	}
368
+	$("input[name='training[type]']").change(function(){
369
+		$("input[name='training[optionnalType]'][value='NA']").prop('checked', true);
370
+		if ($("input[name='training[type]'][value='INTRA']:checked").length > 0) {
371
+			$("input[name='training[optionnalType]'][value='INTRA'] + label").hide().attr('disabled', true);
372
+			$("input[name='training[optionnalType]'][value='INTER'] + label").show().attr('disabled', false);
373
+		}
374
+		if ($("input[name='training[type]'][value='INTER']:checked").length > 0) {
375
+			$("input[name='training[optionnalType]'][value='INTER'] + label").hide().attr('disabled', false);
376
+			$("input[name='training[optionnalType]'][value='INTRA'] + label").show().attr('disabled', true);
377
+		}
378
+	});
379
+
380
+
381
+
382
+
383
+
384
+
385
+
318 386
 
319 387
 
320 388
 
@@ -342,6 +410,7 @@ $(document).ready(function()
342 410
 	 */
343 411
 	function loadTagField(field)
344 412
 	{
413
+		field.addClass('d-none');
345 414
 		var datasField = $.parseJSON(field.val());
346 415
 		var nameField = field.attr("name");
347 416
 
@@ -350,10 +419,10 @@ $(document).ready(function()
350 419
 		if (typeof datasField["liste"] !== "undefined") {
351 420
 			// element liste
352 421
 			$.each(datasField["liste"], function(idElem, elem){
353
-				addElemList(listeContent, nameField, elem, true, field.attr('data-placeholder'), false);
422
+				addElemList(listeContent, field, nameField, elem, true, field.attr('placeholder'), false);
354 423
 			});
355 424
 		}
356
-		addElemList(listeContent, nameField, '', true, field.attr('data-placeholder'), false);
425
+		addElemList(listeContent, field, nameField, '', true, field.attr('placeholder'), false);
357 426
 	}
358 427
 
359 428
 	/**
@@ -363,8 +432,9 @@ $(document).ready(function()
363 432
 	 */
364 433
 	function loadComplexField(field)
365 434
 	{
366
-		var datasField = $.parseJSON(field.attr("data-value"));
367
-		var nameField = field.attr("data-name");
435
+		field.addClass('d-none');
436
+		var datasField = $.parseJSON(field.val());
437
+		var nameField = field.attr("name").replace("[", "_").replace("]", "");
368 438
 		if (typeof datasField === "undefined" || datasField == null) {
369 439
 			datasField = [];
370 440
 		}
@@ -373,7 +443,7 @@ $(document).ready(function()
373 443
 
374 444
 		// Description
375 445
 		if (typeof datasField["description"] !== "undefined") {
376
-			var desc = field.find("textarea[name='"+nameField+"[description]']");
446
+			var desc = $("textarea[name='"+nameField+"_description']");
377 447
 			if (desc.length) {
378 448
 				desc.text(datasField["description"]);
379 449
 			}
@@ -385,13 +455,13 @@ $(document).ready(function()
385 455
 				if (typeof liste["titre"] !== "undefined") {
386 456
 					titre = liste["titre"];
387 457
 				}
388
-				var listeContent = addList(listesContent, nameField, titre, parseInt(id), titreLabel, field.attr('data-placeholder'));
458
+				var listeContent = addList(listesContent, field, nameField, titre, parseInt(id), titreLabel, field.attr('placeholder'));
389 459
 
390 460
 				// element liste
391 461
 				$.each(liste["liste"], function(idElem, elem){
392
-					addElemList(listeContent, nameField+"[listes]["+id+"]", elem, false, field.attr('data-placeholder'), false);
462
+					addElemList(listeContent, field, nameField+"_listes_"+id+"", elem, false, field.attr('placeholder'), false);
393 463
 				});
394
-				addElemList(listeContent, nameField+"[listes]["+id+"]", '', false, field.attr('data-placeholder'), false);
464
+				addElemList(listeContent, field, nameField+"_listes_"+id+"", '', false, field.attr('placeholder'), false);
395 465
 			});
396 466
 		}
397 467
 	}
@@ -403,45 +473,58 @@ $(document).ready(function()
403 473
 	 */
404 474
 	function addComplexFiel(field)
405 475
 	{
406
-		var nameField = field.attr("data-name");
476
+		var nameField = field.attr("name").replace("[", "_").replace("]", "");
407 477
 		var descriptionLabel = field.attr("data-label-description");
408 478
 		var listesLabel = field.attr("data-label-listes");
409 479
 		var titreLabel = field.attr("data-label-titreliste");
410 480
 		var addListeLabel = field.attr("data-label-addliste");
411 481
 
412
-		var placeholder = field.attr("data-placeholder");
482
+		var placeholder = field.attr("placeholder");
483
+
484
+
485
+		// Listes
486
+		var contentComplexField = $("<div>", {
487
+			id: nameField+"_complex_field"
488
+		}).insertAfter(field);
413 489
 
414 490
 		// Description
415 491
 		$("<label>", {
416 492
 			text: descriptionLabel,
417
-			"for": nameField+"Description",
418
-			class: "like-label"
419
-		}).appendTo(field);
493
+			"for": nameField+"_description",
494
+			class: "like-label h5 sub-form-separator py-1 mb-2 d-block"
495
+		}).appendTo(contentComplexField);
496
+
420 497
 		$("<textarea>", {
421
-			id: nameField+"Description",
498
+			id: nameField+"_description",
422 499
 			class: "form-control",
423 500
 			type: "text",
424
-			name: nameField+"[description]",
501
+			name: nameField+"_description",
425 502
 			//"data-require_publie": 1
426
-		}).appendTo(field);
503
+		})
504
+		.appendTo(contentComplexField)
505
+		.on('change keyup paste cut', function(){
506
+			saveContent(field);
507
+		});
508
+
509
+
427 510
 		$("<div>",{
428 511
 			class:"invalid-feedback"
429
-		}).appendTo(field);
512
+		}).appendTo(contentComplexField);
430 513
 
431
-		$("<div>", {
432
-			html: "<h4>"+listesLabel+"</h4>",
433
-			"for": nameField+"Description",
434
-			class: "sub-form-separator d-flex border-bottom py-2 mb-3 mt-3"
435
-		}).appendTo(field);
514
+		$("<span>", {
515
+			html: listesLabel,
516
+			"for": nameField+"_description",
517
+			class: "sub-form-separator h5 py-1 mb-2 mt-3 d-block"
518
+		}).appendTo(contentComplexField);
436 519
 
437
-		// Listes
438 520
 		var listesAndButtonContent = $("<div>", {
439 521
 
440
-		}).appendTo(field);
522
+		}).appendTo(contentComplexField);
441 523
 
442 524
 
443
-		var listesContent = $("<div>", {
444 525
 
526
+		var listesContent = $("<div>", {
527
+			id: nameField+"_listes",
445 528
 		}).appendTo(listesAndButtonContent);
446 529
 
447 530
 		// Ajouter une liste
@@ -452,7 +535,7 @@ $(document).ready(function()
452 535
 		})
453 536
 		.appendTo(listesAndButtonContent)
454 537
 		.click(function(){
455
-			addList(listesContent, nameField, '', null, titreLabel, placeholder);
538
+			addList(listesContent, field, nameField, '', null, titreLabel, placeholder);
456 539
 		});
457 540
 
458 541
 		return listesContent;
@@ -466,7 +549,7 @@ $(document).ready(function()
466 549
 	 * @param listId L'id utilisé par la liste (pour évité d'écraser les précédentes)
467 550
 	 * @returns
468 551
 	 */
469
-	function addList(listesContent, nameField, value, listId, titreLabel, placeholder)
552
+	function addList(listesContent, field, nameField, value, listId, titreLabel, placeholder)
470 553
 	{
471 554
 		if (typeof value === "undefined" || value === null) { value = ""; }
472 555
 		if (typeof titreLabel === "undefined") { titreLabel = ""; }
@@ -484,29 +567,34 @@ $(document).ready(function()
484 567
 		}
485 568
 		nbListe++;
486 569
 
487
-		var nameFieldListe = nameField+"[listes]["+curListeId+"]";
570
+		var nameFieldListe = nameField+"_listes_"+curListeId+"";
488 571
 
489
-		var formGroup = $("<div>", {class:"form-group"}).appendTo(listesContent);
572
+		var newListeContent = $("<div>", {class:"new-liste-content", id:nameFieldListe}).appendTo(listesContent);
573
+		
574
+		var formGroup = $("<div>", {class:"form-group"}).appendTo(newListeContent);
490 575
 		// Titre
491 576
 		$("<label>", {
492 577
 			text: titreLabel,
493
-			"for": nameFieldListe+"[titre]",
578
+			"for": nameFieldListe+"_titre",
494 579
 			class: "like-label"
495 580
 		}).appendTo(formGroup);
496 581
 		let title = $("<input>", {
497
-			id: nameFieldListe+"[titre]",
582
+			id: nameFieldListe+"_titre",
498 583
 			class: "form-control ",
499 584
 			type: "text",
500
-			name: nameFieldListe+"[titre]",
585
+			name: nameFieldListe+"_titre",
501 586
 			value: value
502 587
 		});
503 588
 		title.appendTo(formGroup);
589
+		title.on('change keyup paste cut', function(){
590
+			saveContent(field);
591
+		});
504 592
 
505 593
 		// Liste
506
-		var formGroup = $("<div>", {class:"form-group"}).appendTo(listesContent);
594
+		var formGroup = $("<div>", {class:"form-group"}).appendTo(newListeContent);
507 595
 		var listeContent = $("<ul>", {class: "complex-field"}).appendTo(formGroup);
508 596
 
509
-		addElemList(listeContent, nameFieldListe, "", true, placeholder, false);
597
+		addElemList(listeContent, field, nameFieldListe, "", true, placeholder, false);
510 598
 
511 599
 		return listeContent;
512 600
 	}
@@ -522,7 +610,7 @@ $(document).ready(function()
522 610
 
523 611
 		// Liste
524 612
 		var listeContent = $("<ul>", {class: "tag-field"}).insertAfter(field).click(function(){
525
-			addElemList($(this), nameField, "", true, field.attr('placeholder'), true);
613
+			addElemList($(this), field, nameField, "", true, field.attr('placeholder'), true);
526 614
 		});
527 615
 
528 616
 		return listeContent;
@@ -538,7 +626,7 @@ $(document).ready(function()
538 626
 	 * @param focus Si l'élément doit prendre le focus après sont ajout
539 627
 	 * @returns
540 628
 	 */
541
-	function addElemList(listeContent, nameFieldListe, value, isTagInput, placeHolder, focus)
629
+	function addElemList(listeContent, field, nameFieldListe, value, isTagInput, placeHolder, focus)
542 630
 	{
543 631
 		// Test si les variables sont renseignées, sinon les init
544 632
 		if (typeof focus === "undefined") { focus = false; }
@@ -556,10 +644,8 @@ $(document).ready(function()
556 644
 		{
557 645
 			// Si on a un champ vide et qu'on tente d'ajouter un élément avec une valeur, utiliser le champ vide sinon créer le champ
558 646
 			var contentFields = placeolder;
559
-			var inputForm = contentFields.find("input");
560 647
 			var input = contentFields.find("span.input-list-elem");
561 648
 			contentFields.removeClass("list-placeholder");
562
-			inputForm.val(value);
563 649
 			input.text(value);
564 650
 		}
565 651
 		else
@@ -573,12 +659,6 @@ $(document).ready(function()
573 659
 			}
574 660
 
575 661
 			// Ajout du champs du formulaire qui contiendra le donnée à envoyer à l'envoi du formulaire
576
-			var inputForm = $("<input>", {
577
-				name: nameFieldListe+"[liste][]",
578
-				type: "hidden",
579
-				value: value
580
-			}).appendTo(contentFields).hide();
581
-
582 662
 			// Ajout du champ éditable et visible sur le formulaire
583 663
 			var input = $("<span>", {
584 664
 				class: "input-list-elem",
@@ -594,12 +674,16 @@ $(document).ready(function()
594 674
 		enableElementList(listeContent.find(".js_list_element_content:not(.edit-enable)"), false);
595 675
 
596 676
 		// Ajout du bouton de suppression suppression
597
-		var buttonDelete = $("<span>", {class: "list-delete"}).appendTo(contentFields);
677
+		var buttonDelete = contentFields.find(".list-delete");
678
+		if (buttonDelete.length == 0)
679
+		{
680
+			buttonDelete = $("<span>", {class: "list-delete"}).appendTo(contentFields);
681
+			// L'icone croix du bouton de suppression
682
+			$("<i>", {class:"ion-android-close"}).appendTo(buttonDelete).click(function( event ) {
683
+				contentFields.remove();
684
+			});
685
+		}
598 686
 
599
-		// L'icone croix du bouton de suppression
600
-		$("<i>", {class:"ion-android-close px-1 ml-1 border-left"}).appendTo(buttonDelete).click(function( event ) {
601
-			contentFields.remove();
602
-		});
603 687
 
604 688
 		/*if (!isTagInput) {
605 689
 			buttonDelete.addClass('d-inline-block position-absolute').css({top:0, right:0});
@@ -618,7 +702,7 @@ $(document).ready(function()
618 702
 				event.preventDefault();
619 703
 				// Si le champs n'est pas vide, ajouter un nouveau champ
620 704
 				if ( $(this).text() != "" ) {
621
-					addElemList(listeContent, nameFieldListe, "", isTagInput, placeHolder, true);
705
+					addElemList(listeContent, field, nameFieldListe, "", isTagInput, placeHolder, true);
622 706
 				}
623 707
 				return false;
624 708
 			}
@@ -644,7 +728,7 @@ $(document).ready(function()
644 728
 				if (contentFields.is(':last-child'))  {
645 729
 					contentFields.removeClass("list-placeholder");
646 730
 					if (!listeContent.find("list-placeholder").length) {
647
-						addElemList(listeContent, nameFieldListe, "", isTagInput, placeHolder);
731
+						addElemList(listeContent, field, nameFieldListe, "", isTagInput, placeHolder);
648 732
 					}
649 733
 				}
650 734
 
@@ -675,19 +759,15 @@ $(document).ready(function()
675 759
 		    //$(this).text($(this).text()+text);
676 760
 		    document.execCommand("insertHTML", false, text);
677 761
 
678
-			inputForm.val(input.text());
762
+			saveContent(field);
679 763
 		});
680 764
 
681 765
 		// Lors d'un changement de l'input visible, mettre à jour la valeur dans l'input qui sera envoyer par le form
682 766
 		input.on( 'change keyup paste cut', function (){
683
-			var value = input.text();
684
-			inputForm.val(value.trim());
685
-			saveContent(listeContent);
767
+			saveContent(field);
686 768
 		});
687 769
 		input.on( 'focusout', function (){
688
-			var value = input.text();
689
-			input.text(value.trim());
690
-			saveContent(listeContent);
770
+			saveContent(field);
691 771
 		});
692 772
 
693 773
 		// Edition au click
@@ -702,14 +782,47 @@ $(document).ready(function()
702 782
 		return input;
703 783
 	}
704 784
 
705
-	function saveContent(listeContent)
785
+	function saveContent(formInput)
706 786
 	{
707
-		var elements = listeContent.find(".input-list-elem");
708
-		var result = [];
709
-		elements.each(function(index){
710
-			result.push($(this).text());
711
-		});
712
-		console.log(result);
787
+		if (formInput.hasClass("js_complex_field"))
788
+		{
789
+			var nameField = formInput.attr("name").replace("[", "_").replace("]", "");
790
+			var contentComplexField = $('#'+nameField+'_complex_field');
791
+			var description = $('#'+nameField+'_description').val();
792
+			var listes = contentComplexField.find('.new-liste-content');
793
+
794
+			var result = {
795
+				description: description,
796
+				listes:[]
797
+			};
798
+
799
+			listes.each(function(index){
800
+				var listeDatas = {titre:'', liste:[]};
801
+				listeDatas.titre = $('#'+$(this).attr('id')+"_titre").val();
802
+				var elements = $(this).find(".input-list-elem");
803
+
804
+				elements.each(function(index){
805
+					if ($(this).text() != '') {
806
+						listeDatas.liste.push($(this).text().trim());
807
+					}
808
+				});
809
+				result.listes.push(listeDatas);
810
+			});
811
+
812
+			formInput.val(JSON.stringify(result));
813
+		}
814
+		else
815
+		{
816
+			var listeContent = formInput.next(".tag-field");
817
+			var elements = listeContent.find(".input-list-elem");
818
+			var result = {liste:[]};
819
+			elements.each(function(index){
820
+				if ($(this).text() != '') {
821
+					result.liste.push($(this).text().trim());
822
+				}
823
+			});
824
+			formInput.val(JSON.stringify(result));
825
+		}
713 826
 	}
714 827
 
715 828
 	/**

+ 160
- 71
assets/shared/build/scss/bootstrap/extended/form.scss View File

@@ -289,11 +289,11 @@ form .form-text {
289 289
 	margin-top: 4px;
290 290
 	width: 100%;
291 291
 
292
-	@include media-breakpoint-up("lg") {
292
+	/*@include media-breakpoint-up("lg") {
293 293
 		& {
294 294
 			width: 50%;
295 295
 		}
296
-	}
296
+	}*/
297 297
 }
298 298
 
299 299
 /* Champ en attente de chargement */
@@ -320,6 +320,16 @@ form .form-text {
320 320
 	}
321 321
 }
322 322
 
323
+  
324
+
325
+/* Style spécifique pour le formulaire de formation */
326
+.content_load #training_categoryDomain,
327
+.content_load #training_categorySubDomain,
328
+.content_load #training_categoryBuisnessDomain,
329
+.content_load #training_categoryBuisness {
330
+	display: inline-block;
331
+	width: calc( 100% - 30px );
332
+}
323 333
 
324 334
 
325 335
 /* Style spécifique pour le formulaire des demandes pour rejoindre une entreprise */
@@ -421,99 +431,178 @@ form .form-text {
421 431
 
422 432
 
423 433
 
424
-.custom-checkbox {
425
-	label {
426
-		position: relative;
427
-		margin-bottom: 0;
428
-	  
429
-		// Background-color and (when enabled) gradient
430
-		&::before {
431
-		  position: absolute;
432
-		  top: (($font-size-base * $line-height-base - $custom-control-indicator-size) / 2);
433
-		  left: -$custom-control-gutter;
434
-		  display: block;
435
-		  width: $custom-control-indicator-size;
436
-		  height: $custom-control-indicator-size;
437
-		  pointer-events: none;
438
-		  content: "";
439
-		  user-select: none;
440
-		  background-color: $custom-control-indicator-bg;
441
-		  @include box-shadow($custom-control-indicator-box-shadow);
442
-		}
443
-	  
444
-		// Foreground (icon)
445
-		&::after {
446
-		  position: absolute;
447
-		  top: (($font-size-base * $line-height-base - $custom-control-indicator-size) / 2);
448
-		  left: -$custom-control-gutter;
449
-		  display: block;
450
-		  width: $custom-control-indicator-size;
451
-		  height: $custom-control-indicator-size;
452
-		  content: "";
453
-		  background-repeat: no-repeat;
454
-		  background-position: center center;
455
-		  background-size: $custom-control-indicator-bg-size;
456
-		}
457
-	  }
458
-
459
-	label::before {
460
-	  @include border-radius($custom-checkbox-indicator-border-radius);
434
+.custom-control-input + label {
435
+	position: relative;
436
+	margin-bottom: 0;
437
+	margin-left: $custom-control-gutter;
438
+	margin-right: $custom-control-gutter / 2;
439
+	display: block;
440
+	
441
+	// Background-color and (when enabled) gradient
442
+	&::before {
443
+		position: absolute;
444
+		top: (($font-size-base * $line-height-base - $custom-control-indicator-size) / 2);
445
+		left: -$custom-control-gutter;
446
+		display: block;
447
+		width: $custom-control-indicator-size;
448
+		height: $custom-control-indicator-size;
449
+		pointer-events: none;
450
+		content: "";
451
+		user-select: none;
452
+		background-color: $custom-control-indicator-bg;
453
+		@include box-shadow($custom-control-indicator-box-shadow);
454
+		@include border-radius($custom-checkbox-indicator-border-radius);
461 455
 	}
456
+	
457
+	// Foreground (icon)
458
+	&::after {
459
+		position: absolute;
460
+		top: (($font-size-base * $line-height-base - $custom-control-indicator-size) / 2);
461
+		left: -$custom-control-gutter;
462
+		display: block;
463
+		width: $custom-control-indicator-size;
464
+		height: $custom-control-indicator-size;
465
+		content: "";
466
+		background-repeat: no-repeat;
467
+		background-position: center center;
468
+		background-size: $custom-control-indicator-bg-size;
469
+	}
470
+}
471
+input[type="radio"].custom-control-input + label {
472
+	display: block;
473
+	// Background-color and (when enabled) gradient
474
+	&::before {
475
+		@include border-radius(50%);
476
+	}
477
+}
462 478
   
463
-	.custom-control-input:checked + label {
464
-	  &::before {
479
+.custom-control-input:checked + label {
480
+	&::before {
465 481
 		@include gradient-bg($custom-control-indicator-checked-bg);
466
-	  }
467
-	  &::after {
482
+	}
483
+	&::after {
468 484
 		background-image: $custom-checkbox-indicator-icon-checked;
469
-	  }
470 485
 	}
486
+}
487
+input[type="radio"].custom-control-input:checked + label {
488
+	// Background-color and (when enabled) gradient
489
+	&::after {
490
+		background-image: none;
491
+		background-color: white;
492
+		@include border-radius(50%);
493
+		width: $custom-control-indicator-size - 0.6rem;
494
+		height: $custom-control-indicator-size - 0.6rem;
495
+
496
+		top: 0.55rem;
497
+		left: -$custom-control-gutter + ($custom-control-indicator-size - 0.70rem);
498
+	}
499
+}
471 500
   
472
-	.custom-control-input:indeterminate + label {
473
-	  &::before {
501
+.custom-control-input:indeterminate + label {
502
+	&::before {
474 503
 		@include gradient-bg($custom-checkbox-indicator-indeterminate-bg);
475 504
 		@include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow);
476
-	  }
477
-	  &::after {
505
+	}
506
+	&::after {
478 507
 		background-image: $custom-checkbox-indicator-icon-indeterminate;
479
-	  }
480 508
 	}
509
+}
481 510
   
482
-	.custom-control-input:disabled {
483
-	  &:checked + label::before {
511
+.custom-control-input:disabled {
512
+	&:checked + label::before {
484 513
 		background-color: $custom-control-indicator-checked-disabled-bg;
485
-	  }
486
-	  &:indeterminate + label::before {
514
+	}
515
+	&:indeterminate + label::before {
487 516
 		background-color: $custom-control-indicator-checked-disabled-bg;
488
-	  }
489 517
 	}
490
-  }
518
+}
491 519
   
492
-  .custom-control-input {
520
+.custom-control-input {
493 521
 	&:checked + label::before {
494
-	  color: $custom-control-indicator-checked-color;
495
-	  @include gradient-bg($custom-control-indicator-checked-bg);
496
-	  @include box-shadow($custom-control-indicator-checked-box-shadow);
522
+		color: $custom-control-indicator-checked-color;
523
+		@include gradient-bg($custom-control-indicator-checked-bg);
524
+		@include box-shadow($custom-control-indicator-checked-box-shadow);
497 525
 	}
498
-  
526
+
499 527
 	&:focus + label::before {
500
-	  // the mixin is not used here to make sure there is feedback
501
-	  box-shadow: $custom-control-indicator-focus-box-shadow;
528
+		// the mixin is not used here to make sure there is feedback
529
+		box-shadow: $custom-control-indicator-focus-box-shadow;
502 530
 	}
503
-  
531
+
504 532
 	&:active + label::before {
505
-	  color: $custom-control-indicator-active-color;
506
-	  background-color: $custom-control-indicator-active-bg;
507
-	  @include box-shadow($custom-control-indicator-active-box-shadow);
533
+		color: $custom-control-indicator-active-color;
534
+		background-color: $custom-control-indicator-active-bg;
535
+		@include box-shadow($custom-control-indicator-active-box-shadow);
508 536
 	}
509
-  
537
+
510 538
 	&:disabled {
511
-	  + label {
539
+		+ label {
512 540
 		color: $custom-control-label-disabled-color;
513
-  
541
+
514 542
 		&::before {
515
-		  background-color: $custom-control-indicator-disabled-bg;
543
+			background-color: $custom-control-indicator-disabled-bg;
516 544
 		}
517
-	  }
545
+		}
546
+	}
547
+}
548
+
549
+
550
+.form-captain  {
551
+	select {
552
+		@extend .form-control;
518 553
 	}
554
+	textarea {
555
+		@extend .form-control;
556
+	}
557
+	input[type="checkbox"] {
558
+		@extend .custom-control-input;
559
+	}
560
+	input[type="radio"] {
561
+		@extend .custom-control-input;
562
+	}
563
+  }
564
+
565
+  .cpt-duration {
566
+	  border: 1px solid $gray-400;
567
+	  @include border-radius(5px);
568
+	  height: 40px;
569
+	  overflow: hidden;
570
+
571
+	  div {
572
+		display: inline-block;
573
+		width: 50%;
574
+		
575
+		input {
576
+			@include border-radius(5px 0px 0px 5px);
577
+			display: inline-block;
578
+			width: calc(100% - 40px);
579
+			border: none;
580
+		}
581
+		&:after {
582
+			@include border-radius(0px 5px 5px 0px);
583
+			display: inline-block;
584
+			content: "min";
585
+			width: 40px;
586
+			text-align: center;
587
+			color: $gray-700;
588
+			background-color: $gray-200;
589
+			height: 100%;
590
+			line-height: 38px;
591
+		}
592
+
593
+		&:first-child {
594
+			input {
595
+				width: calc(100% - 30px);
596
+			}
597
+			&:after {
598
+				@include border-radius(0px);
599
+				content: "h";
600
+				width: 30px;
601
+			}
602
+		}
603
+
604
+			label {
605
+				display: none;
606
+			}
607
+	  }
519 608
   }

+ 1
- 1
assets/shared/build/scss/settings.scss View File

@@ -48,7 +48,7 @@ $body-color: $black;
48 48
 $theme-colors: (
49 49
     "primary": $red-captain,
50 50
     "secondary": #fff,
51
-    "light":#fff,
51
+    "light":#F5F5F5,
52 52
     "info":lighten($red-captain,20%),
53 53
     "dark": #424242,
54 54
     "danger":   #FC523F,

+ 47
- 21
assets/shared/build/scss/temp.scss View File

@@ -21,6 +21,8 @@ tr[data-toggle-up]
21 21
 
22 22
 .complex-field {
23 23
 	min-height: 1rem;
24
+	padding-left: 0;
25
+
24 26
 }
25 27
 
26 28
 .complex-field .complex-field li
@@ -61,6 +63,8 @@ tr[data-toggle-up]
61 63
 
62 64
 	/* .form-control */
63 65
 	padding: 0.375rem 0.75rem;
66
+	padding-bottom: 0rem;
67
+
64 68
 	font-size: 0.875rem;
65 69
 	line-height: 1.5;
66 70
 	color: #b5b5b5;
@@ -76,35 +80,28 @@ tr[data-toggle-up]
76 80
 {
77 81
 	/* .badge-secondary */
78 82
     color: rgba(0, 0, 0, 1);
79
-    background-color: rgba(17, 17, 17, 0.05);
80
-    border: none;
81
-
83
+    //background-color: rgba(17, 17, 17, 0.05);
82 84
 
83 85
 	/* .p-2 */
84
-    padding: 0.5rem !important;
86
+    padding: 0.4rem !important;
87
+    padding-left: 0.8rem !important;
85 88
     /* .mb-2 */
86
-    margin-bottom: 0.5rem !important;
89
+    margin-bottom: 0.4rem !important;
87 90
     /* .mr-2 */
88 91
 	margin-right: 0.5rem !important;
89 92
 	/* .position-relative */
90 93
     position: relative !important;
91 94
 
92
-    /* .justify-content-center */
93
-    -webkit-justify-content: center !important;
94
-    -ms-flex-pack: center !important;
95
-    justify-content: center !important;
96
-
97 95
     /* .d-flex */
98 96
     display: -webkit-flex !important;
99 97
     display: -ms-flexbox !important;
100 98
     display: flex !important;
101 99
 
102 100
     /* .badge */
103
-    line-height: 1;
104 101
     text-align: center;
105
-    white-space: nowrap;
102
+    //white-space: nowrap;
106 103
     vertical-align: baseline;
107
-    border-radius: 0.25rem;
104
+    border-radius: 20px;
108 105
 }
109 106
 
110 107
 .tag-field li.list-placeholder
@@ -131,8 +128,9 @@ tr[data-toggle-up]
131 128
 }
132 129
 .complex-field li .input-list-elem
133 130
 {
134
-	display: block;
131
+	display: inherit;
135 132
 	width: 90%;
133
+	min-height: 38px;
136 134
 
137 135
 	padding: 0.375rem 0.75rem;
138 136
 	padding-right: 0.75rem;
@@ -157,17 +155,42 @@ tr[data-toggle-up]
157 155
     display: -ms-flexbox !important;
158 156
     display: flex !important;
159 157
 
158
+	position: absolute;
159
+	background-color: RGBA(0,0,0, 0.3);
160
+	height: 20px;
161
+	width: 20px;
162
+	border-radius: 50%;
163
+	right: -19px;
164
+	top: 6px;
165
+
166
+	color: white;
167
+	cursor: pointer;
168
+
169
+	opacity: 0.5;
170
+
171
+	transition: opacity 0.5s;
172
+
173
+	i {
174
+		width: 100%;
175
+		height: 100%;
176
+		padding: 3px;
177
+	}
160 178
 }
161 179
 
180
+.complex-field li .list-delete:hover,
181
+.tag-field li .list-delete:hover {
182
+	opacity: 1;
183
+}
162 184
 
163 185
 .complex-field li
164 186
 {
165 187
 	position: relative;
166
-	padding-right: 1.5rem;
188
+	padding-right: 1rem;
167 189
 
168 190
 	margin-top: 0.5rem;
169 191
 	font-size: 0.875rem;
170 192
 	line-height: 1.5;
193
+	min-height: 38px;
171 194
 	background-color: #fff;
172 195
 	background-clip: padding-box;
173 196
 	border: 1px solid lightgray;
@@ -177,9 +200,12 @@ tr[data-toggle-up]
177 200
 .complex-field li .list-delete
178 201
 {
179 202
 	position: absolute;
180
-	top: 0;
181
-	right: 0;
182
-	padding: 0.375rem 0rem;
203
+	top: 5;
204
+	right: 5;
205
+
206
+	i {
207
+		padding: 4px 6px;
208
+	}
183 209
 }
184 210
 
185 211
 .complex-field li.list-placeholder .list-delete,
@@ -193,15 +219,15 @@ tr[data-toggle-up]
193 219
 .tag-field li span {
194 220
 	min-height: calc( 14px*0.75 );
195 221
 	/*line-height: calc(14px*0.75);*/
196
-	line-height: 1;
222
+	margin-right: 25px;
197 223
 }
198 224
 
199 225
 
200 226
 .sub-form-separator {
201
-	margin-left: 5rem;
227
+	margin-left: 0rem;
202 228
 }
203 229
 .sub-form-separator + div {
204
-	margin-left: 5rem;
230
+	margin-left: 0rem;
205 231
 }
206 232
 
207 233
 

+ 61
- 29
assets/shared/build/scss/theme/base/nav-space.scss View File

@@ -109,6 +109,14 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
109 109
 	color: $space-user-main-color;
110 110
 }
111 111
 
112
+.tag-field li {
113
+	border: 2px solid rgba($space-user-main-color, 0.5);
114
+}
115
+.complex-field li .list-delete,
116
+.tag-field li .list-delete {
117
+	background-color: rgba($space-user-main-color, 0.5);
118
+}
119
+
112 120
 
113 121
 .space-of {
114 122
 	.page-link:hover,
@@ -122,16 +130,13 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
122 130
 		border-color: $space-of-main-color;
123 131
 	}
124 132
 
125
-	.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
133
+	.custom-control-input:checked + label::before {
126 134
 	    background-color: $space-of-main-color;
127 135
 	}
128
-	.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
129
-	    background-color: $space-of-main-color;
130
-	}
131
-	.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before {
136
+	.custom-control-input:disabled:checked + label::before {
132 137
 	    background-color: rgba($space-of-main-color, 0.5);
133 138
 	}
134
-	.custom-radio .custom-control-input:checked ~ .custom-control-label::before {
139
+	.custom-control-input:checked + label::before {
135 140
 	    background-color: $space-of-main-color;
136 141
 	}
137 142
 
@@ -140,10 +145,10 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
140 145
 		background-color: $space-of-main-color;
141 146
 	}
142 147
 
143
-  a,
148
+	a,
144 149
 	.btn-link {
145
-  	color: $space-of-main-color;
146
-  }
150
+	color: $space-of-main-color;
151
+	}
147 152
 
148 153
 	.btn-primary:not(:disabled):not(.disabled):active,
149 154
 	.btn-primary:not(:disabled):not(.disabled).active,
@@ -164,11 +169,14 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
164 169
 	.dropdown-item:active {
165 170
 		background-color: $space-of-main-color;
166 171
 	}
167
-
168
-	.custom-checkbox .custom-control-input.disabled-visible:disabled:checked ~ .custom-control-label::before {
172
+	
173
+	.custom-control-input:indeterminate + label::before {
174
+ 		background-color: rgba($space-of-main-color,0.5);
175
+	}
176
+	.custom-control-input.disabled-visible:disabled:checked + label::before {
169 177
  		background-color: rgba($space-of-main-color,0.8);
170 178
 	}
171
-	.custom-checkbox .custom-control-input.disabled-visible:disabled + label
179
+	.custom-control-input.disabled-visible:disabled + label
172 180
 	{
173 181
 		color: rgba($black,0.8);
174 182
 	}
@@ -211,6 +219,14 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
211 219
 			}
212 220
 		}
213 221
 	}
222
+	
223
+	.tag-field li {
224
+		border: 2px solid rgba($space-of-main-color, 0.5);
225
+	}
226
+	.complex-field li .list-delete,
227
+	.tag-field li .list-delete {
228
+		background-color: rgba($space-of-main-color, 0.5);
229
+	}
214 230
 }
215 231
 
216 232
 
@@ -228,25 +244,22 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
228 244
 		border-color: $space-society-main-color;
229 245
 	}
230 246
 
231
-	.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
247
+	.custom-control-input:checked + label::before {
232 248
 	    background-color: $space-society-main-color;
233 249
 	}
234
-	.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before {
250
+	.custom-control-input:disabled:checked + label::before {
235 251
 	    background-color: rgba($space-society-main-color, 0.5);
236 252
 	}
237
-	.custom-radio .custom-control-input:checked ~ .custom-control-label::before {
238
-	    background-color: $space-of-main-color;
239
-	}
240 253
 
241 254
 	.nave-space-background,
242 255
 	.nave-space {
243 256
 		background-color: $space-society-main-color;
244 257
 	}
245 258
 
246
-  a,
247
-	.btn-link {
248
-  	color: $space-society-main-color;
249
-  }
259
+	a,
260
+		.btn-link {
261
+		color: $space-society-main-color;
262
+	}
250 263
 
251 264
 	.btn-primary:not(:disabled):not(.disabled):active,
252 265
 	.btn-primary:not(:disabled):not(.disabled).active,
@@ -268,10 +281,13 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
268 281
 		background-color: $space-society-main-color;
269 282
 	}
270 283
 
271
-	.custom-checkbox .custom-control-input.disabled-visible:disabled:checked ~ .custom-control-label::before {
284
+	.custom-control-input:indeterminate + label::before {
285
+		background-color: rgba($space-society-main-color,0.5);
286
+  	 }
287
+	.custom-control-input.disabled-visible:disabled:checked + label::before {
272 288
  		background-color: rgba($space-society-main-color,0.6);
273 289
 	}
274
-	.custom-checkbox .custom-control-input.disabled-visible:disabled + label
290
+	.custom-control-input.disabled-visible:disabled + label
275 291
 	{
276 292
 		color: rgba($black,0.6);
277 293
 	}
@@ -316,6 +332,14 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
316 332
 			}
317 333
 		}
318 334
 	}
335
+	
336
+	.tag-field li {
337
+		border: 2px solid rgba($space-society-main-color, 0.5);
338
+	}
339
+	.complex-field li .list-delete,
340
+	.tag-field li .list-delete {
341
+		background-color: rgba($space-society-main-color, 0.5);
342
+	}
319 343
 }
320 344
 
321 345
 .no-space {
@@ -330,14 +354,19 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
330 354
 		border-color: theme-color("primary");
331 355
 	}
332 356
 
333
-	.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
357
+	.custom-control-input:checked + label::before {
334 358
 	    background-color: theme-color("primary");
335 359
 	}
336
-	.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before {
360
+	.custom-control-input:disabled:checked + label::before {
337 361
 	    background-color: rgba(theme-color("primary"), 0.5);
338 362
 	}
339
-	.custom-radio .custom-control-input:checked ~ .custom-control-label::before {
340
-	    background-color: theme-color("primary");
363
+	
364
+	.tag-field li {
365
+		border: 2px solid rgba(theme-color("primary"), 0.5);
366
+	}
367
+	.complex-field li .list-delete,
368
+	.tag-field li .list-delete {
369
+		background-color: rgba(theme-color("primary"), 0.5);
341 370
 	}
342 371
 
343 372
   a,
@@ -345,10 +374,13 @@ $space-society-main-color-light: lighten($space-society-main-color,5%);
345 374
   	color: theme-color("primary");
346 375
   }
347 376
 
348
-  .custom-checkbox .custom-control-input.disabled-visible:disabled:checked ~ .custom-control-label::before {
377
+  .custom-control-input:indeterminate + label::before {
378
+	background-color: rgba(theme-color("primary"),0.5);
379
+   }
380
+  .custom-control-input.disabled-visible:disabled:checked + label::before {
349 381
  		background-color: theme-color("primary");
350 382
 	}
351
-	.custom-checkbox .custom-control-input.disabled-visible:disabled + label
383
+	.custom-control-input.disabled-visible:disabled + label
352 384
 	{
353 385
 		color: $black;
354 386
 	}

+ 8
- 0
config/services.yaml View File

@@ -58,3 +58,11 @@ services:
58 58
 #===============================================================================
59 59
   Logipro\CaptainLearning\Service\FileUploader:
60 60
     arguments: ['@service_container']
61
+
62
+
63
+
64
+#===============================================================================
65
+# Form type.
66
+#===============================================================================
67
+  Logipro\CaptainLearning\Form\Seller\TrainingType:
68
+    arguments: ["@service_container"]

+ 2
- 2
public/build/manifest.json View File

@@ -12,7 +12,7 @@
12 12
   "build/individual.company.list.js": "http://localhost:3000/CaptainLearning/build/individual.company.list.js",
13 13
   "build/manifest.js": "http://localhost:3000/CaptainLearning/build/manifest.js",
14 14
   "build/images/billetsNoir.svg": "http://localhost:3000/CaptainLearning/build/images/billetsNoir.514fdca3.svg",
15
-  "build/fonts/ionicons.eot?v=2.0.0": "http://localhost:3000/CaptainLearning/build/fonts/ionicons.2c2ae068.eot",
15
+  "build/images/ionicons.svg?v=2.0.0": "http://localhost:3000/CaptainLearning/build/images/ionicons.621bd386.svg",
16 16
   "build/fonts/ionicons.ttf?v=2.0.0": "http://localhost:3000/CaptainLearning/build/fonts/ionicons.24712f6c.ttf",
17 17
   "build/fonts/ionicons.woff?v=2.0.0": "http://localhost:3000/CaptainLearning/build/fonts/ionicons.05acfdb5.woff",
18 18
   "build/images/apple-touch-icon.png": "http://localhost:3000/CaptainLearning/build/images/apple-touch-icon.b4c8c50b.png",
@@ -63,7 +63,7 @@
63 63
   "build/images/add_souhait.svg": "http://localhost:3000/CaptainLearning/build/images/add_souhait.935a729a.svg",
64 64
   "build/images/add_souhait_maincolor.svg": "http://localhost:3000/CaptainLearning/build/images/add_souhait_maincolor.2ebb95d1.svg",
65 65
   "build/images/billets.svg": "http://localhost:3000/CaptainLearning/build/images/billets.847328cb.svg",
66
-  "build/images/ionicons.svg?v=2.0.0": "http://localhost:3000/CaptainLearning/build/images/ionicons.621bd386.svg",
66
+  "build/fonts/ionicons.eot?v=2.0.0": "http://localhost:3000/CaptainLearning/build/fonts/ionicons.2c2ae068.eot",
67 67
   "build/images/close.svg": "http://localhost:3000/CaptainLearning/build/images/close.14776e9e.svg",
68 68
   "build/images/close_hover.svg": "http://localhost:3000/CaptainLearning/build/images/close_hover.a2e05323.svg",
69 69
   "build/images/cpf.svg": "http://localhost:3000/CaptainLearning/build/images/cpf.b6dfda1d.svg",

+ 1
- 1
src/CaptainLearning/Entity/Common/AbstractUploadableEntity.php View File

@@ -2,7 +2,7 @@
2 2
 namespace Logipro\CaptainLearning\Entity\Common;
3 3
 
4 4
 abstract class AbstractUploadableEntity extends AbstractEntity
5
-implements \Serializable
5
+
6 6
 {
7 7
 	protected static function convertToByte($size)
8 8
 	{

+ 0
- 40
src/CaptainLearning/Entity/Company/Company.php View File

@@ -595,45 +595,5 @@ class Company extends AbstractUploadableEntity
595 595
 			'image/gif'
596 596
 		);
597 597
 	}
598
-
599
-	public function serialize()
600
-	{
601
-		return serialize(array(
602
-			$this->companyId,
603
-			$this->name,
604
-			$this->siret,
605
-			$this->address,
606
-			$this->postal_code,
607
-			$this->city,
608
-			$this->email,
609
-			$this->phone,
610
-			$this->stripe_customer_id,
611
-			$this->submit_tva,
612
-			$this->intra_community_tva,
613
-			$this->created_at,
614
-			$this->type,
615
-			$this->salaried_number
616
-		));
617
-	}
618
-
619
-	public function unserialize($serialized)
620
-	{
621
-		list(
622
-			$this->companyId,
623
-			$this->name,
624
-			$this->siret,
625
-			$this->address,
626
-			$this->postal_code,
627
-			$this->city,
628
-			$this->email,
629
-			$this->phone,
630
-			$this->stripe_customer_id,
631
-			$this->submit_tva,
632
-			$this->intra_community_tva,
633
-			$this->created_at,
634
-			$this->type,
635
-			$this->salaried_number
636
-			) = unserialize($serialized);
637
-	}
638 598
 }
639 599
 ?>

+ 120
- 0
src/CaptainLearning/Entity/Training/Training.php View File

@@ -1159,5 +1159,125 @@ class Training extends AbstractEntity
1159 1159
 
1160 1160
         return $this;
1161 1161
     }
1162
+
1163
+    /**
1164
+     * Get the value of pictureOne
1165
+     */ 
1166
+    public function getPictureOne()
1167
+    {
1168
+        return $this->pictureOne;
1169
+    }
1170
+
1171
+    /**
1172
+     * Set the value of pictureOne
1173
+     *
1174
+     * @return  self
1175
+     */ 
1176
+    public function setPictureOne($pictureOne)
1177
+    {
1178
+        $this->pictureOne = $pictureOne;
1179
+
1180
+        return $this;
1181
+    }
1182
+
1183
+    /**
1184
+     * Get the value of pictureTwo
1185
+     */ 
1186
+    public function getPictureTwo()
1187
+    {
1188
+        return $this->pictureTwo;
1189
+    }
1190
+
1191
+    /**
1192
+     * Set the value of pictureTwo
1193
+     *
1194
+     * @return  self
1195
+     */ 
1196
+    public function setPictureTwo($pictureTwo)
1197
+    {
1198
+        $this->pictureTwo = $pictureTwo;
1199
+
1200
+        return $this;
1201
+    }
1202
+
1203
+    /**
1204
+     * Get the value of pictureTree
1205
+     */ 
1206
+    public function getPictureTree()
1207
+    {
1208
+        return $this->pictureTree;
1209
+    }
1210
+
1211
+    /**
1212
+     * Set the value of pictureTree
1213
+     *
1214
+     * @return  self
1215
+     */ 
1216
+    public function setPictureTree($pictureTree)
1217
+    {
1218
+        $this->pictureTree = $pictureTree;
1219
+
1220
+        return $this;
1221
+    }
1222
+
1223
+    /**
1224
+     * Get the value of pictureFour
1225
+     */ 
1226
+    public function getPictureFour()
1227
+    {
1228
+        return $this->pictureFour;
1229
+    }
1230
+
1231
+    /**
1232
+     * Set the value of pictureFour
1233
+     *
1234
+     * @return  self
1235
+     */ 
1236
+    public function setPictureFour($pictureFour)
1237
+    {
1238
+        $this->pictureFour = $pictureFour;
1239
+
1240
+        return $this;
1241
+    }
1242
+
1243
+    /**
1244
+     * Get the value of pictureFive
1245
+     */ 
1246
+    public function getPictureFive()
1247
+    {
1248
+        return $this->pictureFive;
1249
+    }
1250
+
1251
+    /**
1252
+     * Set the value of pictureFive
1253
+     *
1254
+     * @return  self
1255
+     */ 
1256
+    public function setPictureFive($pictureFive)
1257
+    {
1258
+        $this->pictureFive = $pictureFive;
1259
+
1260
+        return $this;
1261
+    }
1262
+
1263
+    /**
1264
+     * Get the value of cover
1265
+     */ 
1266
+    public function getCover()
1267
+    {
1268
+        return $this->cover;
1269
+    }
1270
+
1271
+    /**
1272
+     * Set the value of cover
1273
+     *
1274
+     * @return  self
1275
+     */ 
1276
+    public function setCover($cover)
1277
+    {
1278
+        $this->cover = $cover;
1279
+
1280
+        return $this;
1281
+    }
1162 1282
 }
1163 1283
 ?>

+ 4
- 4
src/CaptainLearning/Entity/Type/EnumTrainingCertificationType.php View File

@@ -40,10 +40,10 @@ class EnumTrainingCertificationType extends StringType
40 40
 	public static function getFormChoices()
41 41
 	{
42 42
 		return array(
43
-			'CERTIFICATION_NONE' => self::CERTIFICATION_NONE,
44
-			'CERTIFICATION_CERTIFYING' => self::CERTIFICATION_CERTIFYING,
45
-			'CERTIFICATION_DIPLOMA' => self::CERTIFICATION_DIPLOMA,
46
-			'CERTIFICATION_QUALIFYING' => self::CERTIFICATION_QUALIFYING
43
+			'enum_training_certification_none' => self::CERTIFICATION_NONE,
44
+			'enum_training_certification_certifying' => self::CERTIFICATION_CERTIFYING,
45
+			'enum_training_certification_diploma' => self::CERTIFICATION_DIPLOMA,
46
+			'enum_training_certification_qualifying' => self::CERTIFICATION_QUALIFYING
47 47
 		);
48 48
 	}
49 49
 }

+ 15
- 4
src/CaptainLearning/Entity/Type/EnumTrainingTypeType.php View File

@@ -35,14 +35,25 @@ class EnumTrainingTypeType extends StringType
35 35
 	 * Retourne un tableau de choix utilisable dans un formulaire.
36 36
 	 * @return string[]
37 37
 	 */
38
-	public static function getFormChoices($withNA = false)
38
+	public static function getFormChoices($withNA = false, $optional = false)
39 39
 	{
40 40
 		$choises = array();
41
+
42
+		if ($optional)
43
+		{
44
+			if ($withNA) {
45
+				$choises['enum_training_type_na'] = self::TYPE_NA;
46
+			}
47
+			$choises['enum_training_type_optional_intra'] = self::TYPE_INTRA;
48
+			$choises['enum_training_type_optional_inter'] = self::TYPE_INTER;
49
+			return $choises;
50
+		}
51
+
41 52
 		if ($withNA) {
42
-			$choises['NA'] = self::TYPE_NA;
53
+			$choises['enum_training_type_na'] = self::TYPE_NA;
43 54
 		}
44
-		$choises['INTRA'] = self::TYPE_INTRA;
45
-		$choises['INTER'] = self::TYPE_INTER;
55
+		$choises['enum_training_type_intra'] = self::TYPE_INTRA;
56
+		$choises['enum_training_type_inter'] = self::TYPE_INTER;
46 57
 		return $choises;
47 58
 	}
48 59
 }

+ 1
- 1
src/CaptainLearning/Entity/User/User.php View File

@@ -19,7 +19,7 @@ use Logipro\CaptainLearning\Entity\User\Constraints\Password\Password;
19 19
  * Représente un utilisateur du logiciel.
20 20
  */
21 21
 class User extends AbstractUploadableEntity
22
-implements UserInterface
22
+implements UserInterface, \Serializable
23 23
 {
24 24
 	/**
25 25
 	 * ID utilisateur.

+ 28
- 0
src/CaptainLearning/Form/DataTransformer/CPTDurationTransformer.php View File

@@ -0,0 +1,28 @@
1
+<?php
2
+namespace Logipro\CaptainLearning\Form\DataTransformer;
3
+
4
+use Doctrine\Common\Persistence\ObjectManager;
5
+use Symfony\Component\Form\DataTransformerInterface;
6
+use Symfony\Component\Form\Exception\TransformationFailedException;
7
+
8
+class CPTDurationTransformer implements DataTransformerInterface
9
+{
10
+    public function transform($value): array
11
+    {
12
+        $valueInMinutes = $value/60;
13
+        $minutes = $valueInMinutes%60;
14
+        $hours = ($valueInMinutes-$minutes)/60;
15
+        
16
+        return array('hours' => $hours, 'minutes' => $minutes);
17
+    }
18
+
19
+    public function reverseTransform($array): int
20
+    {
21
+        $total = 0;
22
+        $total += $array['hours']*60;
23
+        $total += $array['minutes'];
24
+        $total *= 60;
25
+
26
+        return $total;
27
+    }
28
+}

+ 183
- 30
src/CaptainLearning/Form/Seller/TrainingType.php View File

@@ -13,6 +13,11 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
13 13
 use Symfony\Component\Form\Extension\Core\Type\IntegerType;
14 14
 use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
15 15
 use Symfony\Component\Form\Extension\Core\Type\HiddenType;
16
+use Symfony\Component\Form\Extension\Core\Type\TimeType;
17
+use Symfony\Component\Form\Extension\Core\Type\NumberType;
18
+use Symfony\Component\Form\Extension\Core\Type\UrlType;
19
+use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
20
+use Symfony\Component\Form\Extension\Core\Type\FileType;
16 21
 use Symfony\Bridge\Doctrine\Form\Type\EntityType;
17 22
 use Logipro\CaptainLearning\Entity\Training\Training;
18 23
 use Logipro\CaptainLearning\Entity\Place;
@@ -23,11 +28,20 @@ use Logipro\CaptainLearning\Entity\Type\EnumTrainingCertificationType;
23 28
 use Logipro\CaptainLearning\Entity\Type\EnumTrainingModalityType;
24 29
 use Logipro\CaptainLearning\Entity\type\EnumCategoryType;
25 30
 
31
+use Logipro\CaptainLearning\Form\Type\CPTDurationType;
32
+
26 33
 /**
27 34
  * Formulaire de creation d'une formation.
28 35
  */
29 36
 class TrainingType extends AbstractType
30 37
 {
38
+	protected $container;
39
+ 
40
+	public function __construct($container){
41
+	
42
+		$this->container = $container;
43
+	}
44
+ 
31 45
 	public function buildForm(FormBuilderInterface $builder, array $options)
32 46
 	{
33 47
 		$labelSave =  'form_training_save_create';
@@ -38,7 +52,8 @@ class TrainingType extends AbstractType
38 52
 	    // Déclaration des champs
39 53
 		$builder->add('name', TextType::class, array(
40 54
 			'required' => true,
41
-            'empty_data' => ''
55
+			'empty_data' => '',
56
+			'help' => 'form_training_name_help'
42 57
 		))
43 58
 		->add('place', EntityType::class, array(
44 59
             'class' => Place::class,
@@ -50,6 +65,7 @@ class TrainingType extends AbstractType
50 65
 			},
51 66
             'choice_label' => 'name',
52 67
 			'required' => false,
68
+			'placeholder' => 'form_training_place_placeholder'
53 69
 		))
54 70
 		->add('minimalPlaceNumber', IntegerType::class, array(
55 71
 			'required' => true,
@@ -66,7 +82,7 @@ class TrainingType extends AbstractType
66 82
 			'required' => true,
67 83
 		))
68 84
 		->add('optionnalType', ChoiceType::class, array(
69
-            'choices' => EnumTrainingTypeType::getFormChoices(true),
85
+            'choices' => EnumTrainingTypeType::getFormChoices(true, true),
70 86
 			'expanded'=> true,
71 87
 			'multiple'=> false,
72 88
 			'required' => true,
@@ -84,25 +100,25 @@ class TrainingType extends AbstractType
84 100
 			'required' => true,
85 101
 		))
86 102
 		->add('eligibleCPF', ChoiceType::class, array(
87
-            'choices' => array("Oui"=> 1, "Non"=> 0),
103
+            'choices' => array("enum_yes"=> 1, "enum_no"=> 0),
88 104
 			'expanded'=> true,
89 105
 			'multiple'=> false,
90 106
 			'required' => true,
91 107
 			'empty_data' => 0,
92 108
 		))
93 109
 		->add('code', TextType::class, array(
94
-			'required' => true,
110
+			'required' => false,
95 111
             'empty_data' => '',
96
-			'help' => 'Code unique de la fromation au sein de l\'organisme de formation (optionnel)',
112
+			'help' => 'form_training_code_help',
97 113
 		))
98 114
 		->add('description', TextareaType::class, array(
99
-			'required' => true,
115
+			'required' => false,
100 116
             'empty_data' => '',
101 117
 		))
102 118
 		->add('hook', TextareaType::class, array(
103
-			'required' => true,
119
+			'required' => false,
104 120
             'empty_data' => '',
105
-			'help' => 'En quelques mots percutants quel est le b...',
121
+			'help' => "form_training_hook_help",
106 122
 		))
107 123
 		->add('category', EntityType::class, array(
108 124
             'class' => Category::class,
@@ -120,6 +136,7 @@ class TrainingType extends AbstractType
120 136
 			},
121 137
             'choice_label' => 'name',
122 138
 			'required' => false,
139
+			'help' => 'form_training_category_help'
123 140
 		))
124 141
 
125 142
 		->add('categoryDomain', EntityType::class, array(
@@ -135,7 +152,7 @@ class TrainingType extends AbstractType
135 152
             'choice_label' => 'name',
136 153
 			'required' => false,
137 154
 			'mapped' => false,
138
-			'placeholder' => "form_training_select_category_domain"
155
+			'placeholder' => "form_training_categoryDomain_placeholder"
139 156
 		))
140 157
 		->add('categorySubDomain', EntityType::class, array(
141 158
             'class' => Category::class,
@@ -143,7 +160,7 @@ class TrainingType extends AbstractType
143 160
             'choice_label' => 'name',
144 161
 			'required' => false,
145 162
 			'mapped' => false,
146
-			'placeholder' => "form_training_select_category_sub_domain"
163
+			'placeholder' => "form_training_categorySubDomain_placeholder"
147 164
 		))
148 165
 		->add('categoryBuisnessDomain', EntityType::class, array(
149 166
             'class' => Category::class,
@@ -151,7 +168,7 @@ class TrainingType extends AbstractType
151 168
             'choice_label' => 'name',
152 169
 			'required' => false,
153 170
 			'mapped' => false,
154
-			'placeholder' => "form_training_select_category_buisness_domain"
171
+			'placeholder' => "form_training_categoryBuisnessDomain_placeholder"
155 172
 		))
156 173
 		->add('categoryBuisness', EntityType::class, array(
157 174
             'class' => Category::class,
@@ -159,17 +176,103 @@ class TrainingType extends AbstractType
159 176
             'choice_label' => 'name',
160 177
 			'required' => false,
161 178
 			'mapped' => false,
162
-			'placeholder' => "form_training_select_category_buisness"
179
+			'placeholder' => "form_training_categoryBuisness_placeholder"
163 180
 		))
164 181
 
165 182
 
166 183
 
167 184
 		->add('prerequisites', TextType::class, array(
168 185
 			'required' => false,
169
-			'empty_data' => '',
170
-			'attr' => array('class' => 'js_tag_field'),
186
+			'empty_data' => ''
187
+		))
188
+		->add('target', TextType::class, array(
189
+			'required' => false,
190
+			'empty_data' => ''
191
+		))
192
+
193
+        ->add('duration', CPTDurationType::class, array(
194
+			'help' => 'form_training_duration_help'
195
+		))
196
+		
197
+		->add('spreading', NumberType::class, array(
198
+			'required' => false,
199
+			'empty_data' => 0,
200
+			'help' => 'form_training_spreading_help'
201
+		))
202
+		
203
+		->add('price', NumberType::class, array(
204
+			'required' => false
205
+		))
206
+
207
+		->add('price_on_request', CheckboxType::class, array(
208
+			'required' => false,
209
+			'help' => 'form_training_price_on_request_help'
210
+		))
211
+
212
+		->add('objectives', TextType::class, array(
213
+			'required' => false,
214
+			'empty_data' => ''
215
+		))
216
+
217
+		->add('content', TextType::class, array(
218
+			'required' => false,
219
+			'empty_data' => ''
171 220
 		))
172 221
 
222
+		->add('teaching_methods', TextareaType::class, array(
223
+			'required' => false,
224
+            'empty_data' => '',
225
+		))
226
+		->add('technical_methods', TextareaType::class, array(
227
+			'required' => false,
228
+            'empty_data' => '',
229
+		))
230
+		->add('acquired_evaluation', TextareaType::class, array(
231
+			'required' => false,
232
+            'empty_data' => '',
233
+		))
234
+		->add('level', TextareaType::class, array(
235
+			'required' => false,
236
+            'empty_data' => '',
237
+		))
238
+		->add('teaching_modalities', TextareaType::class, array(
239
+			'required' => false,
240
+            'empty_data' => '',
241
+		))
242
+		->add('border_modalities', TextareaType::class, array(
243
+			'required' => false,
244
+            'empty_data' => '',
245
+		))
246
+		->add('technical_modalities', TextareaType::class, array(
247
+			'required' => false,
248
+            'empty_data' => '',
249
+		))
250
+
251
+		->add('video_url', UrlType::class, array(
252
+			'required' => false,
253
+            'empty_data' => ''
254
+		))
255
+		/*->add('picture_one', FileType::class, array(
256
+			'required' => false
257
+		))
258
+		->add('picture_two', FileType::class, array(
259
+			'required' => false
260
+		))
261
+		->add('picture_tree', FileType::class, array(
262
+			'required' => false
263
+		))
264
+		->add('picture_four', FileType::class, array(
265
+			'required' => false
266
+		))
267
+		->add('picture_five', FileType::class, array(
268
+			'required' => false
269
+		))
270
+
271
+		->add('cover', FileType::class, array(
272
+			'required' => false
273
+		))*/
274
+
275
+
173 276
 		->add('save', SubmitType::class, array(
174 277
 			'label' => $labelSave
175 278
 		));
@@ -177,12 +280,11 @@ class TrainingType extends AbstractType
177 280
 		
178 281
         $builder->addEventListener(FormEvents::PRE_SET_DATA, array($this, 'onPreSetData'));
179 282
         $builder->addEventListener(FormEvents::PRE_SUBMIT, array($this, 'onPreSubmit'));
180
-        $builder->addEventListener(FormEvents::POST_SUBMIT, array($this, 'onPostSubmit'));
283
+        $builder->addEventListener(FormEvents::SUBMIT, array($this, 'onSubmit'));
181 284
 	}
182 285
 
183 286
 	function onPreSubmit(FormEvent $event)
184 287
 	{
185
-		dump('testb');
186 288
         $form = $event->getForm();
187 289
 		$data = $event->getData();
188 290
 		
@@ -257,7 +359,8 @@ class TrainingType extends AbstractType
257 359
 				->setParameter('categoryId', $data["buisnessCategory"]);
258 360
 			},
259 361
 			'choice_label' => 'name',
260
-			'required' => false
362
+			'required' => false,
363
+			'help' => 'form_training_categoryBuisness_help'
261 364
 		));
262 365
     }
263 366
 
@@ -276,39 +379,89 @@ class TrainingType extends AbstractType
276 379
         $data = $event->getData();
277 380
 		$form = $event->getForm();
278 381
 
279
-		$form;
280
-		
281 382
 		$form->add('buisnessCategory', EntityType::class, array(
282 383
 			'class' => Category::class,
283 384
 			'query_builder' => function (EntityRepository $repository) use($data) {
284
-				// Retourner que les catégories de type catégory
285
-				return $repository->createQueryBuilder('category')
286
-				->andWhere("category.typeClassification = :categoryType")
287
-				->setParameter('categoryType', EnumCategoryType::TYPE_BUISNESS)
288
-				->andWhere("category.categoryId = :categoryId")
289
-				->setParameter('categoryId', $data->getBuisnessCategory()->getCategoryId());
385
+				if ($data->getBuisnessCategory())
386
+				{
387
+					// Retourner que les catégories de type catégory
388
+					return $repository->createQueryBuilder('category')
389
+					->andWhere("category.typeClassification = :categoryType")
390
+					->setParameter('categoryType', EnumCategoryType::TYPE_BUISNESS)
391
+					->andWhere("category.categoryId = :categoryId")
392
+					->setParameter('categoryId', $data->getBuisnessCategory()->getCategoryId());
393
+				}
394
+				else {
395
+					return null;
396
+				}
290 397
 			},
291 398
 			'choice_label' => 'categoryId',
292 399
 			'required' => false,
293 400
 			'choice_attr' => array("class" => "d-none"),
294
-			'label_attr' => array("class" => "d-none")
401
+			'label_attr' => array("class" => "d-none"),
402
+			'attr' => array(
403
+				'class' => 'd-none',
404
+			)
295 405
 		));
296 406
 
407
+		$trans = $this->container->get('translator');
408
+		
297 409
 		$form->add('prerequisites', TextType::class, array(
298 410
 			'data' => json_encode(unserialize($data->getPrerequisites())),
299 411
 			'required' => false,
300 412
 			'empty_data' => '',
301
-			'attr' => array('class' => 'js_tag_field'),
413
+			'attr' => array(
414
+				'class' => 'js_tag_field d-none',
415
+				'placeholder' => 'Entrer ici un pré-requis',
416
+			),
417
+			'help' => 'form_training_prerequisites_help'
418
+		))->add('target', TextType::class, array(
419
+			'data' => json_encode(unserialize($data->getTarget())),
420
+			'required' => false,
421
+			'empty_data' => '',
422
+			'attr' => array(
423
+				'class' => 'js_tag_field d-none',
424
+				'placeholder' => 'Entrer ici un public cible'
425
+			),
426
+		))->add('objectives', TextType::class, array(
427
+			'data' => json_encode(unserialize($data->getObjectives())),
428
+			'required' => false,
429
+			'empty_data' => '',
430
+			'attr' => array(
431
+				'class' => 'js_complex_field', 
432
+				'data-label-titreliste' => $trans->trans('form_training_objectives_title_list'), 
433
+				'data-label-description' => $trans->trans('form_training_objectives_description'), 
434
+				'data-label-listes' => $trans->trans('form_training_objectives_lists'), 
435
+				'data-label-addliste' => $trans->trans('form_training_objectives_add_list'),
436
+				'placeholder' => $trans->trans('form_training_objectives_placeholder')),
437
+		))->add('content', TextType::class, array(
438
+			'data' => json_encode(unserialize($data->getContent())),
439
+			'required' => false,
440
+			'empty_data' => '',
441
+			'attr' => array(
442
+				'class' => 'js_complex_field', 
443
+				'data-label-titreliste' => $trans->trans('form_training_content_title_list'), 
444
+				'data-label-description' => $trans->trans('form_training_content_description'), 
445
+				'data-label-listes' => $trans->trans('form_training_content_lists'), 
446
+				'data-label-addliste' => $trans->trans('form_training_content_add_list'), 
447
+				'placeholder' => $trans->trans('form_training_content_placeholder')),
302 448
 		));
449
+
303 450
 	}
304 451
 
305 452
 	
306 453
 
307
-	function onPostSubmit(FormEvent $event)
454
+	function onSubmit(FormEvent $event)
308 455
 	{
309
-		dump('testd');
310
-        $data = $event->getData();
456
+		$data = $event->getData();
311 457
 		$form = $event->getForm();
458
+
459
+		if ($data) {
460
+			$data->setPrerequisites(\serialize(json_decode($data->getPrerequisites())));
461
+			$data->setTarget(\serialize(json_decode($data->getTarget())));
462
+			$data->setObjectives(\serialize(json_decode($data->getObjectives())));
463
+			$data->setContent(\serialize(json_decode($data->getContent())));
464
+		}
312 465
 	}
313 466
 	
314 467
 	/*public function addBuisnessCategories(FormInterface $form, $buisnessCategory = null)

+ 40
- 0
src/CaptainLearning/Form/Type/CPTDurationType.php View File

@@ -0,0 +1,40 @@
1
+<?php
2
+namespace Logipro\CaptainLearning\Form\Type;
3
+
4
+use Doctrine\Common\Persistence\ObjectManager;
5
+use Logipro\CaptainLearning\Form\DataTransformer\CPTDurationTransformer;
6
+use Symfony\Component\Form\AbstractType;
7
+use Symfony\Component\Form\Extension\Core\Type\TextType;
8
+use Symfony\Component\Form\Extension\Core\Type\FormType;
9
+use Symfony\Component\Form\FormBuilderInterface;
10
+use Symfony\Component\OptionsResolver\OptionsResolver;
11
+
12
+class CPTDurationType extends AbstractType
13
+{
14
+    public function buildForm(FormBuilderInterface $builder, array $options)
15
+    {
16
+        $builder
17
+            ->addModelTransformer(new CPTDurationTransformer(), true)
18
+            ->add('hours', TextType::class, array(
19
+                'required' => false,
20
+                'attr' => array('class' => 'cpt-hours'),
21
+            ))
22
+            ->add('minutes', TextType::class, array(
23
+                'required' => false,
24
+                'attr' => array('class' => 'cpt-minutes'),
25
+            ));
26
+    }
27
+
28
+    public function configureOptions(OptionsResolver $resolver)
29
+    {
30
+        $resolver->setDefault('attr', [
31
+            'class' => 'cpt-duration'
32
+        ]);
33
+        $resolver->setDefault('required', false);
34
+    }
35
+
36
+    public function getParent (): string {
37
+        return FormType::class;
38
+    }
39
+
40
+}

+ 102
- 1
templates/backOffice/seller/training/form/widget-form.html.twig View File

@@ -1,6 +1,107 @@
1 1
 {% extends "backOffice/common/widget/layout.html.twig" %}
2 2
 {% block body %}
3
-    
3
+		
4
+	{{ form_start(form, {attr: {class: 'form-captain w-100'} }) }}
5
+		<div class="col-12">
6
+			{{ form_errors(form) }}
7
+		</div>
8
+
9
+		{% set zones = [
10
+			{
11
+				"name": 'form_category_edit_informations',
12
+				"inputs": [
13
+					form.name,
14
+					form.place,
15
+					form.minimalPlaceNumber,
16
+					form.maximalPlaceNumber,
17
+					form.type,
18
+					form.optionnalType,
19
+					form.modality,
20
+					form.certification,
21
+					form.eligibleCPF,
22
+					form.code,
23
+					form.description,
24
+					form.hook,
25
+					form.category,
26
+					form.categoryDomain,
27
+					form.categorySubDomain,
28
+					form.categoryBuisnessDomain,
29
+					form.categoryBuisness,
30
+					form.prerequisites,
31
+					form.target,
32
+					form.duration,
33
+					form.spreading,
34
+					form.price,
35
+					form.price_on_request,
36
+				]
37
+			},
38
+			{
39
+				"name": 'form_category_edit_informations',
40
+				"inputs": [
41
+					form.objectives,
42
+				]
43
+			},
44
+			{
45
+				"name": 'form_category_edit_informations',
46
+				"inputs": [
47
+					form.content,
48
+				]
49
+			},
50
+			{
51
+				"name": 'form_category_edit_informations',
52
+				"inputs": [
53
+					form.teaching_methods,
54
+					form.technical_methods,
55
+					form.acquired_evaluation,
56
+					form.level,
57
+					form.teaching_modalities,
58
+					form.border_modalities,
59
+					form.technical_modalities,
60
+				]
61
+			},
62
+			{
63
+				"name": 'form_category_edit_informations',
64
+				"inputs": [
65
+					form.video_url
66
+				]
67
+			}
68
+		] %}
69
+
70
+   		{% for key, zone in zones %}
71
+			<div class="col-12">
72
+				<div class="form-separator d-flex border-bottom py-2 mb-3 mt-2">
73
+					<span class="form-step mr-2">{{ key + 1 }}</span>
74
+					<h3>{{ zone.name|trans }}</h3>
75
+				</div>
76
+
77
+				{% for keyinput, input in zone.inputs %}
78
+					<div class="form-group row mx-0 py-1 {{ (keyinput%2)?'bg-light':'' }}">
79
+						{% if input.vars.block_prefixes.1 != "checkbox" %}
80
+							{{ form_label(input, null, { 'label_attr': {'class': 'col-sm-12 col-lg-4'} }) }}
81
+						{% else %}
82
+							<div class='col-sm-12 col-lg-4'></div>
83
+						{% endif %}
84
+						<div class="col-md-12 col-xl-8">
85
+							<div class="row px-3">
86
+								<div class="col-sm-12 col-xl-6">
87
+									{{ form_widget(input, { 'attr': {}, 'help': 'foobar' }) }}
88
+									{% if input.vars.block_prefixes.1 == "checkbox" %}
89
+										{{ form_label(input, null, { 'label_attr': {'class': ''} }) }}
90
+									{% endif %}
91
+								</div>
92
+								<div class="col-sm-12 col-xl-6">
93
+									{{ form_help(input, {'attr': {'class': 'form-text text-muted help-feedback'}}) }}
94
+									<div class="invalid-feedback d-block">{{ form_errors(input) }}</div>
95
+								</div>
96
+							</div>
97
+						</div>
98
+					</div>
99
+				{% endfor %}
100
+			</div>
101
+		{% endfor %}
102
+		
103
+	{{ form_end(form) }}
104
+
4 105
 		{{ form_start(form, {attr: {class: 'form-captain w-100'} }) }}
5 106
 			<div class="col-12">
6 107
 				{{ form_errors(form) }}

+ 308
- 0
translations/messages.fr.xlf View File

@@ -93,6 +93,15 @@
93 93
 			<!-- fin configurations -->
94 94
 
95 95
 			<!-- enum -->
96
+			<trans-unit id="enum_yes">
97
+				<source>enum_yes</source>
98
+				<target>Oui</target>
99
+			</trans-unit>
100
+			<trans-unit id="enum_no">
101
+				<source>enum_no</source>
102
+				<target>Non</target>
103
+			</trans-unit>
104
+
96 105
 			<trans-unit id="enum_training_organization_document_statut_type_waiting_send">
97 106
 				<source>enum_training_organization_document_statut_type_waiting_send</source>
98 107
 				<target>En attente d'envoi</target>
@@ -202,6 +211,68 @@
202 211
 				<source>enum_user_civility_type_to_delete</source>
203 212
 				<target>Supprimée</target>
204 213
 			</trans-unit>
214
+
215
+			
216
+			<trans-unit id="enum_training_type_na">
217
+				<source>enum_training_type_na</source>
218
+				<target>Non attribué</target>
219
+			</trans-unit>
220
+			<trans-unit id="enum_training_type_intra">
221
+				<source>enum_training_type_intra</source>
222
+				<target>Intra-entreprise</target>
223
+			</trans-unit>
224
+			<trans-unit id="enum_training_type_inter">
225
+				<source>enum_training_type_inter</source>
226
+				<target>Inter-entreprise</target>
227
+			</trans-unit>
228
+			<trans-unit id="enum_training_type_optional_intra">
229
+				<source>enum_training_type_optional_intra</source>
230
+				<target>Autoriser les demandes intra-entreprise</target>
231
+			</trans-unit>
232
+			<trans-unit id="enum_training_type_optional_inter">
233
+				<source>enum_training_type_optional_inter</source>
234
+				<target>Autoriser les demandes inter-entreprise</target>
235
+			</trans-unit>
236
+
237
+			<trans-unit id="enum_training_modality_type_autonomous">
238
+				<source>enum_training_modality_type_autonomous</source>
239
+				<target>Autonome</target>
240
+			</trans-unit>
241
+			<trans-unit id="enum_training_modality_type_face_to_face">
242
+				<source>enum_training_modality_type_face_to_face</source>
243
+				<target>Présentiel</target>
244
+			</trans-unit>
245
+			<trans-unit id="enum_training_modality_type_virtual_class">
246
+				<source>enum_training_modality_type_virtual_class</source>
247
+				<target>Classe virtuelle</target>
248
+			</trans-unit>
249
+			<trans-unit id="enum_training_modality_type_tutoring">
250
+				<source>enum_training_modality_type_tutoring</source>
251
+				<target>Tutorat</target>
252
+			</trans-unit>
253
+			<trans-unit id="enum_training_modality_type_mixed">
254
+				<source>enum_training_modality_type_mixed</source>
255
+				<target>Mixte</target>
256
+			</trans-unit>
257
+
258
+			
259
+			<trans-unit id="enum_training_certification_none">
260
+				<source>enum_training_certification_none</source>
261
+				<target>Aucune</target>
262
+			</trans-unit>
263
+			<trans-unit id="enum_training_certification_certifying">
264
+				<source>enum_training_certification_certifying</source>
265
+				<target>Certifiante</target>
266
+			</trans-unit>
267
+			<trans-unit id="enum_training_certification_diploma">
268
+				<source>enum_training_certification_diploma</source>
269
+				<target>Diplômante</target>
270
+			</trans-unit>
271
+			<trans-unit id="enum_training_certification_qualifying">
272
+				<source>enum_training_certification_qualifying</source>
273
+				<target>Qualifiante</target>
274
+			</trans-unit>
275
+
205 276
 			<!-- fin enum -->
206 277
 			
207 278
 			<!-- Rôles -->
@@ -940,6 +1011,243 @@
940 1011
 				<source>list_training_no_session</source>
941 1012
 				<target>aucune session</target>
942 1013
 			</trans-unit>
1014
+
1015
+			<trans-unit id="form_training_name">
1016
+				<source>form_training_name</source>
1017
+				<target>Intitulé de la formation</target>
1018
+			</trans-unit>
1019
+			<trans-unit id="form_training_name_help">
1020
+				<source>form_training_name_help</source>
1021
+				<target>Il est contre-productif d'utiliser le mot formation. Exemple : «Bachelor Marketing international »</target>
1022
+			</trans-unit>
1023
+			<trans-unit id="form_training_place">
1024
+				<source>form_training_place</source>
1025
+				<target>Lieu</target>
1026
+			</trans-unit>
1027
+			<trans-unit id="form_training_place_placeholder">
1028
+				<source>form_training_place_placeholder</source>
1029
+				<target>Indéfini</target>
1030
+			</trans-unit>
1031
+			<trans-unit id="form_training_minimalPlaceNumber">
1032
+				<source>form_training_minimalPlaceNumber</source>
1033
+				<target>Nombre minimal de places</target>
1034
+			</trans-unit>
1035
+			<trans-unit id="form_training_maximalPlaceNumber">
1036
+				<source>form_training_maximalPlaceNumber</source>
1037
+				<target>Nombre maximal de places</target>
1038
+			</trans-unit>
1039
+			<trans-unit id="form_training_type">
1040
+				<source>form_training_type</source>
1041
+				<target>Type</target>
1042
+			</trans-unit>
1043
+			<trans-unit id="form_training_optionnalType">
1044
+				<source>form_training_optionnalType</source>
1045
+				<target>Type secondaire</target>
1046
+			</trans-unit>
1047
+			<trans-unit id="form_training_modality">
1048
+				<source>form_training_modality</source>
1049
+				<target>Modalité</target>
1050
+			</trans-unit>
1051
+			<trans-unit id="form_training_certification">
1052
+				<source>form_training_certification</source>
1053
+				<target>Certification</target>
1054
+			</trans-unit>
1055
+			<trans-unit id="form_training_eligibleCPF">
1056
+				<source>form_training_eligibleCPF</source>
1057
+				<target>Eligibilité au CPF</target>
1058
+			</trans-unit>
1059
+			<trans-unit id="form_training_code">
1060
+				<source>form_training_code</source>
1061
+				<target>Code de la formation</target>
1062
+			</trans-unit>
1063
+			<trans-unit id="form_training_code_help">
1064
+				<source>form_training_code_help</source>
1065
+				<target>Code unique de la fromation au sein de l'organisme de formation (optionnel)</target>
1066
+			</trans-unit>
1067
+			<trans-unit id="form_training_description">
1068
+				<source>form_training_description</source>
1069
+				<target>Description</target>
1070
+			</trans-unit>
1071
+			<trans-unit id="form_training_hook">
1072
+				<source>form_training_hook</source>
1073
+				<target>Accroche</target>
1074
+			</trans-unit>
1075
+			<trans-unit id="form_training_hook_help">
1076
+				<source>form_training_hook_help</source>
1077
+				<target>En quelques mots percutants quel est le bénéfice majeur dont bénéficiera votre apprenant à l’issue de la formation. Une bonne accroche invite l'apprenant à lire le reste de la fiche. Par exemple pour une formation « Bachelor européen Marketing International » une accroche pourrait être « Propulsez votre carrière en apprenant les rouages de la vente à l'international ». En l'absence d'accroche personnalisée, les 170 premiers caractères de votre description seront utilisés</target>
1078
+			</trans-unit>
1079
+			<trans-unit id="form_training_category">
1080
+				<source>form_training_category</source>
1081
+				<target>Catégorie thématique</target>
1082
+			</trans-unit>
1083
+			<trans-unit id="form_training_category_help">
1084
+				<source>form_training_category_help</source>
1085
+				<target>La catégorie qui correspond le mieux à votre formation. Toutefois, vous pouvez laisser ce champ vide s'il n'y aucune catégorie qui correspond.</target>
1086
+			</trans-unit>
1087
+			<trans-unit id="form_training_categoryDomain">
1088
+				<source>form_training_categoryDomain</source>
1089
+				<target>Grand domaine</target>
1090
+			</trans-unit>
1091
+			<trans-unit id="form_training_categoryDomain_placeholder">
1092
+				<source>form_training_categoryDomain_placeholder</source>
1093
+				<target>-- Grand domaine --</target>
1094
+			</trans-unit>
1095
+			<trans-unit id="form_training_categorySubDomain">
1096
+				<source>form_training_categorySubDomain</source>
1097
+				<target>Domaine professionnel</target>
1098
+			</trans-unit>
1099
+			<trans-unit id="form_training_categorySubDomain_placeholder">
1100
+				<source>form_training_categorySubDomain_placeholder</source>
1101
+				<target>-- Domaine professionnel --</target>
1102
+			</trans-unit>
1103
+			<trans-unit id="form_training_categoryBuisnessDomain">
1104
+				<source>form_training_categoryBuisnessDomain</source>
1105
+				<target>Répertoire métier</target>
1106
+			</trans-unit>
1107
+			<trans-unit id="form_training_categoryBuisnessDomain_placeholder">
1108
+				<source>form_training_categoryBuisnessDomain_placeholder</source>
1109
+				<target>-- Répertoire métier --</target>
1110
+			</trans-unit>
1111
+			<trans-unit id="form_training_categoryBuisness">
1112
+				<source>form_training_categoryBuisness</source>
1113
+				<target>Métier</target>
1114
+			</trans-unit>
1115
+			<trans-unit id="form_training_categoryBuisness_placeholder">
1116
+				<source>form_training_categoryBuisness_placeholder</source>
1117
+				<target>-- Métier --</target>
1118
+			</trans-unit>
1119
+			<trans-unit id="form_training_categoryBuisness_help">
1120
+				<source>form_training_categoryBuisness_help</source>
1121
+				<target>Cela permet de classer la formation selon la nomenclature des métiers de Pôle-emploi</target>
1122
+			</trans-unit>
1123
+			<trans-unit id="form_training_prerequisites">
1124
+				<source>form_training_prerequisites</source>
1125
+				<target>Pré-requis</target>
1126
+			</trans-unit>
1127
+			<trans-unit id="form_training_prerequisites_help">
1128
+				<source>form_training_prerequisites_help</source>
1129
+				<target>Que faut-il savoir? De quoi faut-il disposer pour suivre la formation? Exemple : pour une formation de perfectionnement à la trompette « solfège niveau avancé, trompette niveau intermédiaire »</target>
1130
+			</trans-unit>
1131
+			<trans-unit id="form_training_target">
1132
+				<source>form_training_target</source>
1133
+				<target>Public cible</target>
1134
+			</trans-unit>
1135
+			<trans-unit id="form_training_duration">
1136
+				<source>form_training_duration</source>
1137
+				<target>Nombre d'heures de la formation</target>
1138
+			</trans-unit>
1139
+			<trans-unit id="form_training_duration_help">
1140
+				<source>form_training_duration_help</source>
1141
+				<target>C’est la durée déclarée de la formation : celle qui se trouve sur la convention et qui sert à faire le calcul du taux horaire.</target>
1142
+			</trans-unit>
1143
+			<trans-unit id="form_training_spreading">
1144
+				<source>form_training_spreading</source>
1145
+				<target>Etalement en jours</target>
1146
+			</trans-unit>
1147
+			<trans-unit id="form_training_spreading_help">
1148
+				<source>form_training_spreading_help</source>
1149
+				<target>Nombre de jours d’ouverture de la session (utile pour vos apprenants qui anticiperont leur organisation). Par exemple une formation de 14 heures en autonomie (suivi de modules elearning) peut s'étaler sur 60 jours. Une formation en présentiel de 2 jours (durée : 14h) s’étalera sur 2 jours.</target>
1150
+			</trans-unit>
1151
+			<trans-unit id="form_training_price">
1152
+				<source>form_training_price</source>
1153
+				<target>Prix HT</target>
1154
+			</trans-unit>
1155
+			<trans-unit id="form_training_price_on_request">
1156
+				<source>form_training_price_on_request</source>
1157
+				<target>Prix sur demande</target>
1158
+			</trans-unit>
1159
+			<trans-unit id="form_training_price_on_request_help">
1160
+				<source>form_training_price_on_request_help</source>
1161
+				<target>Cette informations est affichée sur la liste des formations. Si cochée, le texte "prix sur demande" remplace le prix de la formation</target>
1162
+			</trans-unit>
1163
+
1164
+			<trans-unit id="form_training_objectives">
1165
+				<source>form_training_objectives</source>
1166
+				<target>Objectifs pédagogiques</target>
1167
+			</trans-unit>
1168
+			<trans-unit id="form_training_objectives_title_list">
1169
+				<source>form_training_objectives_title_list</source>
1170
+				<target>Titre de la liste</target>
1171
+			</trans-unit>
1172
+			<trans-unit id="form_training_objectives_description">
1173
+				<source>form_training_objectives_description</source>
1174
+				<target>Résumé des objectifs</target>
1175
+			</trans-unit>
1176
+			<trans-unit id="form_training_objectives_lists">
1177
+				<source>form_training_objectives_lists</source>
1178
+				<target>Détails des objectifs</target>
1179
+			</trans-unit>
1180
+			<trans-unit id="form_training_objectives_add_list">
1181
+				<source>form_training_objectives_add_list</source>
1182
+				<target>Ajouter une liste</target>
1183
+			</trans-unit>
1184
+			<trans-unit id="form_training_objectives_placeholder">
1185
+				<source>form_training_objectives_placeholder</source>
1186
+				<target>Ajouter un élément</target>
1187
+			</trans-unit>
1188
+
1189
+			<trans-unit id="form_training_content">
1190
+				<source>form_training_content</source>
1191
+				<target>Contenus pédagogiques</target>
1192
+			</trans-unit>
1193
+			<trans-unit id="form_training_content_title_list">
1194
+				<source>form_training_content_title_list</source>
1195
+				<target>Titre de la liste</target>
1196
+			</trans-unit>
1197
+			<trans-unit id="form_training_content_description">
1198
+				<source>form_training_content_description</source>
1199
+				<target>Résumé des contenus pédagogiques</target>
1200
+			</trans-unit>
1201
+			<trans-unit id="form_training_content_lists">
1202
+				<source>form_training_content_lists</source>
1203
+				<target>Détails du contenus pédagogiques</target>
1204
+			</trans-unit>
1205
+			<trans-unit id="form_training_content_add_list">
1206
+				<source>form_training_content_add_list</source>
1207
+				<target>Ajouter une liste</target>
1208
+			</trans-unit>
1209
+			<trans-unit id="form_training_content_placeholder">
1210
+				<source>form_training_content_placeholder</source>
1211
+				<target>Ajouter un élément</target>
1212
+			</trans-unit>
1213
+
1214
+			<trans-unit id="form_training_teaching_methods">
1215
+				<source>form_training_teaching_methods</source>
1216
+				<target>Moyens pédagogique</target>
1217
+			</trans-unit>
1218
+			<trans-unit id="form_training_technical_methods">
1219
+				<source>form_training_technical_methods</source>
1220
+				<target>Moyens technique</target>
1221
+			</trans-unit>
1222
+			<trans-unit id="form_training_acquired_evaluation">
1223
+				<source>form_training_acquired_evaluation</source>
1224
+				<target>Evaluation acquis</target>
1225
+			</trans-unit>
1226
+			<trans-unit id="form_training_level">
1227
+				<source>form_training_level</source>
1228
+				<target>Niveau</target>
1229
+			</trans-unit>
1230
+			<trans-unit id="form_training_teaching_modalities">
1231
+				<source>form_training_teaching_modalities</source>
1232
+				<target>Modalités pédagogique</target>
1233
+			</trans-unit>
1234
+			<trans-unit id="form_training_border_modalities">
1235
+				<source>form_training_border_modalities</source>
1236
+				<target>Modalités d'encadrement</target>
1237
+			</trans-unit>
1238
+			<trans-unit id="form_training_technical_modalities">
1239
+				<source>form_training_technical_modalities</source>
1240
+				<target>Modalités techniques</target>
1241
+			</trans-unit>
1242
+			<trans-unit id="form_training_video_url">
1243
+				<source>form_training_video_url</source>
1244
+				<target>Vidéo</target>
1245
+			</trans-unit>
1246
+			<trans-unit id="form_training_video_url_help">
1247
+				<source>form_training_video_url_help</source>
1248
+				<target>Lien d'une vidéo Youtube ou Vimeo</target>
1249
+			</trans-unit>
1250
+
943 1251
 			
944 1252
 			<!-- fin back office Vendeur -->
945 1253
 

Loading…
Cancel
Save