Compare commits

...

43 Commits

Author SHA1 Message Date
Grégoire 3ffc3c8d3b fix : sendtime + message video + contact_talent 2020-01-02 15:29:55 +01:00
Grégoire e35cb0c461 fix : link mail answer spontaneous 2019-12-30 16:22:13 +01:00
Grégoire db084707bb fix : search bar v2 2019-12-30 13:20:11 +01:00
Grégoire 1a9fff778a fix : search bar 2019-12-30 12:27:11 +01:00
Sébastien 90a38edb29 Fix: Add new noreply email 2019-11-28 08:31:58 +01:00
Sébastien fc1b4a3e2a Feat: add popup when change company user email 2019-11-26 08:52:59 +01:00
Sebastien Glatz 94a946e36d Fix: little space fix 2019-11-22 16:12:09 +01:00
Sébastien f06cbe296f Fix: Banner color and padding 2019-11-21 15:56:48 +01:00
Sébastien e2a98aaed3 Feat: Edit form to add bootstrap style on input 2019-11-21 15:36:32 +01:00
Sébastien beee2c5635 Feat: Add field email on Company Edition 2019-11-21 14:33:42 +01:00
Grégoire bca29b9547 delete TalentController api 2019-11-05 14:07:50 +01:00
Grégoire 823a781d3a minor fix Push Notification 2019-11-05 11:24:34 +01:00
Grégoire 2a9e728354 correctif Menu 2019-10-28 17:03:46 +01:00
Grégoire 074c125f8c Redirect monCompte API 2019-10-28 14:36:14 +01:00
Grégoire 0b2898d170 Add twitter, linkedin … for getIdCard() 2019-10-15 09:57:37 +02:00
Grégoire 12525dbf16 Merge branch 'master' of https://git.e-declic.net/talents-tube/website 2019-10-14 16:43:13 +02:00
Grégoire 4a17adf687 add phone / linkedin / twitter … field for API form 2019-10-14 16:32:39 +02:00
Huaoe f4e412d792 Merge branch 'master' of https://git.e-declic.net/talents-tube/website 2019-10-11 15:48:44 +02:00
Grégoire 61786797c8 API : add getUserSubscriptionToPush (old : isUserSubscribedToPush) 2019-10-11 15:17:43 +02:00
Huaoe 57587a4a97 Merge branch 'master' of https://git.e-declic.net/talents-tube/website 2019-10-11 14:29:20 +02:00
Grégoire fd048d5a0e Merge branch 'master' of https://git.e-declic.net/talents-tube/website 2019-10-11 14:19:28 +02:00
Grégoire 229893dc95 API : add isUserSubscribedToPush 2019-10-11 14:19:02 +02:00
Grégoire 26c6e2103d API : ad visit record for companies and ads pages 2019-10-10 16:59:08 +02:00
Grégoire 8830b5ccde Set isPrivate true by default for companies 2019-10-10 16:57:50 +02:00
Huaoe 2bc2d87b8c UpdateUser fix request->request 2019-10-10 16:24:23 +02:00
Huaoe 278c558c9e Merge branch 'master' of https://git.e-declic.net/talents-tube/website 2019-10-10 14:49:02 +02:00
Huaoe 98545707b3 photo return 2019-10-09 17:01:58 +02:00
Sébastien 52d105efb4 Feat: add field phone and edit set extra 2019-10-09 11:31:53 +02:00
Sébastien 027c3fd2d1 Fix: presentationVideo syntax error 2019-10-09 11:27:52 +02:00
Grégoire 824ff9f1ec Change query / no selecting talent video in chat 2019-10-09 10:48:56 +02:00
Grégoire 606e29280b Fix bug draft message show app 2019-10-08 16:05:19 +02:00
Sébastien 3a29c647dd Fix: serialize tags for answer 2019-10-07 15:15:18 +02:00
Huaoe 57dd053693 Merge branch 'master' of https://git.e-declic.net/talents-tube/website 2019-10-07 09:51:42 +02:00
Huaoe e57173f835 upload profil picture 2019-10-07 09:51:35 +02:00
Sébastien 8f4ef35ddf Feat: Serialize publicTag for offer detail 2019-10-04 13:48:37 +02:00
Sébastien 346b788f83 Feat: Add titleTalent in extra to update from app 2019-10-04 13:48:08 +02:00
Sébastien edf35c74e8 Feat: Serialize territory type 2019-10-01 18:11:08 +02:00
Sébastien 75f2bbf6a7 Fix: php syntax error 2019-10-01 18:10:15 +02:00
Grégoire 0cbe670c90 change order for entreprises 2019-10-01 16:28:52 +02:00
Sébastien 2d595c1c3a Serialize territories for ad detail 2019-09-26 11:41:08 +02:00
Sébastien 98ebde7e72 Add linkedin twitter and website data for app 2019-09-26 11:40:36 +02:00
Huaoe d607962523 style.css generated 2019-09-16 16:20:09 +02:00
Huaoe b4ae35f4a6 yellow banner Off 2019-09-16 16:18:44 +02:00
38 changed files with 6285 additions and 10226 deletions
+52 -2
View File
@@ -14,7 +14,28 @@
{% endblock %}
{% block content %}
{{ form_start(formUser, {'id': 'formUser'}) }}
<div class="row">
<div class="col-xs-8">
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">Compte utilisateur</h3>
</div>
<div class="box-body">
{{ form_errors(formUser) }}
{{ form_label(formUser.email, 'Email') }}
{{ form_widget(formUser.email, {'attr': {'class': 'form-control'}}) }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<button class="btn btn-success edit-email-user" data-toggle="tooltip" type="submit">Enregistrer</button>
</div>
</div>
{{ form_end(formUser) }}
<br/>
{{ form_start(form) }}
<div class="row">
<div class="col-xs-8">
@@ -37,7 +58,6 @@
{{ form_row(form.website) }}
{{ form_row(form.tagsComma) }}
{{ form_row(form.file) }}
</div>
</div>
</div>
@@ -66,3 +86,33 @@
{{ form_end(form) }}
{% endblock %}
{% block javascripts %}
<script>
$(document).ready(function () {
$('[data-toggle="popover"]').popover();
$(".edit-email-user").confirm({
title: "Êtes vous sûr de modifier l'adresse mail de cet utilisateur ?",
content: "Si une erreur de saisie est présente, l'utilisateur ne pourra plus recevoir vos mails.",
type: 'ored',
boxWidth: '30%',
useBootstrap: false,
buttons: {
confirm: {
text: 'Confirmer',
action: function() {
$("[name='user_company']").submit();
return true;
}
},
cancel: {
text: 'Annuler'
}
}
});
});
</script>
{% endblock %}
@@ -56,6 +56,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'@global'
output='assetic/main.base.dash.js' filter='?uglifyjs2' %}
<script src="{{ asset_url }}"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYV8IJGtIoWLfXJQQvIuDQ88n2aEuRgpg&libraries=places"></script>
{% endjavascripts %}
{% endblock %}
</body>
@@ -86,7 +86,7 @@
<div id="newApp" class="container-fluid">
<div class="row">
<div class="col s12 m12">
<p>"Nouveau ! Trouvez un job plus facilement avec notre <a href="https://app.talentstube.com">web application</a>.📲"</p>
<p>"Nouveau ! Trouvez un job plus facilement avec notre <a href="http://app.talentstube.com">web application</a>.📲"</p>
</div>
</div>
</div>
@@ -100,10 +100,10 @@
<a class="collapsible-header" title="Talents">Talents</a>
<div class="collapsible-body">
<ul>
<li><ahref="{{ path('ad_search_result') }}" title="Offres d'emploi vidéos">Offres d'emploi</a></li>
<li><ahref="{{ path('page_cvVideo') }}" title="Le Cv vidéo">Le CV vidéo</a></li>
<li><ahref="{{ path('page_reussirCVvideo') }}" title="Comment faire son CV Vidéo ?">Comment faire son CV Vidéo ?</a></li>
<li><ahref="{{ path('page_accompagnementTalent') }}" title="Accompagnement talent">Accompagnement</a></li>
<li><a href="{{ path('ad_search_result') }}" title="Offres d'emploi vidéos">Offres d'emploi</a></li>
<li><a href="{{ path('page_cvVideo') }}" title="Le Cv vidéo">Le CV vidéo</a></li>
<li><a href="{{ path('page_reussirCVvideo') }}" title="Comment faire son CV Vidéo ?">Comment faire son CV Vidéo ?</a></li>
<li><a href="{{ path('page_accompagnementTalent') }}" title="Accompagnement talent">Accompagnement</a></li>
</ul>
</div>
</li>
@@ -114,11 +114,11 @@
<a class="collapsible-header" title="Les entreprises de talents">Entreprises</a>
<div class="collapsible-body">
<ul>
<li><ahref="{{ path('company_list') }}" title="Listes entreprises">Listes entreprises</a></li>
<li><ahref="{{ path('page_OffreEmploi') }}" title="L'offre d'emploi en vidéo">L'offre d'emploi en vidéo</a></li>
<li><ahref="{{ path('page_reussirOffrevideo') }}" title="Comment faire une offre en vidéo">Comment faire une offre en vidéo</a></li>
<li><ahref="{{ path('page_MarqueEmployeur') }}" title="Vidéo Marque Employeur">Vidéo Marque Employeur</a></li>
<li><ahref="{{ path('page_accompagnementEntreprise') }}" title="Conseils & accompagnement">Conseils & accompagnement</a></li>
<li><a href="{{ path('company_list') }}" title="Listes entreprises">Listes entreprises</a></li>
<li><a href="{{ path('page_OffreEmploi') }}" title="L'offre d'emploi en vidéo">L'offre d'emploi en vidéo</a></li>
<li><a href="{{ path('page_reussirOffrevideo') }}" title="Comment faire une offre en vidéo">Comment faire une offre en vidéo</a></li>
<li><a href="{{ path('page_MarqueEmployeur') }}" title="Vidéo Marque Employeur">Vidéo Marque Employeur</a></li>
<li><a href="{{ path('page_accompagnementEntreprise') }}" title="Conseils & accompagnement">Conseils & accompagnement</a></li>
</ul>
</div>
</li>
@@ -126,9 +126,9 @@
<a class="collapsible-header" title="Les territoires">Territoires</a>
<div class="collapsible-body">
<ul>
<li><ahref="{{ path('territory_list') }}">Liste des territoires</a></li>
<li><ahref="{{ path('page_VideoTerritory') }}">La vidéo territoire</a></li>
<li><ahref="{{ path('page_AccompagnementTerritory') }}">Conseils et accompagnement</a></li>
<li><a href="{{ path('territory_list') }}">Liste des territoires</a></li>
<li><a href="{{ path('page_VideoTerritory') }}">La vidéo territoire</a></li>
<li><a href="{{ path('page_AccompagnementTerritory') }}">Conseils et accompagnement</a></li>
</ul>
</div>
</li>
@@ -16,7 +16,11 @@
<br/>
<br/>
<div style="text-align:center;">
<a class="btn btn-default" href="{{ absolute_url(path('talent_ad_detail',{'alias': answer.ad.alias,'id': answer.id })) }}">Visionner la réponse vidéo</a>
{% if answer.ad.alias is null %}
<a class="btn btn-default" href="{{ absolute_url(path('talent_ad_detail',{'alias': aliasCompany,'id': answer.id })) }}">Visionner la réponse</a>
{% else %}
<a class="btn btn-default" href="{{ absolute_url(path('talent_ad_detail',{'alias': answer.ad.alias,'id': answer.id })) }}">Visionner la réponse</a>
{% endif %}
</div>
{% else %}
<br />
@@ -26,7 +30,11 @@
<br/>
<br/>
<div style="text-align:center;">
<a class="btn btn-default" href="{{ absolute_url(path('talent_ad_detail',{'alias': answer.ad.alias,'id': answer.id })) }}">Consulter la réponse</a>
{% if answer.ad.alias is null %}
<a class="btn btn-default" href="{{ absolute_url(path('talent_ad_detail',{'alias': aliasCompany,'id': answer.id })) }}">Consulter la réponse</a>
{% else %}
<a class="btn btn-default" href="{{ absolute_url(path('talent_ad_detail',{'alias': answer.ad.alias,'id': answer.id })) }}">Consulter la réponse</a>
{% endif %}
</div>
{% endif %}
<br>
@@ -18,11 +18,3 @@
</div>
{% endblock %}
{% block javascripts %}
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYV8IJGtIoWLfXJQQvIuDQ88n2aEuRgpg&libraries=places"></script>
{% javascripts
'@talents'
output='assetic/main.dashboard.talent.js' filter='?uglifyjs2' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
+18 -1
View File
@@ -106,7 +106,7 @@ fos_user:
email:
template: email/password_resetting.email.twig
from_email:
address: noreply@talentstube.com
address: noreply@talentstube.io
sender_name: talentstube.com
service:
mailer: fos_user.mailer.twig_swift
@@ -250,6 +250,7 @@ fos_rest:
serialize_null: true
format_listener:
rules:
- { path: '^/api/talent', priorities: ['html'], fallback_format: 'html' }
- { path: '^/api/', priorities: ['json'], fallback_format: 'json' }
param_fetcher_listener: true
exception:
@@ -264,6 +265,22 @@ lexik_jwt_authentication:
public_key: '%kernel.root_dir%/../app/config/jwt/public.pem' # required for token verification
pass_phrase: 'talentstubeforever' # required for token creation, usage of an environment variable is recommended
token_ttl: 3600000
token_extractors:
# look for a token as Authorization Header
authorization_header:
enabled: true
prefix: Bearer
name: Authorization
# check token in a cookie
cookie:
enabled: false
name: BEARER
# check token in query string parameter
query_parameter:
enabled: true
name: bearer
nelmio_cors:
paths:
@@ -15,9 +15,9 @@ services:
class: AppBundle\Utils\Services\AfterLoginRedirection
arguments: ['@router']
#app.ad_searcher:
# class: AppBundle\Utils\Services\AdSearcher
# arguments: ['@fos_elastica.finder.ads.adfr']
app.ad_searcher:
class: AppBundle\Utils\Services\AdSearcher
arguments: ['@fos_elastica.finder.ads.adfr']
app.ad_tags_searcher:
class: AppBundle\Utils\Services\AdSearcher
@@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputOption;
class SendPushCommand extends ContainerAwareCommand
{
private const defaultEmail = 'thomas.berrod@e-declic.com';
private const defaultEmail = 'lognone.gregoire@hotmail.fr';
protected function configure()
@@ -309,8 +309,8 @@ class AdController extends Controller
} else {
$session->remove('contratSearch');
}
//$adSearcher = $this->get('app.ad_searcher');
$ads = array();//$adSearcher->process($data);
$adSearcher = $this->get('app.ad_searcher');
$ads = $adSearcher->process($data);
if(empty($ads)){
$ads = $this->getPublishedAds($promoted);
$noResults = true;
@@ -5,6 +5,7 @@ namespace AppBundle\Controller\Admin;
use AppBundle\Entity\Company;
use AppBundle\Entity\Product;
use AppBundle\Form\Admin\CompanyAdminType;
use AppBundle\Form\Admin\UserCompanyType;
use AppBundle\Form\TokenAddType;
use Edeclic\PrestashopBridgeBundle\Event\PrestashopBridgeEvents;
use Edeclic\PrestashopBridgeBundle\Event\UserEvent;
@@ -36,14 +37,26 @@ class CompanyController extends Controller
$user = $company->getUsers()->first();
$form = $this->createForm(CompanyAdminType::class, $company);
$form->handleRequest($request);
$formUser = $this->createForm(UserCompanyType::class, $user);
$formUser->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$companyManager = $this->get('app.company_manager');
$companyManager->updateCompany($company);
$event = new UserEvent($user);
$this->get('event_dispatcher')->dispatch(PrestashopBridgeEvents::USER_PROFIL_EDIT_SUCCESS, $event);
}
if ($formUser->isSubmitted() && $formUser->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($user);
$em->flush();
}
return $this->render('admin/company_edit.html.twig', array(
'form' => $form->createView(),
'formUser' => $formUser->createView(),
'company' => $company,
));
}
@@ -327,9 +327,11 @@ class AnswerController extends Controller
if ($answer->getAd() == null) {
$type = 'spontaneous';
$title = $answer->getCompany()->getBrandName();
$aliasCompany = $answer->getCompany()->getAlias();
} else {
$type = 'answer';
$title = $answer->getAd()->getTitle();
$aliasCompany = '';
}
$user = $this->getUser();
$form = $this->createForm(ContactTalentType::class);
@@ -365,6 +367,7 @@ class AnswerController extends Controller
'user' => $answer->getUser(),
'video' => $message->getVideo(),
'message' => $message,
'aliasCompany' => $aliasCompany
));
$plainView = $this->renderView('email/contact_talent_plain.html.twig', array(
@@ -116,4 +116,21 @@ class AdController extends FOSRestController
['Location' => $this->generateUrl('api_ad_show', ['id' => $ad->getId(), UrlGeneratorInterface::ABSOLUTE_URL])]
);
}
/**
* @Rest\Get("/api/adAjaxRecStat/{id}", name="adAjaxRecStat")
* @Rest\View(statusCode=200)
*/
public function adAjaxRecStatAction(Ad $ad)
{
$history = $this->get('edeclic.history.record');
if ($this->getUser()) {
$idUser = $this->getUser()->getId();
$history->recordIt($idUser, "r", get_class($ad), $ad->getId(), serialize($ad));
} else {
$history->recordIt("Anonymous", "r", get_class($ad), $ad->getId(), serialize($ad));
}
return new JsonResponse(array('code' => "ok"));
}
}
@@ -22,6 +22,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use JMS\Serializer\SerializationContext;
use AppBundle\Exception\ResourceValidationException;
use AppBundle\Exception\UnknownUserException;
use \DateTime;
class AnswerController extends FOSRestController
{
@@ -33,7 +34,7 @@ class AnswerController extends FOSRestController
public function showAction(Answer $answer)
{
$usr = $this->getUser();
$userAnswer = $this->getDoctrine()->getRepository('AppBundle:Answer')->findOneBy(array('user' => $usr, 'id' => $answer->getId()));
$userAnswer = $this->getDoctrine()->getRepository('AppBundle:Answer')->findOneByWithCorrespondences($usr, $answer->getId());
if ($userAnswer) {
$data = $this->get('jms_serializer')->serialize($answer, 'json', SerializationContext::create()->setGroups(array('answer_detail')));
return new JsonResponse($data, 200, [], true);
@@ -136,21 +137,21 @@ class AnswerController extends FOSRestController
$ad = $em->getRepository('AppBundle:Ad')->find($adId);
$answer->setAd($ad);
}
$answer->setVideo($video)
->setCompany($company);
$answer ->setVideo($video)
->setCompany($company)
->setSendTime(new \DateTime());
$em->persist($answer);
$em->flush();
$userCompany = $company->getUsers();
$message = new Message('Candidature', 'Video', $usr, $userCompany{
/*$message = new Message('Candidature', 'Video', $usr, $userCompany{
0}, 'CONTACT_TALENT', $answer);
$message->setVideo($video);
$em->persist($message);
$em->flush();
$status = array('status' => "success", "idAnswer" => $answer->getId(), "idMessage" => $message->getId());
$em->flush();*/
$status = array('status' => "success", "idAnswer" => $answer->getId()/*, "idMessage" => $message->getId()*/);
}
} else {
$message = 'Vous n\'êtes pas connecté en tant qu\'utilisateur.';
@@ -248,6 +249,7 @@ class AnswerController extends FOSRestController
*/
public function fetchMessageAction(Answer $answer)
{
$em = $this->getDoctrine()->getManager();
$usr = $this->get('security.token_storage')->getToken()->getUser();
if ($answer->getUser()->getId() !== $usr->getId()) {
@@ -256,7 +258,7 @@ class AnswerController extends FOSRestController
throw new ResourceValidationException($message, $status);
}
$messages = $answer->getMessages();
$messages = $em->getRepository('AppBundle:Message')->searchCorrespondences($answer);
//
$status = array('status' => "success", "messages" => $messages);
//
@@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use JMS\Serializer\SerializationContext;
use Symfony\Component\HttpFoundation\JsonResponse;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class CompanyController extends FOSRestController
{
@@ -93,4 +94,23 @@ class CompanyController extends FOSRestController
Response::HTTP_CREATED,
['Location' => $this->generateUrl('api_company_show', ['id' => $company->getId(), UrlGeneratorInterface::ABSOLUTE_URL])]);
}
/**
* @Rest\Get(path="/api/companyAjaxRecStat/{id}", name="companyAjaxRecStat", requirements={"id"="\d+"})
* @Rest\View(statusCode=200)
*/
public function companyAjaxRecStatAction(Company $company)
{
$history = $this->get('edeclic.history.record');
if ($this->getUser() && $this->getUser()->getCompany() != null) {
if ($this->getUser()->getCompany()->getId() !== $company->getId()) {
$history->recordIt($this->getUser()->getId(), "r", get_class($company), $company->getId(), serialize($company));
}
} else {
$history->recordIt("Anonymous", "r", 'AppBundle\Entity\Company', $company->getId(), serialize($company));
}
return new JsonResponse(array('code' => "ok"));
}
}
@@ -0,0 +1,59 @@
<?php
namespace AppBundle\Controller\Api;
use AppBundle\Entity\User;
use FOS\RestBundle\Controller\Annotations as Rest;
use FOS\RestBundle\Controller\Annotations\Get;
use FOS\RestBundle\Controller\Annotations\Post;
use FOS\RestBundle\Controller\Annotations\View;
use FOS\RestBundle\Controller\FOSRestController;
use FOS\RestBundle\Request\ParamFetcherInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use JMS\Serializer\SerializationContext;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpFoundation\Request;
class PushController extends FOSRestController
{
/**
* @Rest\Get("/api/userSubscriptionToPush", name="getUserSubscriptionToPush")
* @Rest\View(statusCode=200)
*/
public function getUserSubscriptionToPush()
{
$user = $this->getUser();
$managerPush = $this->get('app.user_subscription_manager');
$isUserSubscribed = ($managerPush->findByUser($user))? true : false;
return new JsonResponse(array('isUserSubscribed' => $isUserSubscribed));
}
/**
* @Rest\Post("/api/userSubscriptionToPush", name="postUserSubscriptionToPush")
* @Rest\View(statusCode=200)
*/
public function saveSubscription(Request $request)
{
$user = $this->getUser();
$subscription = json_decode($request->getContent(), true);
if (JSON_ERROR_NONE !== json_last_error()) {
throw new BadRequestHttpException(json_last_error_msg());
}
if (!isset($subscription['endpoint'])) {
throw new BadRequestHttpException('Invalid subscription object.');
}
$manager = $this->container->get("app.user_subscription_manager");
$subscriptionHash = $manager->hash($subscription['endpoint']);
$userSubscription = $manager->getUserSubscription($user, $subscriptionHash)
or $userSubscription = $manager->factory($user, $subscriptionHash, $subscription);
$manager->save($userSubscription);
return new JsonResponse(array('success' => true),200);
}
}
@@ -15,6 +15,14 @@ use FOS\UserBundle\Model\UserInterface;
use AppBundle\Entity\Company;
use AppBundle\Exception\ResourceValidationException;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use AppBundle\Form\ContactTalentType;
use AppBundle\Form\MediaType;
use AppBundle\Form\TalentProfileType;
use AppBundle\Form\TalentType;
use AppBundle\Form\CareersType;
use AppBundle\Form\FormationsType;
use AppBundle\Form\LanguagesType;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
class SecurityController extends FOSRestController
{
@@ -107,24 +115,58 @@ class SecurityController extends FOSRestController
*/
public function UpdateUser(Request $request)
{
$userManager = $this->get('fos_user.user_manager');
$companyManager = $this->get('app.company_manager');
$usr = $this->getUser();
$talent = $usr->getCompany();
if ($usr !== null){
$newLastName = htmlspecialchars($request->request->get('lastname'));
$newFirstName = htmlspecialchars($request->request->get('firstname'));
$newLastName = htmlspecialchars($request->get('lastname'));
$newFirstName = htmlspecialchars($request->get('firstname'));
$phoneTalent = htmlspecialchars($request->get('phone'));
$titleTalent = htmlspecialchars($request->get('currentJob'));
$newLinkedin = htmlspecialchars($request->get('linkedin'));
$newTwitter = htmlspecialchars($request->get('twitter'));
$newWebsite = htmlspecialchars($request->get('website'));
if (!isset($newLastName) || !isset($newFirstName) || $newLastName == null || $newFirstName == null){
$message = 'Vous devez rentrer votre nom et votre prénom pour continuer';
throw new ResourceValidationException($message,'');
} else {
$file = $request->files->get('file');
$usr->setLastName($newLastName);
$usr->setFirstName($newFirstName);
$talent->setWebsite($newWebsite);
$talent->setLinkedin($newLinkedin);
$talent->setTwitter($newTwitter);
$talent->setTitleTalent($titleTalent);
$talent->setPhoneTalent($phoneTalent);
$companyManager->updateTalent($usr);
$status = array('status' => "success");
}
} else {
$status = array('status' => "failure", 'message' => "Vous n'êtes pas connecté.");
}
return new JsonResponse($status);
}
/**
* @Rest\post(path="/api/update_profile_picture", name="api_update_profile_picture")
* @Rest\View
*/
public function UpdateProfilPicture(Request $request)
{
$userManager = $this->get('fos_user.user_manager');
$usr = $this->getUser();
if ($usr !== null){
$file = $request->files->get('file');
$usr->setFile($file);
$usr->upload();
$userManager->updateUser($usr);
$status = array('status' => "success", 'file' => $usr->getFile(), 'id' => $usr->getId());
}
$status = array('status' => "success", 'file' => $usr->getPhoto());
} else {
$status = array('status' => "failure", 'message' => "Vous n'êtes pas connecté.");
}
@@ -520,4 +562,25 @@ class SecurityController extends FOSRestController
$data = json_decode($response);
return $data;
}
/**
* @Rest\Get(path="/api/talent", name="api_talent")
* @Rest\View
*/
public function goToMonCompte(Request $request)
{
$user = $this->getUser();
$token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
$this->get('security.token_storage')->setToken($token);
$this->get('session')->set('_security_main', serialize($token));
$event = new InteractiveLoginEvent($request, $token);
$this->get("event_dispatcher")->dispatch("security.interactive_login", $event);
$view = $this->redirectView($this->generateUrl('talent_dashboard'), 301);
return $this->handleView($view);
}
}
@@ -187,7 +187,7 @@ class CompanyController extends Controller
$history->recordIt("Anonymous", "r", 'AppBundle\Entity\Company', $company->getId(), serialize($company));
}
return new JsonResponse(array('code' => "ok"));
return new JsonResponse(array('code' => "ok", "user" => $this->getUser()->getUsername()));
}
/***********************
@@ -17,7 +17,7 @@ class DefaultController extends Controller
$ads = $em->getRepository('AppBundle:Ad')->findBy(array("status" => "PUBLISHED", "isPromoted" => false), array('id' => 'DESC'));
}
$talents = $em->getRepository('AppBundle:Company')->findBy(array("type" => "TALENT", "emphasis" => true), array('emphasisOrder' => 'DESC'));
$companies = $em->getRepository('AppBundle:Company')->findBy(array("type" => "COMPANY", "emphasis" => true), array('emphasisOrder' => 'ASC'));
$companies = $em->getRepository('AppBundle:Company')->findBy(array("type" => "COMPANY", "emphasis" => true), array('emphasisOrder' => 'DESC'));
$territories = $em->getRepository('AppBundle:Company')->findBy(array("type" => "TERRITORY", "emphasis" => true), array('emphasisOrder' => 'ASC'));
$arrayTalents = array();
@@ -49,6 +49,7 @@ class PushController extends Controller
return new JsonResponse(array('success' => true),200);
}
/**
* @Route("/push/delete-subscription/", name="delete-subscription")
*/
@@ -160,7 +160,7 @@ class Ad
*
* @ORM\Column(name="public_tag", type="json_document", nullable=true, options={"jsonb":true})
*
*
* @Groups({"ad_detail", "answer_detail"})
*/
private $publicTag;
@@ -249,11 +249,14 @@ class Ad
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\TerritoryAd", mappedBy="ad", cascade={"persist", "remove"})
*
* @Groups({"ad_detail" , "answer_detail"})
*/
private $territories;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\BookmarkAd", mappedBy="ad", cascade={"persist", "remove"})
*
*/
private $bookmarkAds;
@@ -351,7 +351,7 @@ class Company
if (empty($this->publicTag))
$empty++;
if ($this->presentation_video === null)
if ($this->presentationVideo == null)
$empty++;
if (is_array($this->ad) && empty($this->ad))
@@ -24,26 +24,28 @@ class TerritoryAd
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Groups({"company_detail"})
* @Groups({"ad_detail" , "company_detail"})
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Company", inversedBy="territoryAds")
* @ORM\JoinColumn(nullable=false)
* @Groups({"company_detail"})
* @Groups({"ad_detail" , "company_detail"})
*/
private $territory;
/**
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Ad", inversedBy="territories")
* @ORM\JoinColumn(nullable=true)
* @Groups({"ad_detail" , "company_detail"})
*/
private $ad;
/**
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Company", inversedBy="territoryAds")
* @ORM\JoinColumn(nullable=true)
* @Groups({"ad_detail" , "company_detail"})
*/
private $company;
@@ -229,6 +229,7 @@ class User extends BaseUser
$name = md5(uniqid()) . '.' . $this->file->guessExtension();
$this->file->move($this->getUploadRootDir(), $name);
$this->photo = $name;
}
public function getUploadDir()
@@ -373,7 +374,12 @@ class User extends BaseUser
"lastname" => $this->getLastname(),
"email" => $this->getEmail(),
"picture" => $this->getPhoto(),
"socialPicture" => $this->getSocialPicture()
"socialPicture" => $this->getSocialPicture(),
"phone" => $this->getCompany()->getExtra()["phoneTalent"],
"linkedin" => $this->getCompany()->getExtra()["linkedin"],
"twitter" => $this->getCompany()->getExtra()["twitter"],
"currentJob" => $this->getCompany()->getExtra()["titleTalent"],
"website" => $this->getCompany()->getWebsite(),
);
return $card;
}
@@ -0,0 +1,25 @@
<?php
namespace AppBundle\Form\Admin;
use AppBundle\Entity\User;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class UserCompanyType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('email', null, array('required' => true, 'label' => 'Email'));
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => User::class,
));
}
}
@@ -25,6 +25,27 @@ class AnswerRepository extends AbstractRepository
return $this->paginate($qb, $limit, $offset);
}
// Query to find messages excluding Draft message and talent video for chat
public function findOneByWithCorrespondences($user, $answerId)
{
$qb = $this
->createQueryBuilder('a')
->select(['a','m','ad'])
->where('a.user = :user')
->andWhere('a.id = :id')
->setParameter('user', $user)
->setParameter('id', $answerId)
->leftJoin('a.messages', 'm','WITH', 'm.status NOT IN(\'DRAFT\',\'CONTACT_TALENT\')')
// ->setParameter(':status', array('DRAFT','CONTACT_TALENT'))
->leftJoin('a.ad', 'ad')
->leftJoin('a.company', 'company')
;
return $qb
->getQuery()
->getResult();
}
public function getAnswerByCompany($id)
{
$qb = $this
@@ -10,4 +10,21 @@ namespace AppBundle\Repository;
*/
class MessageRepository extends \Doctrine\ORM\EntityRepository
{
public function searchCorrespondences($answer)
{
$qb = $this
->createQueryBuilder('m')
->select('m')
->where('m.answer = :answer')
->setParameter('answer', $answer)
->andWhere('m.status <> :status')
->setParameter(':status', 'DRAFT')
;
return $qb
->getQuery()
->getResult();
}
}
// add status = SENDED;
@@ -67,18 +67,18 @@ class UserSubscriptionRepository extends \Doctrine\ORM\EntityRepository
) AS decimal) / 15) * 100 ) >= :percent')
->setParameters(array('percent' => $completenessPercentage));
dump($qb->getQuery()->getSql());
//dump($qb->getQuery()->getSql());
$result = $qb->getQuery()->getResult();
dump($result);
//dump($result);
return $result;
}
public function findByTagMatching($tags)
{
dump($tags);
//dump($tags);
$config = $this->_em->getConfiguration();
$config->addCustomNumericFunction('CAST', 'AppBundle\Repository\Query\CastAs');
@@ -96,11 +96,11 @@ class UserSubscriptionRepository extends \Doctrine\ORM\EntityRepository
}
}
dump($qb->getQuery()->getSql());
//dump($qb->getQuery()->getSql());
$result = $qb->getQuery()->getResult();
dump($result);
//dump($result);
return $result;
}
@@ -106,6 +106,7 @@ class RegistrationListener implements EventSubscriberInterface
$company->setType("TALENT");
} elseif ($user->hasRole('ROLE_COMPANY')) {
$company->setType("COMPANY");
$company->setIsPrivate(true);
} elseif ($user->hasRole('ROLE_TERRITORY')) {
$company->setType("TERRITORY");
} else {
@@ -91,6 +91,7 @@ class CompanyManager
'titleTalent' => $talent->getTitleTalent(),
'situationTalent' => $talent->getSituationTalent(),
'descriptionTalent' => $talent->getDescriptionTalent(),
'phoneTalent' => $talent->getPhoneTalent(),
);
$talent->setExtra($extra);
@@ -105,9 +105,9 @@ class NotificationSender implements ContainerAwareInterface
$user = $this->userManager->findUserBy(array('email' => $email));
$output->writeln('$user : ' . $user->getFirstname());
$users = $this->subscriptionManager->getAll();
$subscriptions = $this->subscriptionManager->findByEmails(array($email));
foreach ($users as $subscription) {
foreach ($subscriptions as $subscription) {
$this->sendNotification($output, $subscription);
}
@@ -142,6 +142,8 @@ class NotificationSender implements ContainerAwareInterface
private function sendNotification(OutputInterface $output, $subscription)
{
$output->writeln(' ====== subscription ======');
$output->writeln($subscription->getEndpoint());
!$output->isVerbose()?:$output->writeln('send to user ---> ' . $subscription->getEndpoint());
$this->sender->sendNotification(
@@ -12,7 +12,7 @@ trait ExtraJsonTrait
*
* @ORM\Column(name="extra", type="json_document", nullable=true)
*
* @Groups({"company_detail", "company_list"})
* @Groups({"ad_detail" , "company_detail", "company_list"})
*/
private $extra;
@@ -24,6 +24,7 @@ trait ExtraJsonTrait
private $size;
private $siren;
private $phoneTalent;
private $titleTalent;
private $situationTalent;
private $descriptionTalent;
@@ -41,6 +42,7 @@ trait ExtraJsonTrait
isset($extra['linkedin']) ? $this->linkedin = $extra['linkedin'] : null;
isset($extra['size']) ? $this->size = $extra['size'] : null;
isset($extra['siren']) ? $this->siren = $extra['siren'] : null;
isset($extra['phoneTalent']) ? $this->phoneTalent = $extra['phoneTalent'] : null;
isset($extra['titleTalent']) ? $this->titleTalent = $extra['titleTalent'] : null;
isset($extra['situationTalent']) ? $this->situationTalent = $extra['situationTalent'] : null;
isset($extra['descriptionTalent']) ? $this->descriptionTalent = $extra['descriptionTalent'] : null;
@@ -115,6 +117,18 @@ trait ExtraJsonTrait
return $this->siren;
}
public function setPhoneTalent($phoneTalent)
{
$this->phoneTalent = $phoneTalent;
return $this;
}
public function getPhoneTalent()
{
return $this->phoneTalent;
}
public function setTitleTalent($titleTalent)
{
$this->titleTalent = $titleTalent;
+2
View File
@@ -2912,3 +2912,5 @@ a.link-white-underline {
/*Modules
---------------------------------------------------*/
/*# sourceMappingURL=admin.css.map */
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1,7 @@
{
"parameters": {
"pushType": "tags",
"keywords": "surf;voile",
"profilCompletenessPercentage": "10",
"users": "thomas.berrod@e-declic.com;thomas.berrod@e-declic.com;thomas.berrod@e-declic.com"
"keywords": "trytodev"
},
"notification": {
"title": "Coriolis composites",
@@ -12,7 +10,7 @@
"image": "https://i.vimeocdn.com/video/668043830.webp?mw=1100&mh=619&q=70",
"tag": "open-window",
"data": {
"link": "http://localhost/app_dev.php/annonce/7-composites-studies-engineer"
"link": "http://localhost/annonce/7-composites-studies-engineer"
}
}
}
@@ -1,7 +1,7 @@
{
"parameters": {
"pushType": "tags",
"keywords": "surf;voile"
"keywords": "trytodev"
},
"notification": {
"title": "D'après vous",
@@ -20,7 +20,7 @@ $grey6 : #999CA2;
$grey7 : #1E2327;
$orange: #ff9800;
$orangeNewApp: #ffe600;
$orangeNewApp: #FFCE00;
$font-1: 'Raleway', sans-serif;
$font-2: "Varela Round", sans-serif;