Compare commits

...

36 Commits

Author SHA1 Message Date
llaniau ddbfcc8a69 Changement de version 2021-01-04 14:08:07 +01:00
llaniau 61925ebb38 Mise en place de mailJet
Bug de connexion
2020-12-24 10:18:57 +01:00
llaniau 0bb341b7ce version patch prod 2020-12-24 09:33:47 +01:00
llaniau 74f2e45edf Changement de version dans config.yml 2020-12-21 10:07:28 +01:00
llaniau 5d660ebc8b Patch pour pallier parameters 2020-12-17 08:53:23 +01:00
llaniau a31e49278b V2.4.0.1 2020-12-16 15:36:48 +01:00
llaniau b13d0d939f version sur footer 2020-12-16 15:34:57 +01:00
llaniau e470c8dce1 patch 5 prod 2020-12-16 10:35:00 +01:00
llaniau 8eeaf240de patch 4 prod 2020-12-16 10:33:28 +01:00
llaniau 18144e395c Patch 3 Prod 2020-12-16 10:26:29 +01:00
llaniau f53815aa1a Patch 2 prod 2020-12-16 10:16:42 +01:00
llaniau bab23a58ac Patch prod V2.4.0 2020-12-16 10:10:52 +01:00
llaniau 9346635ca7 Packaging MEP V2.4.0 2020-12-15 13:32:21 +01:00
llaniau 849b5a999a changement de version dans parameters 2020-12-15 09:09:45 +01:00
llaniau 409be2f0b0 Retour recette Corentin et Audrey 2020-12-14 17:46:27 +01:00
llaniau d201bd44b9 US 238 : Mise en place de la version 2020-12-11 16:15:04 +01:00
llaniau cbe1b1f0d6 US443 et US Offre d'emploi 2020-12-10 17:00:58 +01:00
llaniau a56d568319 Mise en place video apres upload 2020-12-09 14:08:20 +01:00
llaniau c8f9e4d8f4 US 420,412,421,414 2020-12-02 16:40:40 +01:00
llaniau 21b8954c13 repassage en no follow 2020-12-01 19:21:44 +01:00
llaniau ee9eb19ca9 Bug geoloc et import video prod 2020-11-25 11:22:55 +01:00
llaniau 3060f93e59 bug geoloc suite 2020-11-25 10:53:57 +01:00
llaniau dc29527064 Bug geoloc suite 2020-11-25 09:51:11 +01:00
llaniau f369802b96 company.js au lieu de main.dash.company.js 2020-11-24 14:29:39 +01:00
llaniau 07941367cc Pour mise en prod (balise nofollow) 2020-11-24 13:55:43 +01:00
llaniau effb92a9d8 ajout bouton supprimer dans gestion candidatures 2020-11-24 13:51:38 +01:00
llaniau 1952e27030 Bug geoloc 2020-11-24 11:16:28 +01:00
llaniau 6db371f2af Bug geoloc suite 2020-11-24 11:00:19 +01:00
llaniau 37ef9a4fdd Bug geoloc 2020-11-24 09:10:40 +01:00
llaniau e11f36d170 Bug auto completion api pole emploi 2020-11-23 17:34:10 +01:00
llaniau 968b4d0497 US 400 2020-11-23 17:24:22 +01:00
llaniau b6ba7e62e3 bug main.dash.company (essai) 2020-11-23 16:50:28 +01:00
llaniau 67734e40b3 Bug geoloc avant mise en prod 2020-11-23 12:59:39 +01:00
llaniau 4d96ede4ea suite recette V2.2.2 2020-11-17 15:47:31 +01:00
llaniau 55ff3ddcb8 US 340 : corection de bug suite recette 2020-11-16 15:27:49 +01:00
llaniau 47fdf752b1 effet de bord US 340 et US64 (modal) 2020-11-10 13:54:29 +01:00
53 changed files with 2053 additions and 190 deletions
@@ -47,7 +47,7 @@
{{ form_widget(form.cgu) }}
{# {{ form_label(form.cgu) }} #}
<label>Je déclare avoir pris connaissance et accepté les termes et les <a target="_blank"
href="/politique-confidentialite">conditions générales dutilisation</a></label>
href="/cgu">conditions générales dutilisation</a></label>
</div>
</div>
{# <div class="js-form-message mb-3">
@@ -208,7 +208,7 @@
</trans-unit>
<trans-unit id="profile.company.size">
<source>profile.company.size</source>
<target>Taille de l'entreprise (nombre de personnes)</target>
<target>Taille de l'entreprise</target>
</trans-unit>
<trans-unit id="profile.company.description">
<source>profile.company.description</source>
@@ -263,6 +263,19 @@
}
});
}
function verifierDelete(id){
console.log(id);
var r = confirm("Êtes vous sûr de supprimer cette candidature ?\nSupprimer cette candidature supprimera le média associé\n");
if (r == true) {
txt = "You pressed OK!";
location.href = "/app_dev.php/admin/config/answer/"+id+"/delete";
return true;
} else {
txt = "You pressed Cancel!";
}
console.log(txt);
}
</script>
{% endblock %}
@@ -28,51 +28,12 @@
<!-- Please remove the file below for production: Contains demo classes -->
<link class="main-stylesheet" href="{{ asset('dashboard/css/style.css') }}" rel="stylesheet" type="text/css" />
<script type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="08e9d301-ba14-4d69-8b1a-53685114c5af";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
<!-- BEGIN VENDOR JS -->
<script src="{{ asset('dashboard/plugins/pace/pace.min.js') }}" type="text/javascript"></script>
<!-- A polyfill for browsers that don't support ligatures: remove liga.js if not needed-->
<script src="{{ asset('dashboard/plugins/liga.js') }}" type="text/javascript"></script>
<!-- END PAGE LEVEL JS -->
<script src="{{ asset('dashboard/plugins/jquery/jquery-3.2.1.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/modernizr.custom.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery-ui/jquery-ui.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/popper/umd/popper.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery/jquery-easy.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery-unveil/jquery.unveil.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery-ios-list/jquery.ioslist.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery-actual/jquery.actual.min.js') }}"></script>
<script src="{{ asset('dashboard/plugins/jquery-scrollbar/jquery.scrollbar.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('dashboard/plugins/select2/js/select2.full.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('dashboard/plugins/classie/classie.js') }}"></script>
<script src="{{ asset('dashboard/plugins/nvd3/lib/d3.v3.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/nv.d3.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/utils.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/tooltip.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/interactiveLayer.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/models/axis.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/models/line.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/models/lineWithFocusChart.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/mapplic/js/hammer.min.js') }}"></script>
<script src="{{ asset('dashboard/plugins/mapplic/js/jquery.mousewheel.js') }}"></script>
<script src="{{ asset('dashboard/plugins/mapplic/js/mapplic.js') }}"></script>
<script src="{{ asset('dashboard/plugins/rickshaw/rickshaw.min.js') }}"></script>
<script src="{{ asset('dashboard/plugins/jquery-sparkline/jquery.sparkline.min.js') }}" type="text/javascript">
</script>
<script src="{{ asset('dashboard/plugins/skycons/skycons.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/quill/quill.min.js') }}" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/gh/xcash/bootstrap-autocomplete@v2.3.7/dist/latest/bootstrap-autocomplete.min.js"></script>
<!-- END VENDOR JS -->
<!-- BEGIN CORE TEMPLATE JS -->
<!-- BEGIN CORE TEMPLATE JS -->
<script src="{{ asset('dashboard/pages/js/pages.js') }}"></script>
<script src="{{ asset('dashboard/pages/js/pages.email.js') }}"></script>
<!-- END CORE TEMPLATE JS -->
<!-- BEGIN PAGE LEVEL JS -->
<script src="{{ asset('dashboard/js/scripts.js') }}" type="text/javascript"></script>
<!-- END PAGE LEVEL JS -->
<!-- END CORE TEMPLATE JS -->
<!-- BEGIN PAGE LEVEL JS -->
<script src="{{ asset('dashboard/js/dashboard.js') }}" type="text/javascript"></script>
{# <script type="text/javascript" src="http://code.jquery.com/jquery-3.2.1.min.js"></script> #}
{% block javascriptSupl %}
{% endblock %}
<!-- END PAGE LEVEL JS -->
@@ -80,6 +41,7 @@
<body class="fixed-header dashboard menu-pin menu-behind">
{# {{ include('default/user_switch.html.twig') }} #}
{{ include('admin/navigation_gauche.html.twig')}} }}
@@ -114,9 +76,7 @@
<!-- END PAGE CONTENT WRAPPER -->
</div>
<!-- END PAGE CONTAINER -->
{% block javascripts %}
{% block javascripts %}
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYV8IJGtIoWLfXJQQvIuDQ88n2aEuRgpg&libraries=places">
</script>
{% javascripts
@@ -128,10 +88,64 @@
{% endjavascripts %}
{% endblock %}
<!-- BEGIN VENDOR JS -->
<script src="{{ asset('dashboard/plugins/pace/pace.min.js') }}" type="text/javascript"></script>
<!-- A polyfill for browsers that don't support ligatures: remove liga.js if not needed-->
<script src="{{ asset('dashboard/plugins/liga.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/modernizr.custom.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery-ui/jquery-ui.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/popper/umd/popper.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery/jquery-easy.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery-unveil/jquery.unveil.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery-ios-list/jquery.ioslist.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/jquery-actual/jquery.actual.min.js') }}"></script>
<script src="{{ asset('dashboard/plugins/jquery-scrollbar/jquery.scrollbar.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('dashboard/plugins/select2/js/select2.full.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('dashboard/plugins/classie/classie.js') }}"></script>
<script src="{{ asset('dashboard/plugins/nvd3/lib/d3.v3.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/nv.d3.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/utils.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/tooltip.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/interactiveLayer.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/models/axis.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/models/line.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/nvd3/src/models/lineWithFocusChart.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/mapplic/js/hammer.min.js') }}"></script>
<script src="{{ asset('dashboard/plugins/mapplic/js/jquery.mousewheel.js') }}"></script>
<script src="{{ asset('dashboard/plugins/mapplic/js/mapplic.js') }}"></script>
<script src="{{ asset('dashboard/plugins/rickshaw/rickshaw.min.js') }}"></script>
<script src="{{ asset('dashboard/plugins/jquery-sparkline/jquery.sparkline.min.js') }}" type="text/javascript">
</script>
<script src="{{ asset('dashboard/plugins/skycons/skycons.js') }}" type="text/javascript"></script>
<script src="{{ asset('dashboard/plugins/quill/quill.min.js') }}" type="text/javascript"></script>
<!-- END VENDOR JS -->
<!-- BEGIN CORE TEMPLATE JS -->
<!-- BEGIN CORE TEMPLATE JS -->
<script src="{{ asset('dashboard/pages/js/pages.js') }}"></script>
<script src="{{ asset('dashboard/pages/js/pages.email.js') }}"></script>
<!-- END CORE TEMPLATE JS -->
<!-- BEGIN PAGE LEVEL JS -->
<script src="{{ asset('dashboard/js/scripts.js') }}" type="text/javascript"></script>
<!-- END PAGE LEVEL JS -->
<!-- END CORE TEMPLATE JS -->
<!-- BEGIN PAGE LEVEL JS -->
<script src="{{ asset('dashboard/js/dashboard.js') }}" type="text/javascript"></script>
{% block javascriptsSecondaire %}
{% endblock %}
{% block javascriptsEnd %}
{% endblock %}
</body>
</html>
</html>
@@ -9,7 +9,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item"><a href="{{ path('company_ad') }}">Offres d'emploi</a></li>
<li class="breadcrumb-item"><a href="{{ path('company_ad_answer_list',{'id':ad.id}) }}">{{ ad.title }}
</a></li>
@@ -30,8 +30,8 @@
{% endif %} #}
<!-- Modal 1 -->
<div class="modal fade bd-example-modal-lg" id="partageModal" tabindex="-1" role="dialog"
aria-labelledby="partageModalLabel" aria-hidden="false">
<div class="modal fade in bd-example-modal-lg" id="partageModal" tabindex="-1" role="dialog"
aria-labelledby="partageModalLabel" aria-hidden="false" data-show="false">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -68,8 +68,8 @@ Au plaisir d’échanger avec vous,
</div>
<!-- Modal 2 -->
<div class="modal fade bd-example-modal-lg" id="decocheModal" tabindex="-1" role="dialog"
aria-labelledby="decocheModalLabel" aria-hidden="false">
<div class="modal fade in bd-example-modal-lg" id="decocheModal" tabindex="-1" role="dialog"
aria-labelledby="decocheModalLabel" aria-hidden="false" data-show="false" data-backdrop="static">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -221,16 +221,27 @@ Au plaisir d’échanger avec vous,
{% endblock %}
{% block javascriptsEnd %}
<!-- BEGIN VENDOR JS -->
<script src="{{ asset('dashboard/plugins/bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script>
<!-- END PAGE LEVEL JS -->
<script type="text/javascript">
function parcourirAllCheckbox() {
var allCheckboxes = $("input[type=checkbox]");
var allCheckboxes = $("input[type=checkbox]");
var auMoinUneCheckboxCoche = false;
// Put all the unique name attributes in an array.
var checkboxCocheId= null;
allCheckboxes.each(function () {
var isChecked = $(this).prop('checked');
if (isChecked == true) {
auMoinUneCheckboxCoche = true
auMoinUneCheckboxCoche = true;
var tabId =$(this).prop('id').split("_");
checkboxCocheId = tabId[1];
console.log(checkboxCocheId);
}
});
@@ -242,6 +253,8 @@ Au plaisir d’échanger avec vous,
$("#partageCandidats").attr("disabled", true);
}
return checkboxCocheId;
}
function annulerCheckbox(){
@@ -258,6 +271,7 @@ Au plaisir d’échanger avec vous,
parcourirAllCheckbox();
if($("#answer_" + id).prop('checked')==false){
console.log("cette checkbox était cochée avant");
//$('#decocheModal').modal('open');
$('#decocheModal').modal('show');
$("#caseRecocher").val(id);
}
@@ -303,9 +317,24 @@ Au plaisir d’échanger avec vous,
}
$(function () {
parcourirAllCheckbox();
console.log("ready");
$(document)
.ready(function () {
console.log("ready");
var id = parcourirAllCheckbox();
//on recupere un id d'une checkbox coché pour lancer l'ajax et remplacé les caracteres ###### par le mot de passe
verifierIsChecked(id);
//initialize all modals!!
$('.modal').modal({
dismissible: true
});
$('#partageModal').modal('hide');
$('#decocheModal').modal('hide');
}
);
$(window).load(function() {
$('#partageModal').modal('hide');
$('#decocheModal').modal('hide');
});
</script>
{% endblock %}
@@ -51,7 +51,7 @@
<div class="bg-img-hero" style="background-image: url('http://localhost/v2/img/partage/candidature-offre-emploi-video.jpg');">
<div class="bg-img-hero" style="background-image: url('/v2/img/partage/candidature-offre-emploi-video.jpg');">
<div class="container space-2 space-2-top--lg space-3-bottom--lg">
<div class=" text-center mx-auto">
<!-- Title -->
@@ -29,7 +29,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item"><a href="{{ path('company_ad') }}">Offres d'emploi</a></li>
</ol>
@@ -45,27 +45,26 @@
<!-- Modal 1 -->
<div class="modal fade bd-example-modal-lg" id="competencesModal" tabindex="-1" role="dialog"
aria-labelledby="competencesModalLabel" aria-hidden="false">
aria-labelledby="competencesModalLabel" aria-hidden="false" data-show="false">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="competencesModalLabel">Souhaitez-vous remplacer le métier <span class="metierAncienPopup">{aucun}</span> par <span class="metierPopup"></span></h5>
<h5 class="modal-title" id="competencesModalLabel">Souhaitez-vous sélectionner le métier <span class="metierPopup"></span>?</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h5>&nbsp;</h5>
<h5>&nbsp;</h5>
<p>
Les compétences que vous aviez précédemment sélectionnées en lien avec le métier <span class="metierAncienPopup">{aucun}</span> seront remplacées par de nouvelles compétences, correspondant au métier <span class="metierPopup">.
Si vous aviez précédemment sélectionné des compétences en lien avec l'ancien métier de rattachement, celles-ci seront remplacées par les nouvelles compétences, correspondant au métier <span class="metierPopup"></span>.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal"
onclick="chargerCompetences();">Remplacer</button>
onclick="chargerCompetences();">Sélectionner</button>
</div>
</div>
</div>
@@ -74,10 +73,13 @@
<!-- Modal 2 -->
<div class="modal fade modalCompetences" id="ajoutCompetencesModal" tabindex="-1" role="dialog"
aria-labelledby="ajoutCompetencesModalLabel" aria-hidden="false">
aria-labelledby="ajoutCompetencesModalLabel" aria-hidden="false" data-show="false">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title">Sélectionnez les compétences recherchées pour le poste à pourvoir </h6>
<h7 class="modal-title">Vous pouvez sélectionner jusqu’à 10 compétences à afficher dans votre offre demploi. </h7>
</div>
<div class="modal-body">
{# <p>Etes vous sur de charger les compétences du métier <span id="metierPopup"></span></p> #}
@@ -245,6 +247,7 @@
<td class="col-lg-12 col-md-12 col-sm-12 bg-contrast-lower">
<div id="competencesAd"></div><br />
<div id="competencesAdMessage" class="text-danger">Veuillez choisir un métier de rattachement pour votre annonce.</div><br />
<div id="loadingDiv" >Patientez...</div><br />
<div class="text-center" id="competencesButtonAd">
<button type="button" class="btn btn-primary" data-toggle="modal"
data-target="#ajoutCompetencesModal" id="ajoutCompetences">
@@ -451,7 +454,11 @@
$("#competencesAdMessage").html(
"Vous devez sélectionner au minimum une compétence "
);
$("#ajouterCompetenceButtonMdal").show();
$("#competencesAdMessagePopup").html(
"Vous devez sélectionner au minimum une compétence "
);
$("#ajouterCompetenceButtonMdal").html("Ajouter (+0)");
$("#ajouterCompetenceButtonMdal").hide();
$("#saveAdButton").prop("disabled", true);
}else if(nbCompetencesSelect>9){
//Gestion des erreurs si plusde 10 compétences
@@ -468,9 +475,9 @@
}
}else{
//cas standards, on reinitialise les champs a vide
$("#competencesAdMessage").html(
" "
);
$("#competencesAdMessage").html( " ");
$("#competencesAdMessagePopup").html(" ");
$("#saveAdButton").prop("disabled", false);
$("#ajouterCompetenceButtonMdal").show();
}
@@ -510,6 +517,7 @@
.ready(function () {
// Construction du champ typeahead d'auto compléetion de métier
$("#competencesButtonAd").hide();
$('#loadingDiv').hide();
var metiers = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
@@ -550,9 +558,9 @@
//comment sont formaté les suggestion de l'auto completion
$(".tt-dataset-metiers").show();
var chaine = data.metier_libelle.replace("'", "\\'");
return '<div><a href="#" onclick="chargerDonneesTemp(' + data.metier_id + ',\'' +
return '<div onclick="chargerDonneesTemp(' + data.metier_id + ',\'' +
chaine +
'\')" data-toggle="modal" data-target="#competencesModal" id="competences">' + data.metier_libelle +
'\')" data-toggle="modal" data-target="#competencesModal" id="competences"><a href="#" >' + data.metier_libelle +
'</a></div>'
},
footer: function (query) {
@@ -591,6 +599,10 @@
data: 'q=' + $("#id_appellation_temporaire").val(),
//Le format de réponse attendu
dataType: "json",
beforeSend: function () { // Before we send the request, remove the .hidden class from the spinner and default to inline-block.
$('#loadingDiv').show();
console.log("début loading");
},
})
//Ce code sera exécuté en cas de succès - La réponse du serveur est passée à done()
/*On peut par exemple convertir cette réponse en chaine JSON et insérer
@@ -608,7 +620,7 @@
$("#competencesAd").text("");
$("#competencesAdPopup").text("");
$("#competencesAdMessage").html("");
//parcours de l'objet json renvoyé par l'api
//parcours de l'objet json renvoyé par l'api (competence de base)
obj.competencesDeBase.forEach(function (object) {
// Pour chaque compétences, on crée
//1 checkbox dans la page principal. iL est affiché par défaut si c'est une compétence clé. les compéetences clés sonr cochés
@@ -629,6 +641,33 @@
$("#competence_ad_"+object.code).hide();
}
});
//parcours de l'objet json renvoyé par l'api ( groupes de compétences spécifiques)
obj.groupesCompetencesSpecifiques.forEach(function (object) {
//parcours de l'objet json renvoyé par l'api ( groupes de compétences spécifiques)
object.competences.forEach(function (competence) {
// Pour chaque compétences, on crée
//1 checkbox dans la page principal. iL est affiché par défaut si c'est une compétence clé. les compéetences clés sonr cochés
// 1 checkbox dans la popup d'ajout de competences. Par defaut, seul les compétences clé sont cochés
var hidden = "";
var checked = "";
//On on ne coche pas ces competences clé (uniquement les compétences de base) sur le formulaire de base
//if (competence.competenceCle == true && type != "init") {
//checked = "checked";
//}
var chaine = competence.libelle.replace("'", " ");
var chaine = chaine.replace(",", " ");
$("#competencesAd").append("<div id='competence_ad_"+competence.code+"' name='competences_ad[]'><input type='checkbox' "+checked+" onChange='genererCompetences(this);' id='competence_" + competence
.code + "' value='" +chaine+"_"+ competence.code + "'> " + competence.libelle + "<br/></div>");
$("#competencesAdPopup").append("<div id='competence_ad_popup_"+competence.code+"'><input type='checkbox' "+checked+" onChange='genererCompetences(this);' id='competencepopup_" + competence
.code + "' value='" + competence.code + "'> " + competence.libelle + "<br/></div>");
//On n'affiche pas ces competences (meme les competences clé) sur le formulaire de base
//if (competence.competenceCle == false) {
$("#competence_ad_"+competence.code).hide();
//}
});
});
$("#competencesButtonAd").show();
//lors de l'init, on affiche et coche les compétences récupérer en base. On désaffiche et decoche celle qui n'y sont plus
// Pareil pour la popup sauf qu'elles sont toutes affichées
@@ -648,6 +687,7 @@
}
//on génere le json qui va remplir le champ ad_competences
genererJson();
$('#loadingDiv').hide();
})
//Ce code sera exécuté en cas d'échec - L'erreur est passée à fail()
@@ -658,13 +698,13 @@
if ($("#saisie").val() != "") {
// si il y a un pb avec l'api pole emploi, on affiche ce message
$("#competencesAdMessage").html(
"Une erreur est survenue dans la recherche du métier de rattachement. <a href='#' onclick='chargerCompetences();'><i class='fa fa-refresh fa-spin fa-fw'></i>Cliquez ici pour relancer la recherche</a> "
"Une erreur est survenue dans la recherche du métier de rattachement. <a href='#' onclick='chargerCompetences();'><br/><i class='fa fa-refresh fa-spin fa-fw'></i>Cliquez ici pour relancer la recherche</a> "
);
}
console.log("La requête s'est terminée en échec. Infos : " + JSON.stringify(error));
$('#loadingDiv').hide();
console.log("La requête s'est terminée en échec q= "+ $("#id_appellation_temporaire").val()+" Infos : " + JSON.stringify(error));
})
//Ce code sera exécuté que la requête soit un succès ou un échec
.always(function () {
console.log("Requête effectuée");
@@ -689,6 +729,8 @@
}
}else{
$("#competence_" + id).prop("checked", false);
$("#competence_ad_" + id).hide();
//$("#competence_" + id).hide();
$("#competencepopup_" + id).prop("checked", false);
}
// on génere le json a chaque fois
@@ -25,7 +25,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item"><a href="{{ path('company_ad') }}">Offres d'emploi</a></li>
</ol>
@@ -40,11 +40,11 @@
<!-- Modal 1 -->
<div class="modal fade bd-example-modal-lg" id="competencesModal" tabindex="-1" role="dialog"
aria-labelledby="competencesModalLabel" aria-hidden="false">
aria-labelledby="competencesModalLabel" aria-hidden="false" data-show="false">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="competencesModalLabel">Souhaitez-vous remplacer le métier <span class="metierAncienPopup">{aucun}</span> par <span class="metierPopup"></span></h5>
<h5 class="modal-title" id="competencesModalLabel">Souhaitez-vous sélectionner le métier <span class="metierPopup"></span>?</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
@@ -53,13 +53,13 @@
<h5>&nbsp;</h5>
<p>
Les compétences que vous aviez précédemment sélectionnées en lien avec le métier <span class="metierAncienPopup">{aucun}</span> seront remplacées par de nouvelles compétences, correspondant au métier <span class="metierPopup">.
Si vous aviez précédemment sélectionné des compétences en lien avec l'ancien métier de rattachement, celles-ci seront remplacées par les nouvelles compétences, correspondant au métier <span class="metierPopup"></span>.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal"
onclick="chargerCompetences();">Remplacer</button>
onclick="chargerCompetences();">Sélectionner</button>
</div>
</div>
</div>
@@ -68,10 +68,13 @@
<!-- Modal 2 -->
<div class="modal fade modalCompetences" id="ajoutCompetencesModal" tabindex="-1" role="dialog"
aria-labelledby="ajoutCompetencesModalLabel" aria-hidden="false">
aria-labelledby="ajoutCompetencesModalLabel" aria-hidden="false" data-show="false">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title">Sélectionnez les compétences recherchées pour le poste à pourvoir </h6>
<h7 class="modal-title">Vous pouvez sélectionner jusqu’à 10 compétences à afficher dans votre offre demploi. </h7>
</div>
<div class="modal-body">
{# <p>Etes vous sur de charger les compétences du métier <span id="metierPopup"></span></p> #}
@@ -236,7 +239,8 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
<td class="col-lg-12 col-md-12 col-sm-12 bg-contrast-lower">
<div id="competencesAd"></div><br />
<div id="competencesAdMessage" class="text-danger">Vous devez
sélectionner un minimum une compétence</div><br />
sélectionner au minimum une compétence</div><br />
<div id="loadingDiv" >Patientez...</div><br />
<div class="text-center" id="competencesButtonAd">
<button type="button" class="btn btn-primary" data-toggle="modal"
data-target="#ajoutCompetencesModal" id="ajoutCompetences">
@@ -433,7 +437,11 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
$("#competencesAdMessage").html(
"Vous devez sélectionner au minimum une compétence. "
);
$("#ajouterCompetenceButtonMdal").show();
$("#competencesAdMessagePopup").html(
"Vous devez sélectionner au minimum une compétence. "
);
$("#ajouterCompetenceButtonMdal").html("Ajouter (+0)");
$("#ajouterCompetenceButtonMdal").hide();
$("#saveAdButton").prop("disabled", true);
}else if(nbCompetencesSelect>9){
$("#saveAdButton").prop("disabled", false);
@@ -450,9 +458,8 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
}else{
//cas standards, on reinitialise les champs a vide
$("#saveAdButton").prop("disabled", false);
$("#competencesAdMessage").html(
" "
);
$("#competencesAdMessage").html( " ");
$("#competencesAdMessagePopup").html(" ");
$("#ajouterCompetenceButtonMdal").show();
}
if($("#saisie").val() =="" || !$("#saisie").val() ){
@@ -487,6 +494,7 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
.ready(function () {
// Construction du champ typeahead d'auto compléetion de métier
$("#competencesButtonAd").hide();
$('#loadingDiv').hide();
console.log("metiers!!");
var metiers = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
@@ -530,9 +538,9 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
//comment sont formaté les suggestion de l'auto completion
$(".tt-dataset-metiers").show();
var chaine = data.metier_libelle.replace("'", " ");
return '<div><a href="#" onclick="chargerDonneesTemp(' + data.metier_id + ',\'' +
return '<div onclick="chargerDonneesTemp(' + data.metier_id + ',\'' +
chaine +
'\')" data-toggle="modal" data-target="#competencesModal" id="competences">' + data.metier_libelle +
'\')" data-toggle="modal" data-target="#competencesModal" id="competences"><a href="#" >' + data.metier_libelle +
'</a></div>'
},
footer: function (query) {
@@ -569,6 +577,10 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
data: 'q=' + $("#id_appellation_temporaire").val(),
//Le format de réponse attendu
dataType: "json",
beforeSend: function () { // Before we send the request, remove the .hidden class from the spinner and default to inline-block.
$('#loadingDiv').show();
console.log("début loading");
},
})
//Ce code sera exécuté en cas de succès - La réponse du serveur est passée à done()
/*On peut par exemple convertir cette réponse en chaine JSON et insérer
@@ -611,6 +623,35 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
$("#competence_ad_"+object.code).hide();
}
});
//parcours de l'objet json renvoyé par l'api ( groupes de compétences spécifiques)
obj.groupesCompetencesSpecifiques.forEach(function (object) {
//parcours de l'objet json renvoyé par l'api ( groupes de compétences spécifiques)
object.competences.forEach(function (competence) {
// Pour chaque compétences, on crée
//1 checkbox dans la page principal. iL est affiché par défaut si c'est une compétence clé. les compéetences clés sonr cochés
// 1 checkbox dans la popup d'ajout de competences. Par defaut, seul les compétences clé sont cochés
var hidden = "";
var checked = "";
//On on ne coche pas ces competences clé (uniquement les compétences de base) sur le formulaire de base
//if (competence.competenceCle == true && type != "init") {
//checked = "checked";
//}
var chaine = competence.libelle.replace("'", " ");
var chaine = chaine.replace(",", " ");
$("#competencesAd").append("<div id='competence_ad_"+competence.code+"' name='competences_ad[]'><input type='checkbox' "+checked+" onChange='genererCompetences(this);' id='competence_" + competence
.code + "' value='" +chaine+"_"+ competence.code + "'> " + competence.libelle + "<br/></div>");
$("#competencesAdPopup").append("<div id='competence_ad_popup_"+competence.code+"'><input type='checkbox' "+checked+" onChange='genererCompetences(this);' id='competencepopup_" + competence
.code + "' value='" + competence.code + "'> " + competence.libelle + "<br/></div>");
//On n'affiche pas ces competences (meme les competences clé) sur le formulaire de base
//if (competence.competenceCle == false) {
$("#competence_ad_"+competence.code).hide();
//}
});
});
$("#competencesButtonAd").show();
if(type=="init"){
const obj = JSON.parse($("#ad_soft_competences").val());
@@ -627,6 +668,7 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
}
//on génere le json qui va remplir le champ ad_soft_competences
genererJson();
$('#loadingDiv').hide();
})
//Ce code sera exécuté en cas d'échec - L'erreur est passée à fail()
@@ -637,10 +679,10 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
if ($("#saisie").val() != "") {
// si il y a un pb avec l'api pole emploi, on affiche ce message
$("#competencesAdMessage").html(
"Une erreur est survenue dans la recherche du métier de rattachement. <a href='#' onclick='chargerCompetences();'><i class='fa fa-refresh fa-spin fa-fw'></i>Cliquez ici pour relancer la recherche</a> "
"Une erreur est survenue dans la recherche du métier de rattachement. <a href='#' onclick='chargerCompetences();'><br/><i class='fa fa-refresh fa-spin fa-fw'></i>Cliquez ici pour relancer la recherche</a> "
);
}
$('#loadingDiv').hide();
console.log("La requête s'est terminée en échec. Infos : " + JSON.stringify(error));
})
@@ -669,6 +711,7 @@ Afin de créer votre annonce, renseignez lensemble des champs relatifs au pos
}
}else{
$("#competence_" + id).prop("checked", false);
$("#competence_ad_" + id).hide();
$("#competencepopup_" + id).prop("checked", false);
}
// on génere le json a chaque fois
@@ -4,7 +4,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item active">Offres d'emploi</li>
</ol>
<!-- END BREADCRUMB -->
@@ -9,7 +9,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item active">Candidatures</li>
</ol>
<!-- END BREADCRUMB -->
@@ -17,7 +17,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item ">Candidatures!</li>
<li class="breadcrumb-item active"><a
href="{{ path('company_ad_answer_list',{'id':answer.ad.id}) }}">{{ answer.ad.title }}</a>
@@ -17,7 +17,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item "><a href="{{ path('company_answer_list') }}">Candidatures</a></li>
<li class="breadcrumb-item"><a
href="{{ path('company_ad_answer_list',{'id':answer.ad.id}) }}">{{ answer.ad.title }}
@@ -51,7 +51,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item"><a href="{{ path('company_ad') }}">Offres d'emploi</a></li>
</ol>
@@ -58,21 +58,21 @@
{% block javascripts %}
{{ parent() }}
<script src="{{ asset('/js/vendors/Chart.bundle.min.js') }}"></script>
{# <script src="{{ asset('/js/vendors/Chart.bundle.min.js') }}"></script> #}
<script type="text/javascript">
var currentMonth = '{{ "now"|date("m") }}';
var arrayRecords;
var ctx, myChart, arrayCurrentsLabel, arrayCurrentsAdsValues, arrayCurrentsCompanyValues, donughtRecords;
{# var ctx, myChart, arrayCurrentsLabel, arrayCurrentsAdsValues, arrayCurrentsCompanyValues, donughtRecords; #}
var sumVisitsAds = 0;
var sumCompanyValues = 0;
function loadChartData() {
{# function loadChartData() {
setArrayValues();
myChart.update();
myDoughnutChart.update();
}
} #}
function getChartData(date1, date2) {
{# function getChartData(date1, date2) {
$.ajax({
type: "POST",
url: '{{ path("company_ajax_dashboard") }}',
@@ -89,9 +89,9 @@
$('.fa-refresh').hide();
}
});
}
} #}
document.addEventListener("DOMContentLoaded", function (event) {
{# document.addEventListener("DOMContentLoaded", function (event) {
$('.fa-refresh').hide();
getChartData(0, 0);
configDatePicker = {
@@ -114,9 +114,9 @@
getChartData(date1, date2);
});
$('.apply-btn').attr('value', 'Valider');
});
}); #}
function setArrayValues() {
{# function setArrayValues() {
arrayCurrentsLabel = [];
arrayCurrentsAdsValues = [];
arrayCurrentsCompanyValues = [];
@@ -233,6 +233,6 @@
animateScale: true
}
}
});
}); #}
</script>
{% endblock %}
@@ -17,7 +17,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item active">Profil</li>
</ol>
<!-- END BREADCRUMB -->
@@ -12,7 +12,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item active">Profil</li>
</ol>
<!-- END BREADCRUMB -->
@@ -8,7 +8,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item active">Utilisateurs</li>
</ol>
<!-- END BREADCRUMB -->
@@ -4,7 +4,7 @@
<div class="inner">
<!-- START BREADCRUMB -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Accueil</a></li>
<li class="breadcrumb-item"><a href="/entreprise/me/">Accueil</a></li>
<li class="breadcrumb-item active">Utilisateurs</li>
</ol>
<!-- END BREADCRUMB -->
@@ -19,7 +19,8 @@
<!-- Title -->
<header class="text-center mb-5">
<h2 class="h4 mb-0">Connexion</h2>
<p>Connectez-vous pour gérer votre compte</p>
<p>Connectez-vous pour gérer votre compte </p>
{% if erreur %}<p class="text-danger">Votre dernière tentative de connexion a échoué. Vérifiez votre email ou votre mot de passe</p>{% endif %}
</header>
@@ -17,8 +17,67 @@
data-arrow-left-classes="fa fa-arrow-left u-slick__arrow-classic-inner bg-white text-dark left-0 ml-md-n9"
data-arrow-right-classes="fa fa-arrow-right u-slick__arrow-classic-inner bg-white text-dark right-0 mr-md-n9"
data-nav-for="#sliderSyncingThumb2">
<div class="js-slide bg-img-hero bg-img-hero-center gradient-overlay-half-black-v1"
style="background-image: url({{ asset('v2/temoignages/pontivy-temoignage-image.jpg') }});">
<div class="w-md-80 w-lg-50 text-white space-2 px-9">
<h3 class="h2 text-lh-xs mb-4">Pontivy Communauté</h3>
<p class="text-white-70 mb-4">Christine Le Strat & Kévin Nado</p>
<a class="js-fancybox text-white" href="javascript:;"
data-src="https://www.youtube.com/watch?v=ugXui7ICJeM?autoplay=1" data-speed="700"
data-animate-in="zoomIn" data-animate-out="zoomOut" data-caption="Témoignage">
Voir le témoignage
<i class="u-icon u-icon--sm u-icon--white-soft rounded-circle ml-2">
<i class="u-icon__inner svg-icon svg-icon-xs text-white">
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect x="0" y="0" width="24" height="24"></rect>
<path
d="M9.82866499,18.2771971 L16.5693679,12.3976203 C16.7774696,12.2161036 16.7990211,11.9002555 16.6175044,11.6921539 C16.6029128,11.6754252 16.5872233,11.6596867 16.5705402,11.6450431 L9.82983723,5.72838979 C9.62230202,5.54622572 9.30638833,5.56679309 9.12422426,5.7743283 C9.04415337,5.86555116 9,5.98278612 9,6.10416552 L9,17.9003957 C9,18.1765381 9.22385763,18.4003957 9.5,18.4003957 C9.62084305,18.4003957 9.73759731,18.3566309 9.82866499,18.2771971 Z"
fill="#000000"></path>
</g>
</svg>
</i>
</i>
</a>
</div>
</div>
<div class="js-slide bg-img-hero bg-img-hero-center gradient-overlay-half-black-v1"
style="background-image: url({{ asset('v2/temoignages/temoignage-mma-questembert.jpg') }});">
<div class="w-md-80 w-lg-50 text-white space-2 px-9">
<h3 class="h2 text-lh-xs mb-4">MMA Questembert</h3>
<p class="text-white-70 mb-4"> Stephane David, Agent Général d'Assurances</p>
<a class="js-fancybox text-white" href="javascript:;"
data-src="https://www.youtube.com/watch?v=0bbNdf4qAng?autoplay=1" data-speed="700"
data-animate-in="zoomIn" data-animate-out="zoomOut" data-caption="Témoignage">
Voir le témoignage
<i class="u-icon u-icon--sm u-icon--white-soft rounded-circle ml-2">
<i class="u-icon__inner svg-icon svg-icon-xs text-white">
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect x="0" y="0" width="24" height="24"></rect>
<path
d="M9.82866499,18.2771971 L16.5693679,12.3976203 C16.7774696,12.2161036 16.7990211,11.9002555 16.6175044,11.6921539 C16.6029128,11.6754252 16.5872233,11.6596867 16.5705402,11.6450431 L9.82983723,5.72838979 C9.62230202,5.54622572 9.30638833,5.56679309 9.12422426,5.7743283 C9.04415337,5.86555116 9,5.98278612 9,6.10416552 L9,17.9003957 C9,18.1765381 9.22385763,18.4003957 9.5,18.4003957 C9.62084305,18.4003957 9.73759731,18.3566309 9.82866499,18.2771971 Z"
fill="#000000"></path>
</g>
</svg>
</i>
</i>
</a>
</div>
</div>
<div class="js-slide bg-img-hero bg-img-hero-center gradient-overlay-half-black-v1"
style="background-image: url({{ asset('v2/temoignages/mgdis-temoignage-image.jpg') }});">
<div class="w-md-80 w-lg-50 text-white space-2 px-9">
<h3 class="h2 text-lh-xs mb-4">MGDIS</h3>
<p class="text-white-70 mb-4">Simona Vasile-Martin, Responsable Marketing</p>
@@ -100,6 +159,7 @@
<div class="js-slide bg-img-hero bg-img-hero-center gradient-overlay-half-black-v1"
style="background-image: url({{ asset('v2/temoignages/intermarche-temoignage-image.jpg') }});">
<div class="w-md-80 w-lg-50 text-white space-2 px-9">
<h3 class="h2 text-lh-xs mb-4">Intermarché LAI</h3>
<p class="text-white-70 mb-4">Ludovic Chamoin-Foucaut, Responsable Ressources Humaines</p>
@@ -135,6 +195,43 @@
<div id="sliderSyncingThumb2"
class="js-slick-carousel u-slick u-slick--gutters-2 u-slick--video w-50 w-lg-30 mx-auto" data-infinite="true"
data-slides-show="3" data-is-thumbs="true" data-center-mode="true" data-nav-for="#sliderSyncingNav2">
<div class="js-slide rounded overflow-hidden">
<img class="img-fluid" src="{{ asset('v2/temoignages/pontivy-communaute-temoignage-vignette.jpg') }}"
alt="Image Description">
<i class="u-icon u-icon--sm u-icon--dark-soft rounded-circle u-slick--video__player">
<i class="u-icon__inner svg-icon svg-icon-xs text-white">
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect x="0" y="0" width="24" height="24"></rect>
<path
d="M9.82866499,18.2771971 L16.5693679,12.3976203 C16.7774696,12.2161036 16.7990211,11.9002555 16.6175044,11.6921539 C16.6029128,11.6754252 16.5872233,11.6596867 16.5705402,11.6450431 L9.82983723,5.72838979 C9.62230202,5.54622572 9.30638833,5.56679309 9.12422426,5.7743283 C9.04415337,5.86555116 9,5.98278612 9,6.10416552 L9,17.9003957 C9,18.1765381 9.22385763,18.4003957 9.5,18.4003957 C9.62084305,18.4003957 9.73759731,18.3566309 9.82866499,18.2771971 Z"
fill="#000000"></path>
</g>
</svg>
</i>
</i>
</div>
<div class="js-slide rounded overflow-hidden">
<img class="img-fluid" src="{{ asset('v2/temoignages/mma-temoignage-vignette.jpg') }}"
alt="Image Description">
<i class="u-icon u-icon--sm u-icon--dark-soft rounded-circle u-slick--video__player">
<i class="u-icon__inner svg-icon svg-icon-xs text-white">
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect x="0" y="0" width="24" height="24"></rect>
<path
d="M9.82866499,18.2771971 L16.5693679,12.3976203 C16.7774696,12.2161036 16.7990211,11.9002555 16.6175044,11.6921539 C16.6029128,11.6754252 16.5872233,11.6596867 16.5705402,11.6450431 L9.82983723,5.72838979 C9.62230202,5.54622572 9.30638833,5.56679309 9.12422426,5.7743283 C9.04415337,5.86555116 9,5.98278612 9,6.10416552 L9,17.9003957 C9,18.1765381 9.22385763,18.4003957 9.5,18.4003957 C9.62084305,18.4003957 9.73759731,18.3566309 9.82866499,18.2771971 Z"
fill="#000000"></path>
</g>
</svg>
</i>
</i>
</div>
<div class="js-slide rounded overflow-hidden">
<img class="img-fluid" src="{{ asset('v2/temoignages/mgdis-temoignage-vignette.jpg') }}"
alt="Image Description">
@@ -36,8 +36,7 @@
<li><a class="list-group-item list-group-item-action" href="{{ path('cgu') }}" target="_blank">CGU</a></li>
<li><a class="list-group-item list-group-item-action" href="{{ path('politique-confidentialite') }}" target="_blank">Politique de confidentialité</a></li>
<li><a class="list-group-item list-group-item-action" href="{{ path('abonnement') }}" >Tarifs</a></li>
<li><a class="list-group-item list-group-item-action" href="https://blog.talentstube.com/contact" target="_blank"
">Contact</a></li>
<li><a class="list-group-item list-group-item-action" href="https://blog.talentstube.com/contact" target="_blank">Contact</a></li>
</ul>
<!-- End Links -->
</div>
@@ -86,7 +85,7 @@
<p class="small text-muted">Tous droits réservés. &copy; 2020 Talents Tube.</p>
<p class="small text-muted">Tous droits réservés.. &copy; 2020 Talents Tube. V{{ version }}</p>
</div>
</div>
</div>
@@ -80,6 +80,8 @@ twig:
globals:
push_public_key: "%push_params.public_key%"
fairlane_cookie_consent: '@fairlane_cookie_consent.twig'
version: 'V2.4.2'
# Swiftmailer Configuration
@@ -26,6 +26,7 @@ parameters:
elastic_host: tt-website.elasticsearch.dev
elastic_port: 9200
delivery_addresses: l.laniau@talentstube.com
app.version: 2.3.6
push_params:
push_notification_file_path: '%kernel.root_dir%/../web/push/'
push_network_config:
@@ -35,4 +36,4 @@ parameters:
ttl: 300
urgency: high
topic: Emploi
push_params.public_key: BNFyiyPiLH97Dgc0m1vXluUNaCN6y3Hkgd4YcqS2lVkP8my3tq2D5gM5g7cY6R4VxC7GljSzkLRu+k+oO+2TtjU=
push_params.public_key: BNFyiyPiLH97Dgc0m1vXluUNaCN6y3Hkgd4YcqS2lVkP8my3tq2D5gM5g7cY6R4VxC7GljSzkLRu+k+oO+2TtjU=
@@ -31,6 +31,7 @@ parameters:
elastic_host: tt-website.elasticsearch.preprod
elastic_port: 9200
delivery_addresses: l.laniau@talentstube.com
app.version: 2.3.6
push_params:
push_notification_file_path: '%kernel.root_dir%/../web/push/'
push_network_config:
@@ -30,6 +30,7 @@ parameters:
elastic_host: tt-website.elasticsearch.prod
elastic_port: 9200
delivery_addresses: l.laniau@talentstube.com
app.version: 2.4.0
push_params:
push_notification_file_path: '%kernel.root_dir%/../web/push/'
push_network_config:
+2 -1
View File
@@ -60,7 +60,8 @@
"willdurand/hateoas-bundle": "^1.4",
"lexik/jwt-authentication-bundle": "^2.5",
"nelmio/cors-bundle": "^1.5",
"onurb/doctrine-yuml-bundle": "^1.1"
"onurb/doctrine-yuml-bundle": "^1.1",
"mailjet/mailjet-apiv3-php": "^1.5"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
@@ -130,6 +130,32 @@ class AdController extends Controller
$teletravail = $form['teletravail']->getData();
$arrayExtra['teletravail'] = $teletravail;
$ad->setExtra($arrayExtra);
//US 340
$competences = $form['competences']->getData();
$competencesList = explode(",", $competences);
//dump($competencesList);
//$competencesJson = "{";
$array = Array ();
for ($i = 0; $i < count($competencesList)-1; $i++) {
//dump($i);
//$competence = split("_", $competencesList);
//dump($competencesList[$i]);
list($competenceLibelle, $competenceId) =
explode("_", $competencesList[$i]);
if($competenceLibelle && $competenceId){
$array[] = Array (
intval($competenceId) => $competenceLibelle);
}
}
$ad->setCompetences(
$array
);
$adManager = $this->get('app.ad_manager');
$adManager->updateAd($ad);
return $this->redirectToRoute('create_media', array('id' => $ad->getId()));
@@ -215,7 +215,8 @@ class AnswerController extends AbstractController
case 'actions':
{
$responseTemp = "Actions :<select class='changeStatus' onChange='changerStatut(this.value, ".$answer->getId().")' name='changeStatus' data-id=".$answer->getId()."><option value='null'>choisir</option><option value='SENDED'>Envoyé</option><option value='DRAFT'>Brouillon</option><option value='REFUSED'>Refuser</option></select>";
$responseTemp .= "<br>";
$responseTemp .= "<a class='delete-answer' href='#' onClick='verifierDelete(".$answer->getId().")' data-toggle='tooltip' title='Supprimer'>Supprimer <i class='fa fa-trash'></i></a>";
break;
}
@@ -160,32 +160,34 @@ class AnswerController extends FOSRestController
$message->setVideo($video);
$em->persist($message);
$em->flush();*/
$mailManager = $this->get('app.mail_manager');
foreach ($usersCompany as $user){
$link = $this->generateUrl('company_answer_show', array('id' => $answer->getId()), UrlGeneratorInterface::ABSOLUTE_URL);
$mailManager->sendMail(
'Candidature TalentsTube ',
'<div style="margin:0 auto;max-width:600px;background:#FFFFFF;"><table class="" cellpadding="0" cellspacing="0" style="width:100%;font-size:0px;background:#FFFFFF;" align="center"><tbody><tr><td style="text-align:center;vertical-align:top;font-size:0;padding:0px;"><!--[if mso]>
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="width:600px;">
<![endif]--><div style="vertical-align:top;display:inline-block;font-size:13px;text-align:left;width:100%;" class="mj-column-per-100" aria-labelledby="mj-column-per-100"><table width="100%"><tbody><tr><td style="font-size:0;padding:0px;" align="center"><table cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0px;" align="center"><tbody><tr><td><img alt="" src="' . $img . '" style="border:none;display:block;outline:none;text-decoration:none;width:100%;max-width:600px;height:auto;" width="600" height="auto"></td></tr></tbody></table></td></tr></tbody></table></div><!--[if mso]>
</td></tr></table>
<![endif]--></td></tr></tbody></table></div>
if ($this->container->get( 'kernel' )->getEnvironment() != "dev") {
$mailManager = $this->get('app.mail_manager');
foreach ($usersCompany as $user){
$link = $this->generateUrl('company_answer_show', array('id' => $answer->getId()), UrlGeneratorInterface::ABSOLUTE_URL);
$mailManager->sendMail(
'Candidature TalentsTube ',
'<div style="margin:0 auto;max-width:600px;background:#FFFFFF;"><table class="" cellpadding="0" cellspacing="0" style="width:100%;font-size:0px;background:#FFFFFF;" align="center"><tbody><tr><td style="text-align:center;vertical-align:top;font-size:0;padding:0px;"><!--[if mso]>
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="width:600px;">
<![endif]--><div style="vertical-align:top;display:inline-block;font-size:13px;text-align:left;width:100%;" class="mj-column-per-100" aria-labelledby="mj-column-per-100"><table width="100%"><tbody><tr><td style="font-size:0;padding:0px;" align="center"><table cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0px;" align="center"><tbody><tr><td><img alt="" src="' . $img . '" style="border:none;display:block;outline:none;text-decoration:none;width:100%;max-width:600px;height:auto;" width="600" height="auto"></td></tr></tbody></table></td></tr></tbody></table></div><!--[if mso]>
</td></tr></table>
<![endif]--></td></tr></tbody></table></div>
<div style="margin:0 auto;max-width:600px;background:#FFFFFF;"><table class="" cellpadding="0" cellspacing="0" style="width:100%;font-size:0px;background:#FFFFFF;" align="center"><tbody><tr><td style="text-align:center;vertical-align:top;font-size:0;padding:0px;"><!--[if mso]>
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="width:600px;">
<![endif]--><div style="vertical-align:top;display:inline-block;font-size:13px;text-align:left;width:100%;" class="mj-column-per-100" aria-labelledby="mj-column-per-100"><table width="100%"><tbody><tr><td style="font-size:0;padding:20px 35px 20px 35px;" align="left"><div class="mj-content" style="cursor:auto;color:#534F4F;font-family:Trebuchet,Helvetica,sans-serif;font-size:14px;line-height:22px;"><p>Bonjour ' . $user->getLastname() . ' ' . $user->getFirstname() . ',</p>
<p>Le talent ' . $answer->getUser()->getFirstname() . ' ' . $answer->getUser()->getLastname() . ' a répondu à votre annonce ' . $title . '.</p></div></td></tr></tbody></table></div><!--[if mso]>
</td></tr></table>
<![endif]--></td></tr></tbody></table></div>
<div style="margin:0 auto;max-width:600px;background:#FFFFFF;"><table class="" cellpadding="0" cellspacing="0" style="width:100%;font-size:0px;background:#FFFFFF;" align="center"><tbody><tr><td style="text-align:center;vertical-align:top;font-size:0;padding:0px;"><!--[if mso]>
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="width:600px;">
<![endif]--><div style="vertical-align:top;display:inline-block;font-size:13px;text-align:left;width:100%;" class="mj-column-per-100" aria-labelledby="mj-column-per-100"><table width="100%"><tbody><tr><td style="font-size:0;padding:20px 35px 20px 35px;" align="left"><div class="mj-content" style="cursor:auto;color:#534F4F;font-family:Trebuchet,Helvetica,sans-serif;font-size:14px;line-height:22px;"><p>Bonjour ' . $user->getLastname() . ' ' . $user->getFirstname() . ',</p>
<p>Le talent ' . $answer->getUser()->getFirstname() . ' ' . $answer->getUser()->getLastname() . ' a répondu à votre annonce ' . $title . '.</p></div></td></tr></tbody></table></div><!--[if mso]>
</td></tr></table>
<![endif]--></td></tr></tbody></table></div>
<div style="margin:0 auto;max-width:600px;background:#FFFFFF;"><table class="" cellpadding="0" cellspacing="0" style="width:100%;font-size:0px;background:#FFFFFF;" align="center"><tbody><tr><td style="text-align:center;vertical-align:top;font-size:0;padding:0px 0px 40px 0px;"><!--[if mso]>
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="width:600px;">
<![endif]--><div style="vertical-align:top;display:inline-block;font-size:13px;text-align:left;width:100%;" class="mj-column-per-100" aria-labelledby="mj-column-per-100"><table width="100%"><tbody><tr><td style="font-size:0;padding:15px 30px;" align="center"><table cellpadding="0" cellspacing="0" style="border:none;border-radius:30px;" align="center"><tbody><tr><td style="background:#1689FB;border-radius:30px;color:#FFFFFF;cursor:auto;" align="center" valign="middle" bgcolor="#1689FB"><a class="mj-content" href="' . $link . '" style="display:inline-block;text-decoration:none;background:#1689FB;border:1px solid #1689FB;border-radius:30px;color:#FFFFFF;font-family:Trebuchet,Helvetica,sans-serif;font-size:14px;font-weight:normal;padding:15px 30px;" target="_blank">Découvrir le talent</a></td></tr></tbody></table></td></tr></tbody></table></div><!--[if mso]>
</td></tr></table>
<![endif]--></td></tr></tbody></table></div>',
$user,
'contact_default'
);
<div style="margin:0 auto;max-width:600px;background:#FFFFFF;"><table class="" cellpadding="0" cellspacing="0" style="width:100%;font-size:0px;background:#FFFFFF;" align="center"><tbody><tr><td style="text-align:center;vertical-align:top;font-size:0;padding:0px 0px 40px 0px;"><!--[if mso]>
<table border="0" cellpadding="0" cellspacing="0"><tr><td style="width:600px;">
<![endif]--><div style="vertical-align:top;display:inline-block;font-size:13px;text-align:left;width:100%;" class="mj-column-per-100" aria-labelledby="mj-column-per-100"><table width="100%"><tbody><tr><td style="font-size:0;padding:15px 30px;" align="center"><table cellpadding="0" cellspacing="0" style="border:none;border-radius:30px;" align="center"><tbody><tr><td style="background:#1689FB;border-radius:30px;color:#FFFFFF;cursor:auto;" align="center" valign="middle" bgcolor="#1689FB"><a class="mj-content" href="' . $link . '" style="display:inline-block;text-decoration:none;background:#1689FB;border:1px solid #1689FB;border-radius:30px;color:#FFFFFF;font-family:Trebuchet,Helvetica,sans-serif;font-size:14px;font-weight:normal;padding:15px 30px;" target="_blank">Découvrir le talent</a></td></tr></tbody></table></td></tr></tbody></table></div><!--[if mso]>
</td></tr></table>
<![endif]--></td></tr></tbody></table></div>',
$user,
'contact_default'
);
}
}
$status = array('status' => "success", "idAnswer" => $answer->getId()/*, "idMessage" => $message->getId()*/);
}
@@ -320,6 +322,7 @@ class AnswerController extends FOSRestController
$status = array('status' => "success", "companyUpdated" => false);
//dump($file);
// If a file was uploaded
//TODO Controle sur l'extension du fichier (pdf, word)
if (!is_null($file)) {
$companyManager = $this->get('app.company_manager');
@@ -67,6 +67,7 @@ class SecurityController extends FOSRestController
$lastname = htmlspecialchars($request->get('lastname'));
$email = htmlspecialchars($request->get('email'));
$password = htmlspecialchars($request->get('password'));
$adId = htmlspecialchars($request->get('adId'));
if (!isset($firstname) || !isset($lastname) || !isset($email) || !isset($password))
$status = array('status' => "failure", 'message' => 'empty parameters');
@@ -75,7 +76,7 @@ class SecurityController extends FOSRestController
$user = $userManager->findUserByEmail($email);
if (isset($user))
$status = array('status' => "failure", 'message' => "L'utilisateur existe déjà.");
$status = array('status' => "failure", 'message' => "L'utilisateur existe déjà!");
else {
$user = $userManager->createUser();
@@ -103,7 +104,7 @@ class SecurityController extends FOSRestController
$userManager->updateUser($user);
}
// $userManager->updatePassword($user);//pas besoin car fait dans updateUser , vraiment bizarre....
$status = array('status' => "success", 'confirmationToken' => $user->getConfirmationToken(), 'email' => $user->getEmail(), 'firstname' => $user->getFirstname(), 'lastname' => $user->getLastname());
$status = array('status' => "success", 'confirmationToken' => $user->getConfirmationToken(), 'email' => $user->getEmail(), 'firstname' => $user->getFirstname(), 'lastname' => $user->getLastname(), 'adId' => $adId);
}
}
return new JsonResponse($status);
@@ -17,6 +17,11 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use AppBundle\Entity\Mailjet;
use AppBundle\Entity\Response;
use AppBundle\Entity\Resources;
use AppBundle\Entity\Config;
use AppBundle\Entity\Client;
class CompanyController extends Controller
{
@@ -222,16 +227,30 @@ class CompanyController extends Controller
'message' => $message,
'type' => 'html'
));
$body ="";
$email = \Swift_Message::newInstance()
->setSubject("Rejoignez l'équipe ".$company->getBrandName()." sur Talents Tube." )
->setFrom($this->getParameter('mailer_user'))
->setReplyTo($this->getParameter('mailer_user'))
->setTo($user->getEmail())
->setBody($plainView, 'text/html')
// ->addPart($plainView, 'text/plain')
;
$retour = $this->get('mailer')->send($email);
//$body ="";
$mj = new Client('355697fac93fca865660734b4fdffaeb', 'ddecf75321ca89c09e561857b13534c8');
$body = [
'FromEmail' => $this->getParameter('mailer_user'),
'FromName' => "Talents Tube",
'Subject' => "Rejoignez l'équipe ".$company->getBrandName()." sur Talents Tube.",
//'Text-part' => "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
'Html-part' => $plainView,
'Recipients' => [
['Email' => $user->getEmail()]
]
];
$response = $mj->post(Resources::$Email, ['body' => $body]);
$response->success() && var_dump($response->getData());
// $email = \Swift_Message::newInstance()
// ->setSubject("Rejoignez l'équipe ".$company->getBrandName()." sur Talents Tube." )
// ->setFrom($this->getParameter('mailer_user'))
// ->setReplyTo($this->getParameter('mailer_user'))
// ->setTo($user->getEmail())
// ->setBody($plainView, 'text/html')
// // ->addPart($plainView, 'text/plain')
// ;
// $retour = $this->get('mailer')->send($email);
//var_dump($mailManager);
return $this->redirectToRoute('users');
}else{
@@ -6,7 +6,11 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Security;
use AppBundle\Entity\Mailjet;
use AppBundle\Entity\Response;
use AppBundle\Entity\Resources;
use AppBundle\Entity\Config;
use AppBundle\Entity\Client;
class DefaultController extends Controller
{
/**
@@ -69,7 +73,27 @@ class DefaultController extends Controller
*/
public function homepagev2Action(Request $request)
{
//$em = $this->getDoctrine()->getManager();
//US444
// $mj = new Client('805b8adce80bc6aa9422ddff20bb4171', 'f3bce955f21bc9456d65245c50e8c512');
// $body = [
// 'FromEmail' => "l.laniau@talentstube.com",
// 'FromName' => "Mailjet Pilot",
// 'Subject' => "Your email flight plan!",
// 'MJ-TemplateID' =>2087555 ,
// 'MJ-TemplateLanguage' => true,
// 'Recipients' => [
// ['Email' => "l.laniau@talentstube.com", 'Vars' => ['lien' => 'www.talentstube.com']]
// ]
// ];
// $response = $mj->post(Resources::$Email, ['body' => $body]);
// $response->success() && var_dump($response->getData());
// dump($response);
//FIN US444
//$em = $this->getDoctrine()->getManager();
// $ads = $em->getRepository('AppBundle:Ad')->findBy(array("status" => "PUBLISHED", "emphasis" => true, "isPromoted" => false), array('emphasisOrder' => 'DESC'));
// if (!$ads) {
// $ads = $em->getRepository('AppBundle:Ad')->findBy(array("status" => "PUBLISHED", "isPromoted" => false), array('id' => 'DESC'));
@@ -104,21 +128,27 @@ class DefaultController extends Controller
// foreach ($territories as $t) {
// $mediaManager->getThumbnails($t);
// }
//dump($this->container->get( 'kernel' )->getEnvironment());
// $form = $this->createForm(AdSearchType::class);
$params = $this->getParams($request);
$usename = $params["lastUsername"];
$csrfToken = $params["csrfToken"];
$error = $params["error"];
$destination_login = "admin/dashboard";
$erreur = false;
if($request->query->get('erreur')){
$erreur = $request->query->get('erreur');
}
//$mj = new \Mailjet\Client('805b8adce80bc6aa9422ddff20bb4171', 'f3bce955f21bc9456d65245c50e8c512');
//dump($mj);
//var_dump($mailManager);
return $this->render(
'defaultv2/accueil/index.html.twig', [
'last_username' => $usename,
'csrf_token' => $csrfToken,
'error' => $error,
'destination_login' => $destination_login
'destination_login' => $destination_login,
'erreur' => $erreur
//'ads' => $ads,
//'companies' => $arrayCompany,
//'talents' => $arrayTalents,
@@ -331,17 +361,17 @@ class DefaultController extends Controller
return $this->redirectToRoute('admin_dashboard');
} elseif ($user->hasRole('ROLE_TALENT')) {
return $this->redirectToRoute('talent_dashboard');
return $this->redirect('https://www.talentstube.com');
//return $this->redirectToRoute('talent_dashboard');
} elseif ($user->hasRole('ROLE_COMPANY')) {
return $this->redirectToRoute('company_dashboard');
return $this->redirectToRoute('company_profile');
}
} else {
return $this->redirectToRoute('homepage');
return $this->redirectToRoute('/homepage');
}
return $this->redirectToRoute('homepage');
return $this->redirectToRoute('/homepage');
}
@@ -148,7 +148,7 @@ class Ad
* @var array
*
* @ORM\Column(name="competences", type="json_document", nullable=true, options={"jsonb":true})
*
* @Groups({"ad_detail", "ad_list", "answer_detail", "company_detail"})
*/
private $competences;
@@ -0,0 +1,425 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2013 Mailgun
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace AppBundle\Entity;
class Client
{
const WRAPPER_VERSION = Config::WRAPPER_VERSION;
/**
* connect_timeout: (float, default=2) Float describing the number of
* seconds to wait while trying to connect to a server. Use 0 to wait
* indefinitely (the default behavior).
*/
const CONNECT_TIMEOUT = 'connect_timeout';
/**
* timeout: (float, default=15) Float describing the timeout of the
* request in seconds. Use 0 to wait indefinitely (the default behavior).
*/
const TIMEOUT = 'timeout';
/**
* proxy: (array, default=none) Array describing the proxy options used by guzzle client
* See guzzle-http for specification.
*/
const PROXY = 'proxy';
private $apikey;
private $apisecret;
private $apitoken;
private $version = Config::MAIN_VERSION;
private $url = Config::MAIN_URL;
private $secure = Config::SECURED;
private $call = true;
private $settings = [];
private $changed = false;
private $requestOptions = [
self::TIMEOUT => 15,
self::CONNECT_TIMEOUT => 2,
];
private $smsResources = [
'send',
'sms',
'sms-send',
];
private $dataAction = [
'csverror/text:csv',
'csvdata/text:plain',
'JSONError/application:json/LAST',
];
/**
* Client constructor requires:.
*
* @param string $key Mailjet API Key
* @param string|null $secret Mailjet API Secret
* @param bool $call performs the call or not
* @param array $settings
*/
public function __construct(string $key, string $secret = null, bool $call = true, array $settings = [])
{
$this->setAuthentication($key, $secret, $call, $settings);
}
/**
* Trigger a POST request.
*
* @param array $resource Mailjet Resource/Action pair
* @param array $args Request arguments
* @param array $options
* @return Response
*/
public function post(array $resource, array $args = [], array $options = []): Response
{
if (!empty($options)) {
$this->setOptions($options, $resource);
}
$result = $this->_call('POST', $resource[0], $resource[1], $args);
if (!empty($this->changed)) {
$this->setSettings();
}
return $result;
}
/**
* Trigger a GET request.
*
* @param array $resource Mailjet Resource/Action pair
* @param array $args Request arguments
* @param array $options
* @return Response
*/
public function get(array $resource, array $args = [], array $options = []): Response
{
if (!empty($options)) {
$this->setOptions($options, $resource);
}
$result = $this->_call('GET', $resource[0], $resource[1], $args);
if (!empty($this->changed)) {
$this->setSettings();
}
return $result;
}
/**
* Trigger a POST request.
*
* @param array $resource Mailjet Resource/Action pair
* @param array $args Request arguments
* @param array $options
* @return Response
*/
public function put(array $resource, array $args = [], array $options = []): Response
{
if (!empty($options)) {
$this->setOptions($options, $resource);
}
$result = $this->_call('PUT', $resource[0], $resource[1], $args);
if (!empty($this->changed)) {
$this->setSettings();
}
return $result;
}
/**
* Trigger a GET request.
*
* @param array $resource Mailjet Resource/Action pair
* @param array $args Request arguments
* @param array $options
* @return Response
*/
public function delete(array $resource, array $args = [], array $options = []): Response
{
if (!empty($options)) {
$this->setOptions($options, $resource);
}
$result = $this->_call('DELETE', $resource[0], $resource[1], $args);
if (!empty($this->changed)) {
$this->setSettings();
}
return $result;
}
/**
* Sets if we need to use https or http protocol while using API Url.
*
* @param bool|mixed $bIsSecured True use https / false use http
*
* @return bool true if we set value false otherwise
*/
public function setSecureProtocol($bIsSecured = null): bool
{
if (\is_bool($bIsSecured)) {
$this->secure = $bIsSecured;
return true;
}
return false;
}
/**
* Set HTTP request Timeout.
* @param int $timeout
*/
public function setTimeout(int $timeout): void
{
$this->requestOptions[self::TIMEOUT] = $timeout;
}
/**
* Set HTTP proxy options
* See: http://docs.guzzlephp.org/en/stable/request-options.html#proxy.
* @param array $proxyArray
*/
public function setHttpProxy(array $proxyArray): void
{
$this->requestOptions[self::PROXY] = $proxyArray;
}
/**
* Set HTTP connection Timeout.
* @param int $timeout
*/
public function setConnectionTimeout(int $timeout): void
{
$this->requestOptions[self::CONNECT_TIMEOUT] = $timeout;
}
/**
* Get HTTP request Timeout
* $return int|null.
*/
public function getTimeout(): ?int
{
return $this->requestOptions[self::TIMEOUT];
}
/**
* Get HTTP connection Timeout
* $return int|null.
*/
public function getConnectionTimeout(): ?int
{
return $this->requestOptions[self::CONNECT_TIMEOUT];
}
/**
* Add a HTTP request option.
*
* @param string $key
* @param mixed $value
* [IMPORTANT]Default options will be overwritten
* if such option is provided
*
* @see \GuzzleHttp\RequestOptions for a list of available request options.
*/
public function addRequestOption(string $key, $value): void
{
if ((null !== $key) && (null !== $value)) {
$this->requestOptions[$key] = $value;
}
}
/**
* Get HTTP connection options
* $return array.
*/
public function getRequestOptions(): array
{
return $this->requestOptions;
}
/**
* Set auth.
*
* @param string $key
* @param string|null $secret
* @param bool $call
* @param array $settings
*/
private function setAuthentication(string $key, string $secret, bool $call, array $settings = []): void
{
$isBasicAuth = $this->isBasicAuthentication($key, $secret);
if ($isBasicAuth) {
$this->apikey = $key;
$this->apisecret = $secret;
} else {
$this->apitoken = $key;
$this->version = Config::SMS_VERSION;
}
$this->initSettings($call, $settings);
$this->setSettings();
}
/**
* Magic method to call a mailjet resource.
*
* @param string $method Http method
* @param string $resource mailjet resource
* @param string $action mailjet resource action
* @param array $args Request arguments
*
* @return Response server response
*/
private function _call(string $method, string $resource, string $action, array $args): Response
{
$args = array_merge([
'id' => '',
'actionid' => '',
'filters' => [],
'body' => 'GET' === $method ? null : '{}',
], array_change_key_case($args));
$url = $this->buildURL($resource, $action, (string) $args['id'], $args['actionid']);
$contentType = ('csvdata/text:plain' === $action || 'csverror/text:csv' === $action) ? 'text/plain' : 'application/json';
$isBasicAuth = $this->isBasicAuthentication($this->apikey, $this->apisecret);
$auth = $isBasicAuth ? [$this->apikey, $this->apisecret] : [$this->apitoken];
$request = new Request(
$auth,
$method,
$url,
$args['filters'],
$args['body'],
$contentType,
$this->requestOptions
);
return $request->call($this->call);
}
/**
* Build the base API url depending on wether user need a secure connection
* or not.
*
* @return string the API url;
*/
private function getApiUrl(): string
{
$h = true === $this->secure ? 'https' : 'http';
return sprintf('%s://%s/%s/', $h, $this->url, $this->version);
}
/**
* Checks that both parameters are strings, which means
* that basic authentication will be required.
*
* @param string $key
* @param string $secret
* @return bool flag
*/
private function isBasicAuthentication(string $key, string $secret): bool
{
return !empty($key) && !empty($secret);
}
/**
* Build the final call url without query strings.
*
* @param string $resource Mailjet resource
* @param string $action Mailjet resource action
* @param string $id mailjet resource id
* @param string $actionid mailjet resource actionid
*
* @return string final call url
*/
private function buildURL(string $resource, string $action, string $id, string $actionid): string
{
$path = 'REST';
if (\in_array($resource, $this->smsResources, true)) {
$path = '';
} elseif (\in_array($action, $this->dataAction, true)) {
$path = 'DATA';
} elseif ('v4' === $this->version) {
$path = '';
}
$arrayFilter = [$path, $resource, $id, $action, $actionid];
return $this->getApiUrl().implode('/', array_filter($arrayFilter));
}
/**
* Temporary set the variables generating the url.
*
* @param array $options contain temporary modifications for the client
* @param array $resource may contain the version linked to the resource
*/
private function setOptions(array $options, array $resource): void
{
$this->version = (string) ($options['version'] ?? $resource[2] ?? Config::MAIN_VERSION);
$this->url = (string) ($options['url'] ?? Config::MAIN_URL);
$this->secure = $options['secured'] ?? Config::SECURED;
$this->call = $options['call'] ?? true;
$this->changed = true;
}
/**
* set back the variables generating the url.
*/
private function setSettings(): void
{
if (!empty($this->settings['url']) && \is_string($this->settings['url'])) {
$this->url = $this->settings['url'];
}
if (!empty($this->settings['version']) && \is_string($this->settings['version'])) {
$this->version = $this->settings['version'];
}
if (isset($this->settings['call']) && \is_bool($this->settings['call'])) {
$this->call = $this->settings['call'];
}
if (isset($this->settings['secured']) && \is_bool($this->settings['secured'])) {
$this->secure = $this->settings['secured'];
}
$this->changed = false;
}
/**
* Set a backup if the variables generating the url are change during a call.
* @param bool $call
* @param array $settings
*/
private function initSettings(bool $call, array $settings = []): void
{
$this->settings['url'] = $settings['url'] ?? $this->url;
$this->settings['version'] = $settings['version'] ?? $this->version;
$this->settings['call'] = $call;
$this->settings['secured'] = $settings['secured'] ?? $this->secure;
$this->changed = false;
}
}
@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2013 Mailgun
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace AppBundle\Entity;
class Config
{
const WRAPPER_VERSION = 'v2.0.0';
const USER_AGENT = 'mailjet-apiv3-php/';
const MAIN_VERSION = 'v3';
const MAIN_URL = 'api.mailjet.com';
const SECURED = true;
const SMS_VERSION = 'v4';
}
@@ -0,0 +1,593 @@
<?php
namespace AppBundle\Entity;
/**
* Mailjet Public API
*
* @package API v0.3
* @author Mailjet
* @link http://api.mailjet.com/
*
* For PHP v >= 5.3
*
*/
class Mailjet
{
# Wrapper version, changed for each release
const WRAPPER_VERSION = '1.1.0';
# Mailjet API version
var $version = 'v3';
# Connect with https protocol
var $secure = true;
# Mode debug ? 0 : none; 1 : errors only; 2 : all
var $debug = 0;
# Edit with your Mailjet API keys (you can find them here : https://app.mailjet.com/account/api_keys)
var $apiKey = '';
var $secretKey = '';
// Ressources arrays
/*
* Newsletter resources
*/
private static $_newsletterResources = array(
"newsletterDetailContent",
"newsletterSend",
"newsletterSchedule",
"newsletterTest",
"newsletterStatus"
);
/*
* Contact resources
* "contactManageManyContacts" not in as it is a special case.
*/
private static $_contactResources = array(
"contactManageContactsLists",
"contactGetContactsLists"
);
/*
* Contactslist resources
*/
private static $_contactslistResources = array (
"contactslistManageContact",
"contactslistManageManyContacts"
);
/*
* Template resources
*/
private static $_templateResources = array (
"templateDetailContent"
);
/*
* dns resources
*/
private static $_dnsResources = array (
"dnsCheck"
);
# Constructor function
public function __construct($apiKey = false, $secretKey = false, $preprod = false)
{
if ($apiKey) {
$this->apiKey = $apiKey;
}
if ($secretKey) {
$this->secretKey = $secretKey;
}
$this->apiUrl = $this->getApiUrl($preprod);
$this->wrapperVersion = $this->readWrapperVersion();
}
private function getApiUrl ($preprod)
{
if ($preprod)
{
return (($this->secure) ? 'https' : 'http') . '://api.preprod.mailjet.com/' . $this->version . '0';
}
else
{
return (($this->secure) ? 'https' : 'http') . '://api.mailjet.com/' . $this->version;
}
}
public function curl_setopt_custom_postfields($curl_handle, $postfields, $headers = null) {
$algos = hash_algos();
$hashAlgo = null;
foreach (array('sha1', 'md5') as $preferred) {
if (in_array($preferred, $algos)) {
$hashAlgo = $preferred;
break;
}
}
if ($hashAlgo === null) {
list($hashAlgo) = $algos;
}
$boundary =
'----------------------------' .
substr(hash($hashAlgo, 'cURL-php-multiple-value-same-key-support' . microtime()), 0, 12);
$body = array();
$crlf = "\r\n";
foreach ($postfields as $key => $value) {
if (is_array($value)) {
foreach ($value as $filename => $path) {
// attachment
if (strpos($path, '@') === 0) {
preg_match('/^@(.*?)$/', $path, $matches);
list($dummy, $path) = $matches;
if (is_int($filename)) {
$filename = basename($path);
}
$body[] = '--' . $boundary;
$body[] = 'Content-Disposition: form-data; name="' . $key . '"; filename="' . $filename . '"';
$body[] = 'Content-Type: application/octet-stream';
$body[] = '';
$body[] = file_get_contents($path);
}
// Array of recipients
else if ('to' == $key || 'cc' == $key || 'bcc' == $key) {
$body[] = '--' . $boundary;
$body[] = 'Content-Disposition: form-data; name="' . $key . '"';
$body[] = '';
$body[] = trim($path);
}
}
}
else {
$body[] = '--' . $boundary;
$body[] = 'Content-Disposition: form-data; name="' . $key . '"';
$body[] = '';
$body[] = $value;
}
}
$body[] = '--' . $boundary . '--';
$body[] = '';
$contentType = 'multipart/form-data; boundary=' . $boundary;
$content = join($crlf, $body);
$contentLength = strlen($content);
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array(
'Content-Length: ' . $contentLength,
'Expect: 100-continue',
'Content-Type: ' . $contentType,
));
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $content);
}
public function __call($resource, $args)
{
# Parameters array
$params = (sizeof($args) > 0) ? $args[0] : array();
# Request method, GET by default
if (isset($params["method"]))
{
$request = strtoupper($params["method"]);
unset($params['method']);
}
else
{
$request = 'GET';
}
# Request ID, empty by default
$id = isset($params["ID"]) ? $params["ID"] : '';
/*
Using SendAPI without the "to" parameter but with "cc" AND/OR "bcc"
Our API needs the "to" parameter filled to send email
We give it a default value with an email @example.org. See http://en.wikipedia.org/wiki/Example.com
*/
if ($resource == "sendEmail" && (empty($params["to"]) && (!empty($params["cc"]) || !empty($params["bcc"])))) {
$params["to"] = "mailjet@example.org";
}
if ($id == '')
{
# Request Unique field, empty by default
$unique = isset($params["unique"]) ? $params["unique"] : '';
unset($params["unique"]);
# Make request
$result = $this->sendRequest($resource, $params, $request, $unique);
}
else
{
# Make request
$result = $this->sendRequest($resource, $params, $request, $id);
}
# Return result
$return = ($result === true) ? $this->_response : false;
if ($this->debug == 2 || ($this->debug == 1 && $return == false)) {
$this->debug();
}
return $return;
}
/**
*
* @param string $method REST or DATA
* @param string $resourceBase Base resource
* @param int $resourceID Base resource ID
* @param string $action Action on resource
*
* @return string Returns the call's url.
*/
private function makeUrl($method, $resourceBase, $resourceID, $action)
{
return $this->apiUrl.'/'.$method.'/'.$resourceBase.'/'.$resourceID.'/'.strtolower($action);
}
/**
*
* @param string $method REST or DATA
* @param string $resourceBase Base resource
* @param int $resourceID Base resource ID
* @param string $resource The whole resource, before parsing
*
* @return string Returns the call's url.
*/
private function makeUrlFromFilter($method, $resourceBase, $resourceID, $resource)
{
$matches = array();
preg_match('/'.$resourceBase.'([a-zA-Z]+)/', $resource, $matches);
$action = $matches[1];
return $this->makeUrl($method, $resourceBase, $resourceID, $action);
}
public function requestUrlBuilder($resource, $params = array(), $request, $id)
{
if ($resource == "sendEmail") {
$this->call_url = $this->apiUrl."/send/message";
}
else if ($resource == "send") {
$this->call_url = $this->apiUrl."/send"; //json support for SendAPI
}
else if ($resource == "uploadCSVContactslistData") {
if (!empty($params['_contactslist_id'])) {
$contactslist_id = $params['_contactslist_id'];
}
else if (!empty($params['ID'])) {
$contactslist_id = $params['ID'];
}
$this->call_url = $this->makeUrl('DATA', 'Contactslist', $contactslist_id, 'CSVData/text:plain'); // Was $this->call_url = $this->apiUrl."/DATA/contactslist/". $contactslist_id ."/CSVData/text:plain";
}
else if (($resource == "addHTMLbody") || ($resource == "getHTMLbody")) {
if (!empty($params['_newsletter_id'])) {
$newsletter_id = $params['_newsletter_id'];
}
else if (!empty($params['ID'])) {
$newsletter_id = $params['ID'];
}
$this->call_url = $this->makeUrl('DATA', 'NewsLetter', $newsletter_id, 'HTML/text/html/LAST');
}
else if (in_array($resource, self::$_newsletterResources))
{
$this->call_url = $this->makeUrlFromFilter('REST', 'newsletter', $params['ID'], $resource); // Was $this->call_url = $this->apiUrl."/REST/newsletter/". $newsletter_id ."/".strtolower($action);
}
else if (in_array($resource, self::$_templateResources))
{
$this->call_url = $this->makeUrlFromFilter('REST', 'template', $params['ID'], $resource);
}
else if (in_array($resource, self::$_dnsResources))
{
$this->call_url = $this->makeUrlFromFilter('REST', 'dns', $params['ID'], $resource);
}
else if (in_array($resource, self::$_contactResources))
{
$this->call_url = $this->makeUrlFromFilter('REST', 'contact', $params['ID'], $resource); // Was $this->call_url = $this->apiUrl."/REST/contact/". $contact_id . "/".strtolower($action);
}
else if ($resource == "contactManageManyContacts")
{
$this->call_url = $this->apiUrl."/REST/contact/managemanycontacts";
}
else if (in_array($resource, self::$_contactslistResources))
{
$this->call_url = $this->makeUrlFromFilter('REST', 'contactslist', $params['ID'], $resource); // Was $this->call_url = $this->apiUrl."/REST/contactslist/". $contactslist_id . "/".strtolower($action);
}
else {
$this->call_url = $this->apiUrl . '/REST/' . $resource;
}
if ($request == "GET" || $request == "POST") {
if (count($params) > 0)
{
$this->call_url .= '?';
foreach ($params as $key => $value) {
// In a GET request, put an underscore char in front of params to avoid it being treated as a filter
$firstChar = substr($key, 0, -(strlen($key) - 1));
if ($request == "GET") {
$okFirstChar = ($firstChar != "_");
$queryStringKey = $key;
}
else {
$okFirstChar = ($firstChar == "_");
$queryStringKey = substr($key, 1);
}
if ($okFirstChar && ($key != "ID"))
{
$query_string[$queryStringKey] = $queryStringKey . '=' . urlencode($value);
$this->call_url .= $query_string[$queryStringKey] . '&';
}
}
$this->call_url = substr($this->call_url, 0, -1);
}
}
if (($request == "VIEW" || $request == "DELETE" || $request == "PUT") && $resource != "addHTMLbody" && $resource != "uploadCSVContactslistData")
{
if ($id != '')
{
if ($resource == "contactslistManageManyContacts")
{
$this->call_url .= '/' . $params["JobID"];
}
else
{
$this->call_url .= '/' . $id;
}
}
}
return $this->call_url;
}
public function sendRequest($resource = false, $params = array(), $request = "GET", $id = '')
{
# Method
$this->_method = $resource;
$this->_request = $request;
# Build request URL
$url = $this->requestUrlBuilder($resource, $params, $request, $id);
// fix bug for sort (ID+DESC), replace %2B in url by +
$url = preg_replace('#Sort=(.+)%2B(DESC|ASC|)?#sUi', 'Sort=$1+$2', $url);
# Set up and execute the curl process
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'mailjet-api-v3-php-simple/' . $this->wrapperVersion . '; PHP v. ' . phpversion());
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($curl_handle, CURLOPT_USERPWD, $this->apiKey . ':' . $this->secretKey);
$this->_request_post = false;
if (($request == 'POST') || ($request == 'PUT')):
curl_setopt($curl_handle, CURLOPT_POST, 1);
// Exclude filters from payload. See http://stackoverflow.com/questions/4260086/php-how-to-use-array-filter-to-filter-array-keys
$paramsFiltered = array_filter(array_keys($params), function($k) {
return substr($k, 0, 1) != '_';
});
$params = array_intersect_key($params, array_flip($paramsFiltered));
if ($this->debug == 2) {
var_dump($params);
}
if ($resource == "sendEmail") {
$this->curl_setopt_custom_postfields($curl_handle, $params);
}
else if ($resource == "addHTMLbody")
{
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $params['html_content']);
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array(
'Content-Type: text/html'
));
}
//
else if ($resource == "uploadCSVContactslistData")
{
curl_setopt($curl_handle, CURLOPT_BINARYTRANSFER, TRUE);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $params['csv_content']);
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array(
'Content-Type: text/plain'
));
}
//
else
{
if ((in_array($resource, self::$_newsletterResources)) ||
($resource == "contactManageContactsLists") ||
($resource == "contactManageManyContacts") ||
(in_array($resource, self::$_contactslistResources)) ||
(in_array($resource, self::$_templateResources)) ||
(in_array($resource, self::$_dnsResources)))
{
unset($params['ID']);
}
$j_e = null;
if (version_compare(phpversion(), '5.4.0', '<')) {
$j_e = str_replace('\\/', '/', json_encode($params));
} else {
// 64 => unescaped_slashes
$j_e = json_encode($params, 64);
}
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $j_e);
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json'
));
}
$this->_request_post = $params;
endif;
if ($request == 'DELETE') {
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, "DELETE");
}
if ($request == 'PUT') {
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, "PUT");
}
$buffer = curl_exec($curl_handle);
if ($this->debug == 2) {
var_dump($buffer);
}
# Response code
$this->_response_code = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
# Close curl process
curl_close($curl_handle);
# Return response
if (($this->_response_code == 200) && ($resource == "getHTMLbody")) {
$this->_response = $buffer;
}
else
{
/*
* This prevents the rounding error on 32 bits systems with PHP version >= 5.4
*/
if (defined('JSON_BIGINT_AS_STRING'))
{
$this->_response = json_decode($buffer, false, 512, JSON_BIGINT_AS_STRING);
}
else
{ // PHP v <= 5.3.* doens't support the fourth parameter of json_decode
$this->_response = json_decode($buffer, false, 512);
}
}
if ($request == 'POST') {
return ($this->_response_code == 201 || $this->_response_code == 200) ? true : false;
}
if ($request == 'DELETE') {
return ($this->_response_code == 204) ? true : false;
}
return ($this->_response_code == 200) ? true : false;
}
public function debug()
{
echo '<style type="text/css">';
echo '
#debugger {width: 100%; font-family: arial;}
#debugger table {padding: 0; margin: 0 0 20px; width: 100%; font-size: 11px; text-align: left;border-collapse: collapse;}
#debugger th, #debugger td {padding: 2px 4px;}
#debugger tr.h {background: #999; color: #fff;}
#debugger tr.Success {background:#90c306; color: #fff;}
#debugger tr.Error {background:#c30029 ; color: #fff;}
#debugger tr.Not-modified {background:orange ; color: #fff;}
#debugger th {width: 20%; vertical-align:top; padding-bottom: 8px;}
';
echo '</style>';
echo '<div id="debugger">';
if (isset($this->_response_code)):
if (($this->_response_code == 200) || ($this->_response_code == 201) || ($this->_response_code == 204)):
echo '<table>';
echo '<tr class="Success"><th>Success</th><td></td></tr>';
echo '<tr><th>Status code</th><td>' . $this->_response_code . '</td></tr>';
if (isset($this->_response)):
echo '<tr><th>Response</th><td><pre>' . utf8_decode(print_r($this->_response, 1)) . '</pre></td></tr>';
endif;
echo '</table>';
elseif ($this->_response_code == 304):
echo '<table>';
echo '<tr class="Not-modified"><th>Error</th><td></td></tr>';
echo '<tr><th>Error no</th><td>' . $this->_response_code . '</td></tr>';
echo '<tr><th>Message</th><td>Not Modified</td></tr>';
echo '</table>';
else:
echo '<table>';
echo '<tr class="Error"><th>Error</th><td></td></tr>';
echo '<tr><th>Error no</th><td>' . $this->_response_code . '</td></tr>';
if (isset($this->_response)):
if (is_array($this->_response) OR is_object($this->_response)):
echo '<tr><th>Status</th><td><pre>' . print_r($this->_response, true) . '</pre></td></tr>';
else:
echo '<tr><th>Status</th><td><pre>' . $this->_response . '</pre></td></tr>';
endif;
endif;
echo '</table>';
endif;
endif;
$call_url = parse_url($this->call_url);
echo '<table>';
echo '<tr class="h"><th>API config</th><td></td></tr>';
echo '<tr><th>Protocole</th><td>' . $call_url['scheme'] . '</td></tr>';
echo '<tr><th>Host</th><td>' . $call_url['host'] . '</td></tr>';
echo '<tr><th>Version</th><td>' . $this->version . '</td></tr>';
echo '<tr><th>Wrapper Version</th><td>' . $this->readWrapperVersion() . '</td></tr>';
echo '</table>';
echo '<table>';
echo '<tr class="h"><th>Call infos</th><td></td></tr>';
echo '<tr><th>Resource</th><td>' . $this->_method . '</td></tr>';
echo '<tr><th>Request type</th><td>' . $this->_request . '</td></tr>';
echo '<tr><th>Get Arguments</th><td>';
if (isset($call_url['query'])) {
$args = explode("&", $call_url['query']);
foreach ($args as $arg) {
$arg = explode("=", $arg);
echo '' . $arg[0] . ' = <span style="color:#ff6e56;">' . $arg[1] . '</span><br/>';
}
}
echo '</td></tr>';
if ($this->_request_post) {
echo '<tr><th>Post Arguments</th><td>';
foreach ($this->_request_post as $k => $v) {
if (is_array($v))
{
foreach ($v as $key => $value)
{
echo $key . ' = <span style="color:#ff6e56;">' . $value . '</span><br/>';
}
}
else
{
echo $k . ' = <span style="color:#ff6e56;">' . $v . '</span><br/>';
}
}
echo '</td></tr>';
}
echo '<tr><th>Call url</th><td>' . $this->call_url . '</td></tr>';
echo '</table>';
echo '</div>';
}
private function readWrapperVersion() {
return Mailjet::WRAPPER_VERSION;
}
}
@@ -0,0 +1,189 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2013 Mailgun
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace AppBundle\Entity;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ServerException;
class Request extends GuzzleClient
{
/**
* @var string
*/
private $method;
/**
* @var string
*/
private $url;
/**
* @var array
*/
private $filters;
/**
* @var array
*/
private $body;
/**
* @var array
*/
private $auth;
/**
* @var string
*/
private $type;
/**
* @var array
*/
private $requestOptions = [];
/**
* Build a new Http request.
*
* @param array $auth [apikey, apisecret]
* @param string $method http method
* @param string $url call url
* @param array $filters Mailjet resource filters
* @param array|null $body Mailjet resource body
* @param string $type Request Content-type
* @param array $requestOptions
*/
public function __construct(
array $auth,
string $method,
string $url,
array $filters,
?array $body,
string $type,
array $requestOptions = []
) {
parent::__construct(['defaults' => [
'headers' => [
'user-agent' => Config::USER_AGENT.PHP_VERSION.'/'.Client::WRAPPER_VERSION,
],
]]);
$this->type = $type;
$this->auth = $auth;
$this->method = $method;
$this->url = $url;
$this->filters = $filters;
$this->body = $body;
$this->requestOptions = $requestOptions;
}
/**
* Trigger the actual call
* TODO: DATA API.
*
* @param $call
*
* @return Response the call response
*/
public function call($call)
{
$payload = [
'query' => $this->filters,
('application/json' === $this->type ? 'json' : 'body') => $this->body,
];
$authArgsCount = \count($this->auth);
$headers = [
'content-type' => $this->type,
];
if ($authArgsCount > 1) {
$payload['auth'] = $this->auth;
} else {
$headers['Authorization'] = 'Bearer '.$this->auth[0];
}
$payload['headers'] = $headers;
if ((!empty($this->requestOptions)) && (\is_array($this->requestOptions))) {
$payload = array_merge_recursive($payload, $this->requestOptions);
}
$response = null;
if ($call) {
try {
$response = \call_user_func_array(
[$this, strtolower($this->method)],
[$this->url, $payload]
);
} catch (ClientException $e) {
$response = $e->getResponse();
} catch (ServerException $e) {
$response = $e->getResponse();
}
}
return new Response($this, $response);
}
/**
* Filters getters.
*
* @return array Request filters
*/
public function getFilters(): array
{
return $this->filters;
}
/**
* Http method getter.
*
* @return string Request method
*/
public function getMethod(): string
{
return $this->method;
}
/**
* Call Url getter.
*
* @return string Request Url
*/
public function getUrl(): string
{
return $this->url;
}
/**
* Request body getter.
*
* @return array request body
*/
public function getBody(): array
{
return $this->body;
}
/**
* Auth getter. to discuss.
*
* @return array Request auth
*/
public function getAuth(): array
{
return $this->auth;
}
}
@@ -0,0 +1,121 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2013 Mailgun
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace AppBundle\Entity;
/**
* PHP version 7.2.
*
* This is the Mailjet Resources Class
*
* @category Mailjet_API
*
* @author Guillaume Badi <gbadi@mailjet.com>
* @license MIT https://opensource.org/licenses/MIT
*
* @see dev.mailjet.com
*/
class Resources
{
public static $Email = ['send', ''/*, 'v3.1'*/];
public static $Aggregategraphstatistics = ['aggregategraphstatistics', ''];
public static $Apikey = ['apikey', ''];
public static $Apikeyaccess = ['apikeyaccess', ''];
public static $Apikeytotals = ['apikeytotals', ''];
public static $Apitoken = ['apitoken', ''];
public static $Axtesting = ['axtesting', ''];
public static $Batchjob = ['batchjob', ''];
public static $BatchjobCsverror = ['batchjob', 'csverror/text:csv'];
public static $BatchjobJsonerror = ['batchjob', 'JSONError/application:json/LAST'];
public static $Bouncestatistics = ['bouncestatistics', ''];
public static $Campaign = ['campaign', ''];
public static $Campaignaggregate = ['campaignaggregate', ''];
public static $Campaigndraft = ['campaigndraft', ''];
public static $CampaigndraftSchedule = ['campaigndraft', 'schedule'];
public static $CampaigndraftStatus = ['campaigndraft', 'status'];
public static $CampaigndraftSend = ['campaigndraft', 'send'];
public static $CampaigndraftTest = ['campaigndraft', 'test'];
public static $CampaigndraftDetailcontent = ['campaigndraft', 'detailcontent'];
public static $Campaigngraphstatistics = ['campaigngraphstatistics', ''];
public static $Campaignoverview = ['campaignoverview', ''];
public static $Campaignstatistics = ['campaignstatistics', ''];
public static $Clickstatistics = ['clickstatistics', ''];
public static $Contact = ['contact', ''];
public static $ContactManagecontactslists = ['contact', 'managecontactslists'];
public static $ContactGetcontactslists = ['contact', 'getcontactslists'];
public static $ContactManagemanycontacts = ['contact', 'managemanycontacts'];
public static $Contactdata = ['contactdata', ''];
public static $Contactfilter = ['contactfilter', ''];
public static $Contacthistorydata = ['contacthistorydata', ''];
public static $Contactmetadata = ['contactmetadata', ''];
public static $Contactslist = ['contactslist', ''];
public static $ContactslistCsvdata = ['contactslist', 'csvdata/text:plain'];
public static $ContactslistManagecontact = ['contactslist', 'ManageContact'];
public static $ContactslistManagemanycontacts = ['contactslist', 'ManageManyContacts'];
public static $ContactslistImportlist = ['contactslist', 'ImportList'];
public static $Contactslistsignup = ['contactslistsignup', ''];
public static $Contactstatistics = ['contactstatistics', ''];
public static $Csvimport = ['csvimport', ''];
public static $Dns = ['dns', ''];
public static $DnsCheck = ['dns', 'check'];
public static $Domainstatistics = ['domainstatistics', ''];
public static $Eventcallbackurl = ['eventcallbackurl', ''];
public static $Geostatistics = ['geostatistics', ''];
public static $Graphstatistics = ['graphstatistics', ''];
public static $Listrecipient = ['listrecipient', ''];
public static $Listrecipientstatistics = ['listrecipientstatistics', ''];
public static $Liststatistics = ['liststatistics', ''];
public static $Message = ['message', ''];
public static $Messagehistory = ['messagehistory', ''];
public static $Messageinformation = ['messageinformation', ''];
public static $Messagesentstatistics = ['messagesentstatistics', ''];
public static $Messagestate = ['messagestate', ''];
public static $Messagestatistics = ['messagestatistics', ''];
public static $Metadata = ['metadata', ''];
public static $Metasender = ['metasender', ''];
public static $Myprofile = ['myprofile', ''];
public static $Newsletter = ['newsletter', ''];
public static $NewsletterSchedule = ['newsletter', 'schedule'];
public static $NewsletterStatus = ['newsletter', 'status'];
public static $NewsletterSend = ['newsletter', 'send'];
public static $NewsletterTest = ['newsletter', 'test'];
public static $NewsletterDetailcontent = ['newsletter', 'detailcontent'];
public static $Newslettertemplate = ['newslettertemplate', ''];
public static $Newslettertemplatecategory = ['newslettertemplatecategory', ''];
public static $Openinformation = ['openinformation', ''];
public static $Openstatistics = ['openstatistics', ''];
public static $Parseroute = ['parseroute', ''];
public static $Preferences = ['preferences', ''];
public static $Preset = ['preset', ''];
public static $Sender = ['sender', ''];
public static $SenderValidate = ['sender', 'validate'];
public static $Senderstatistics = ['senderstatistics', ''];
public static $Template = ['template', ''];
public static $TemplateDetailcontent = ['template', 'detailcontent'];
public static $TemplateDetailpreviews = ['template', 'detailpreviews'];
public static $TemplateDisplaypreview = ['template', 'displaypreview'];
public static $TemplateDetailthumbnail = ['template', 'detailthumbnail'];
public static $TemplateDisplaythumbnail = ['template', 'displaythumbnail'];
public static $Toplinkclicked = ['toplinkclicked', ''];
public static $Trigger = ['trigger', ''];
public static $User = ['user', ''];
public static $UserActivate = ['user', 'activate'];
public static $Useragentstatistics = ['useragentstatistics', ''];
public static $Widget = ['widget', ''];
public static $Widgetcustomvalue = ['widgetcustomvalue', ''];
public static $Statcounters = ['statcounters', ''];
public static $StatisticsLinkclick = ['statistics', 'link-click'];
public static $StatisticsRecipientesp = ['statistics', 'recipient-esp'];
public static $Sms = ['sms', ''];
public static $SmsSend = ['sms-send', ''];
public static $SmsExport = ['sms', 'export'];
public static $SmsCount = ['sms', 'count'];
}
@@ -0,0 +1,147 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2013 Mailgun
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace AppBundle\Entity;
use Psr\Http\Message\ResponseInterface;
class Response
{
/**
* @var int
*/
private $status;
/**
* @var bool
*/
private $success;
/**
* @var array
*/
private $body = [];
/**
* @var ResponseInterface
*/
private $rawResponse;
/**
* @var Request
*/
private $request;
/**
* Construct a Mailjet response.
*
* @param Request $request Mailjet actual request
* @param ResponseInterface $response Guzzle response
*/
public function __construct(Request $request, ResponseInterface $response)
{
$this->request = $request;
if ($response) {
$this->rawResponse = $response;
$this->status = $response->getStatusCode();
$this->body = $this->decodeBody($response->getBody()->getContents());
$this->success = 2 === floor($this->status / 100);
}
}
/**
* Status Getter
* return the http status code.
*
* @return int status
*/
public function getStatus()
{
return $this->status;
}
/**
* Status Getter
* return the entire response array.
*/
public function getBody(): array
{
return $this->body;
}
/**
* Data Getter
* The data returned by the mailjet call.
*
* @return array data
*/
public function getData(): array
{
return $this->body['Data'] ?? $this->body;
}
/**
* Count getter
* return the resulting array size.
*/
public function getCount(): ?int
{
return $this->body['Count'] ?? null;
}
/**
* Error Reason getter
* return the resulting error message.
*/
public function getReasonPhrase(): ?string
{
return $this->rawResponse->getReasonPhrase();
}
/**
* Total getter
* return the total count of all results.
*
* @return int|null count
*/
public function getTotal(): ?int
{
return $this->body['Total'] ?? null;
}
/**
* Success getter.
*
* @return bool true is return code is 2**
*/
public function success(): ?bool
{
return $this->success;
}
public function getRequest(): Request
{
return $this->request;
}
/**
* Decodes a mailjet string response to an object representing that response.
*
* @param string $body The mailjet response as string
*
* @return array Object representing the mailjet response
*/
protected function decodeBody(string $body): array
{
return json_decode($body, true, 512, JSON_BIGINT_AS_STRING) ?: [];
}
}
@@ -424,6 +424,10 @@ class User extends BaseUser
}
}
}
$type=null;
if($this->getCompany()->getType()){
$type=$this->getCompany()->getType();
}
}
$card = array(
@@ -443,6 +447,7 @@ class User extends BaseUser
"zipCode" => $zipCode,
"city" => $city,
"country" => $country,
"type" => $type,
"currentJob" => $this->getCompany()->getExtra()["titleTalent"],
"website" => $this->getCompany()->getWebsite(),
);
@@ -67,6 +67,7 @@ class AdSoftType extends AbstractType
'mapped' => false,
'label' => 'Localisation du poste',
'attr' => array(
'placeholder' => 'Ex : 3 Rue Louis de Broglie, Vannes, France',
'value' => $location_gmap,
'class' => 'form-control'
)
@@ -119,8 +120,9 @@ class AdSoftType extends AbstractType
'attr' => array(
'value' => $duree_contrat,
'class' => 'form-control',
'placeholder' => 'Ex : 6',
'min' => '0',
'max' => '50',
'max' => '36',
)
))
->add('appellationId', HiddenType::class, array(
@@ -161,12 +163,13 @@ class AdSoftType extends AbstractType
))
->add('nombre_heure', IntegerType::class, array(
'mapped' => false,
'label' => 'Temps de travail',
'label' => "Temps de travail (Le nombre saisi correspond au nombre d'heures/semaine.)",
'empty_data' => "0",
'required' => false,
'attr' => array(
'value' => $nombre_heure,
'class' => 'form-control',
'placeholder' => 'Ex : 20',
'min' => '0',
'max' => '35',
)
@@ -176,7 +179,7 @@ class AdSoftType extends AbstractType
'label' => 'Possibilité de faire du Télétravail?',
'data' => $teletravail,
'choices' => array(
'Occasionnel ' => 'tele_occassionel',
'Occasionnel ' => 'tele_occasionel',
'Partiel ' => 'tele_partiel',
'Total' => 'tele_total',
'Non' => 'tele_non',
@@ -207,7 +210,8 @@ class AdSoftType extends AbstractType
)
)
->add('competences', HiddenType::class, array(
'label' => 'competences:',
'mapped' => false,
'label' => 'competences',
'data' => $competences,
'attr' => array(
'class' => 'form-control'
@@ -95,7 +95,8 @@ class AdType extends AbstractType
'label' => 'Localisation du poste',
'attr' => array(
'value' => $location_gmap,
'class' => 'form-control'
'class' => 'form-control',
'placeholder' => 'Ex : 3 Rue Louis de Broglie, Vannes, France',
)
))
->add('location', HiddenType::class, array(
@@ -136,8 +137,9 @@ class AdType extends AbstractType
'attr' => array(
'value' => $duree_contrat,
'class' => 'form-control',
'placeholder' => 'Ex : 6',
'min' => '0',
'max' => '50',
'max' => '36',
)
))
->add('appellationId', HiddenType::class, array(
@@ -178,12 +180,13 @@ class AdType extends AbstractType
))
->add('nombre_heure', IntegerType::class, array(
'mapped' => false,
'label' => 'Temps de travail',
'label' => "Temps de travail (Le nombre saisi correspond au nombre d'heures/semaine.)",
'empty_data' => "0",
'required' => false,
'attr' => array(
'value' => $nombre_heure,
'class' => 'form-control',
'placeholder' => 'Ex : 20',
'min' => '0',
'max' => '35',
)
@@ -193,7 +196,7 @@ class AdType extends AbstractType
'label' => 'Possibilité de faire du Télétravail?',
'data' => $teletravail,
'choices' => array(
'Occasionnel ' => 'tele_occassionel',
'Occasionnel ' => 'tele_occasionel',
'Partiel ' => 'tele_partiel',
'Total' => 'tele_total',
'Non' => 'tele_non',
@@ -225,7 +228,8 @@ class AdType extends AbstractType
))
->add('competences', HiddenType::class, array(
'label' =>'Compétences :',
'mapped' => false,
'label' =>'Compétences',
'data' => $competences,
'attr' => array(
'class' => 'form-control',
@@ -50,7 +50,8 @@ class AdType extends AbstractType
'label' => 'Localisation du poste',
'attr' => array(
'value' => $location_gmap,
'class' => 'form-control'
'class' => 'form-control',
'placeholder' => 'Ex : 3 Rue Louis de Broglie, Vannes, France',
)
))
->add('location', HiddenType::class, array(
@@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\CountryType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
@@ -36,8 +37,17 @@ class CompanyAdminType extends AbstractType
->add('siren', TextType::class, array(
'label' => 'profile.company.siren',
))
->add('size', TextType::class, array(
// ->add('size', TextType::class, array(
// 'label' => 'profile.company.size',
// ))
->add('size', ChoiceType::class, array(
'label' => 'profile.company.size',
'choices' => array(
'TPE (1 à 9 salariés) ' => 1,
'PME (10 à 249 salariés) ' => 10,
'ETI (250 à 4 999 salariés)' =>250 ,
'GE (à partir de 5 000 salariés)' => 5000,
),
))
->add('isPrivate', CheckboxType::class, array(
'label' => 'Page entreprise privé ( non listée en front )',
@@ -16,6 +16,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CountryType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
@@ -62,12 +63,26 @@ class CompanyProfileType extends AbstractType
'class' => 'form-control'
)
))
->add('size', TextType::class, array(
->add('size', ChoiceType::class, array(
'label' => 'profile.company.size',
'choices' => array(
'TPE (1 à 9 salariés) ' => 1,
'PME (10 à 249 salariés) ' => 10,
'ETI (250 à 4 999 salariés)' =>250 ,
'GE (à partir de 5 000 salariés)' => 5000,
),
'attr' => array(
'class' => 'form-control'
)
));
))
// ->add('size', TextType::class, array(
// 'label' => 'profile.company.size',
// 'attr' => array(
// 'class' => 'form-control'
// )
// ))
;
// Addresses fields
$builder
->add('address', TextType::class, array(
@@ -168,12 +168,12 @@ class AnswerRepository extends AbstractRepository
$query
->select(['a','user'])
->join('a.user', 'user')
->join('a.ad', 'ad')
->leftjoin('a.ad', 'ad')
->leftjoin('a.video', 'video')
->leftjoin('a.company', 'company');
$countQuery
->join('a.user', 'user')
->join('a.ad', 'ad')
->leftjoin('a.ad', 'ad')
->leftjoin('a.video', 'video')
->leftjoin('a.company', 'company');
// $countQuery
@@ -96,12 +96,12 @@ class MailManager
$email = \Swift_Message::newInstance()
->setSubject($subject)
->setFrom('noreply@talentstube.io')
->setTo('c.leveque@talentstube.com')
->setTo('l.laniau@talentstube.com')
->setBody($message, 'text/html')
;
if ($this->mailer->send($email)) {
// $spool = $this->mailer->getTransport()->getSpool();
// $spool->flushQueue($this->transport);
// $spool = $this->mailer->getTransport()->getSpool();
// $spool->flushQueue($this->transport);
$message = array('success' => 200);
} else {
$message = array('success' => 500);
@@ -216,8 +216,11 @@ class MediaManager
$message = array('success' => 200,
'filename' => $media->getTitle(),
'originalFilename' => $uploadedFile->getClientOriginalName(),
'originalUrl' => $media->getOriginalUrl(),
'thumbnails' => $media->getThumbnails(),
'uriVimeo' => str_replace('videos', 'video', $uriVimeo),
'mediaId' => $media->getId(),
'heure' => date("H:i:s"),
);
} else {
$message = array('success' => 500,
@@ -35,7 +35,7 @@ abstract class AbstractFactory implements SecurityFactoryInterface
protected $defaultSuccessHandlerOptions = [
'always_use_default_target_path' => false,
'default_target_path' => '/',
'login_path' => '/login',
'login_path' => '/',
'target_path_parameter' => '_target_path',
'use_referer' => false,
];
@@ -43,7 +43,7 @@ abstract class AbstractFactory implements SecurityFactoryInterface
protected $defaultFailureHandlerOptions = [
'failure_path' => null,
'failure_forward' => false,
'login_path' => '/login',
'login_path' => '/?erreur=1',
'failure_path_parameter' => '_failure_path',
];
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB