Compare commits

...

12 Commits

Author SHA1 Message Date
Thomas MONCHICOURT e9a7da75bc Feat : remise en ligne annonce rocher 2018-05-18 12:26:34 +02:00
Thomas MONCHICOURT 5612f87999 Fix : probleme connexion user admin 2018-05-02 15:09:54 +02:00
Thomas MONCHICOURT b63983b61e Feat : modification profil talent #6313 @0h15 2018-05-02 14:19:00 +02:00
Thomas MONCHICOURT 43858b06ff Feat : modification Css 2018-04-30 15:21:57 +02:00
Thomas MONCHICOURT f012f91ca4 Merge branch 'master' of https://git.e-declic.net/talents-tube/website 2018-04-30 15:11:14 +02:00
Thomas MONCHICOURT 2ba454f2ab Feat : style responsive 2018-04-30 15:11:05 +02:00
Thomas MONCHICOURT 2426dc5abc Feat : correction tuto responsive @1h 2018-04-30 15:10:26 +02:00
Maxime Thévenot 703ec9a1bb Fix : bug on talent deleting 2018-04-26 17:18:42 +02:00
Maxime Thévenot 4a72e4dfe6 Merge branch 'develop' of https://git.e-declic.net/talents-tube/website into develop
# Conflicts:
#	volume/www/website/www/src/AppBundle/Entity/Company.php
2018-04-26 16:42:01 +02:00
Maxime Thévenot 607f7706ca Feat : add capability to delete company from secret admin 2018-04-26 16:40:49 +02:00
Thomas MONCHICOURT b0b1179bdc Feat : Modification listing company #6269 @1h30 2018-04-24 14:16:19 +02:00
Thomas MONCHICOURT 0e2494797e Fix : Bloc vidéo après mot clés #6266 @0h25 2018-04-23 16:09:00 +02:00
29 changed files with 433 additions and 243 deletions
+2
View File
@@ -10,6 +10,8 @@ RUN rm /etc/nginx/conf.d/default.conf \
&& sed -i 's|include /etc/nginx/conf.d/\*.conf;|include /etc/nginx/conf.d/\*.conf;\ninclude /etc/nginx/sites-enabled/\*.conf;\n|' /etc/nginx/nginx.conf
COPY log_format.conf /etc/nginx/conf.d/
COPY tt-dev.crt /etc/nginx/ssl/server.crt
COPY tt-dev.key /etc/nginx/ssl/server.key
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/
+22
View File
@@ -0,0 +1,22 @@
-----BEG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/JTgMaIO5LfZiht2xyxN4gN2XVp6k4Jn5SPxGuGV+e5QSr
9R04x5wN6NwZAprL70UuztHZdXpzNVogF4hF4LdGDT8CbeFF5ciiTQaAKwX9euOT
HRf6RGT80qiKVcZ+C3zhR6CxAwKBgQDZG39+6DzdGetLzls7B6R1PPV7RLOn6bts
jbxSkx/VksHkS1Q4lG1fXM2q/VdSTFg/gNNKzLCADDVrO9KonvVrvMZlshiSLXTJ
GVgfe+UGSL7VjbH4G4bAqznK5zK8ADI1BRyCU3UrzFqRHoV9h9e2qIfjJrK4taX7
G5KAukDUnQKBgQC6GBLOnTtgY5+xkWjEyP6Ba7QkvlBpBB465FWGk31+BiDlnpyd
/5pu6jC/OtzPDUQG84t/A4Pr/n+ciShEo4mj6SENtVmn8yJcf776Gy5rKBuYQj9U
ALTjpZVRcRlNjccctBwT3tJRXgMHfbQBsYN8tr7TwHHKLh00QQF5lUlPywKBgB2a
SkAbmnDrX9HuSTI7UIlLzo0ISRbUH+IlUVBRDz4nzJg8TTeJxYADP2fZM1bdYgsG
ncjNMCPFhmMgvRCQ3BXcn5CuP/tuh0YEVqe0VP4OXTbxIxsZZb5Pmom4DIrl2/Ku
x7xddNSMAK1Y5ArBwv/86spmNGhLHF6o28kBnGVhAoGAOcGzpJi1l0BzNUKBS512
XlLUYswFW6OqcEk1iGTvEFUzZ9Agp2Yc7HZ3MrmCAjugx37tAfNKQglF2/AJ9Uuy
yoUpPtdXX6CuPTMkzCkvAYbRGohE/cw7ZjI6vTqoEPiyrQA1lJYTIMQm3FYivjJl
z84K0Vlv64BeiIpJrvzW+2A=
-----END PRIVATE KEY-----
+1
View File
@@ -5,6 +5,7 @@ services:
nginx:
ports:
- "80:80"
- "443:443"
volumes:
- ../volume/www:/home/www:cached
restart: "no"
+4 -1
View File
@@ -8,11 +8,14 @@ upstream store_php {
}
server {
listen 80;
listen 443 ssl;
server_name talentstube.test;
root /home/www/website/www/web;
client_max_body_size 500M;
sendfile off;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
# DEV
location / {
+2 -1
View File
@@ -9,4 +9,5 @@ rewrite ^/plateforme$ https://www.talentstube.com/ permanent;
rewrite ^/page/les-conseils$ https://www.talentstube.com/accompagnement-entreprise permanent;
rewrite ^/page/presentation-talent$ https://www.talentstube.com/cv-video permanent;
rewrite ^/page/la-plateforme$ https://www.talentstube.com/ permanent;
rewrite ^/tarifs$ https://www.talentstube.com/accompagnement-entreprise permanent;
rewrite ^/tarifs$ https://www.talentstube.com/accompagnement-entreprise permanent;
rewrite ^/annonce/38-charge-de-projets-developpement-h-f$ https://www.talentstube.com/annonce/38-charge-de-projets-developpement-cosmetique-h-f permanent;
@@ -1,13 +1,17 @@
{% extends 'admin/base_admin.html.twig' %}
{% block contentHeader %}
<h1>
Utilisateurs
<small>Liste</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ path('admin_dashboard') }}"><i class="fa fa-dashboard"></i> Dashboard</a></li>
<li>
<a href="{{ path('admin_dashboard') }}">
<i class="fa fa-dashboard"></i>
Dashboard</a>
</li>
<li>Secret</li>
<li class="active">Utilisateurs</li>
</ol>
{% endblock %}
@@ -18,41 +22,49 @@
<div class="box-body">
<table id="user_list_table" class="table table-hover table-bordered">
<thead>
<tr>
<th>Nom</th>
<th>Prénom</th>
<th class="col-md-3">Email</th>
<th>Etat</th>
<th>Roles</th>
<th>Action</th>
</tr>
<tr>
<th class="col-md-2">Nom</th>
<th class="col-md-2">Prénom</th>
<th class="col-md-3">Email</th>
<th class="col-md-1">Rôle</th>
<th class="col-md-3">Etat</th>
<th class="col-md-1">Action</th>
</tr>
</thead>
<tbody>
{% for u in users %}
<tr>
<td>{{ u.lastname }}</td>
<td>{{ u.firstname }}</td>
<td>{{ u.email }}</td>
<td>{% if u.enabled %} Activé
{% else %} Désactivé <br />
<a href="{{ path('admin_user_resend',{'id':u.id}) }}">Renvoyer le mail de confirmation</a>
{% endif %}</td>
<td>
{% for r in u.roles %}
{% if r != "ROLE_USER" %}
<span class="badge bg-blue" style="font-weight: 400;">{{ r }}</span>
{% for u in users %}
<tr>
<td>{{ u.lastname }}</td>
<td>{{ u.firstname }}</td>
<td>{{ u.email }}</td>
<td>
{% for r in u.roles %}
{% if r != "ROLE_USER" and r == "ROLE_TALENT" %}
<span class="badge bg-blue" style="font-weight: 400;">{{ r }}</span>
{% elseif r != "ROLE_USER" and r == "ROLE_COMPANY" %}
<span class="badge bg-orange" style="font-weight: 400;">{{ r }}</span>
{% endif %}
{% endfor %}
</td>
<td>
{% if u.enabled %}
Activé
{% else %}
Désactivé
<br/>
<a href="{{ path('admin_user_resend',{'id':u.id}) }}">Renvoyer le mail de confirmation</a>
{% endif %}
{% endfor %}
</td>
<td>
<a class="delete-user" href="{{ path('admin_user_delete',{'id':u.id}) }}" data-toggle="tooltip"
title="Supprimer">
<i class="fa fa-trash"></i>
</a>
</td>
</tr>
{% endfor %}
</td>
<td>
<a class="delete-user" href="{{ path('admin_user_delete',{'id':u.id}) }}" data-toggle="tooltip" title="Supprimer">
<i class="fa fa-trash"></i>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
@@ -74,15 +86,38 @@
"url": "https://cdn.datatables.net/plug-ins/1.10.11/i18n/French.json"
},
"columnDefs": [
{"targets": 0, "searchable": true, "orderable": true},
{"targets": 1, "searchable": true, "orderable": true},
{"targets": 2, "searchable": true, "orderable": true},
{"targets": 3, "searchable": true, "orderable": true, "className": "text-center"},
{"targets": 4, "searchable": false, "orderable": false, "className": "text-center"},
{
"targets": 0,
"searchable": true,
"orderable": true
}, {
"targets": 1,
"searchable": true,
"orderable": true
}, {
"targets": 2,
"searchable": true,
"orderable": true
}, {
"targets": 3,
"searchable": true,
"orderable": true,
"className": "text-center"
}, {
"targets": 4,
"searchable": false,
"orderable": false,
"className": "text-center"
}, {
"targets": 5,
"searchable": false,
"orderable": false,
"className": "text-center"
}
]
});
});
$(document).ready(function () {
$('[data-toggle="popover"]').popover();
@@ -95,14 +130,14 @@
buttons: {
confirm: {
text: 'Confirmer',
action: function(){
action: function () {
console.log(this.$target);
location.href = this.$target.attr('href');
return true;
}
},
cancel: {
text: 'Annuler',
cancel: {
text: 'Annuler'
}
}
});
@@ -35,17 +35,17 @@
<div class="col s12 m12 l8 xl9">
{% if ad.video and ad.status != "CLOSED" %}
<div class="row m-b-0" id="adVideo">
{% if ad.id == 38 %}
{#{% if ad.id == 38 %}
<img class="responsive-img" src="{{asset('/img/GROUPE-ROCHER-TT.jpg')}}">
{% else %}
<div class="embed-responsive embed-responsive-16by9">
<div class="col s12">
<iframe src="https://player.vimeo.com/video/{{ ad.video.cdnUrl|replace({ "/videos/": ""}) }}"
width="100%" height="640" frameborder="0" webkitallowfullscreen mozallowfullscreen
allowfullscreen></iframe>
</div>
{% else %}#}
<div class="embed-responsive embed-responsive-16by9">
<div class="col s12">
<iframe src="https://player.vimeo.com/video/{{ ad.video.cdnUrl|replace({ "/videos/": ""}) }}"
width="100%" height="640" frameborder="0" webkitallowfullscreen mozallowfullscreen
allowfullscreen></iframe>
</div>
{% endif %}
</div>
{#{% endif %}#}
{% if ad.isPromoted %}
<div class="isPromoted"><img src="{{asset('/img/offre-pourvue-gauche.png')}}" alt="promoted"></div>
{% endif %}
@@ -68,7 +68,7 @@
<div class="row">
<div class="col s12 col-noPadding">
<div class="owl-carousel owl-carousel-home home-company-carousel">
{% if talents|length > 0 %}
{% if companies|length > 0 %}
{% include 'default/company_card.html.twig' with {'companies': companies } %}
{% endif %}
</div>
@@ -4,7 +4,7 @@
<div class="item">
<a href="{{ path('talent_show',{'alias': talent.alias }) }}"
title="{{ user.firstname }} {{ user.lastname }}">
{% if user.socialPicture is not null %}
{% if user.socialPicture is not null and user.photo is null %}
<img class="circle z-depth-3" src="{{ user.socialPicture }}" alt="{{ user.firstname }} {{ user.lastname }}"/>
{% elseif user.photo %}
<img class="circle z-depth-3" src="{{ user.webPath | imagine_filter('profile_square') }}" alt="{{ user.firstname }} {{ user.lastname }}"/>
@@ -14,10 +14,10 @@
<div class="profil center-align">
{% set company = user.company %}
<div class="profil-picture">
{% if user.photo %}
<img src="{{ user.webPath | imagine_filter('profile_square') }}"
alt="{{ user.firstname }} {{ user.lastname|first|upper }}"
class="circle responsive-img"/>
{% if user.socialPicture is not null and user.photo is null %}
<img class="circle responsive-img" src="{{ user.socialPicture }}" alt="{{ user.firstname }} {{ user.lastname|first|upper }}"/>
{% elseif user.photo %}
<img class="circle responsive-img" src="{{ user.webPath | imagine_filter('profile_square') }}" alt="{{ user.firstname }} {{ user.lastname }}"/>
{% else %}
<div class="circle-letters font-2">{{ user.firstname|first|upper }}{{ user.lastname|first|upper }}</div>
{% endif %}
@@ -88,10 +88,14 @@
<div class="item-detail-description">
<p>{{ company.description|nl2br }}</p>
</div>
{% if company.descriptionAdmin %}
<h3 class="blue-text">Les mots clés</h3>
{% for tag in company.publicTag %}
<p class="chip">{{ tag }}</p>
{% endfor %}
</div>
</div>
</div>
{% if company.descriptionAdmin %}
<div class="col s12 m12 l8 xl9 right">
<div class="row bg-bordered">
<div class="col s12">
@@ -101,17 +105,7 @@
</div>
</div>
</div>
<div class="col s12 m12 l8 xl9 right">
<div class="row bg-bordered">
<div class="col s12">
{% endif %}
<h3 class="blue-text">Les mots clés</h3>
{% for tag in company.publicTag %}
<p class="chip">{{ tag }}</p>
{% endfor %}
</div>
</div>
</div>
{% if companyAds|length > 0 %}
<div id="offers" class="row">
<div class="col s12">
@@ -3,16 +3,11 @@
namespace AppBundle\Controller\Admin;
use AppBundle\Entity\Company;
use AppBundle\Entity\Media;
use AppBundle\Entity\Answer;
use AppBundle\Entity\Message;
use AppBundle\Entity\Bookmark;
use AppBundle\Form\Admin\TalentAdminType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class TalentController extends Controller
{
@@ -47,112 +42,4 @@ class TalentController extends Controller
'talent' => $talent,
));
}
/**
* @Route("/admin/config/user/list", name="admin_config_user")
*/
public function adminUserListAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$t = $em->getRepository('AppBundle:User')->findByRole('ROLE_TALENT');
return $this->render('admin/users_list.html.twig', array(
'users' => $t,
));
}
/**
* @Route("/admin/config/user/{id}/resend", name="admin_user_resend")
*/
public function adminUserResendAction(Request $request, $id)
{
$userManager = $this->get('fos_user.user_manager');;
$user = $userManager->findUserBy(array('id' => $id));
$mailer = $this->get('fos_user.mailer');
$mailer->sendConfirmationEmailMessage($user);
return $this->redirectToRoute('admin_config_user');
}
/**
* @Route("/admin/config/user/{id}/delete", name="admin_user_delete")
*/
public function adminUserDeleteAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$t = $em->getRepository('AppBundle:User')->findByRole('ROLE_TALENT');
$userManager = $this->get('fos_user.user_manager');;
$user = $userManager->findUserBy(array('id' => $id));
if(\is_null($user)) {
// user not found, generate $notFoundResponse
$this->addFlash(
'notice',
' user not found !'
);
}
\assert(!\is_null($user));
$company = $user->getCompany();
if($company){
$company->setPresentationVideo(null);
}
$this->deleteRelation($user);
$userManager->deleteUser($user);
if($company){
$em->remove($company);
}
$em->flush();
return $this->redirectToRoute('admin_config_user');
}
public function deleteRelation($user) {
$em = $this->getDoctrine()->getManager();
$answers = $em->getRepository('AppBundle:Answer')->findBy(array('user' => $user));
$medias = $em->getRepository('AppBundle:Media')->findBy(array('creator'=> $user));
$sendMessage = $em->getRepository('AppBundle:Message')->findBy(array('sender'=> $user));
$recipMessage = $em->getRepository('AppBundle:Message')->findBy(array('recipient'=> $user));
$bookmarks = $em->getRepository('AppBundle:Bookmark')->findBy(array('creator'=> $user));
if ($sendMessage) {
foreach ($sendMessage as $key => $message) {
$message->setSender(null);
$message->setAnswer(null);
}
$em->flush();
}
if ($recipMessage) {
foreach ($recipMessage as $key => $message) {
$message->setRecipient(null);
$message->setAnswer(null);
}
$em->flush();
}
if ($bookmarks) {
foreach ($bookmarks as $key => $bookmark) {
$em->remove($bookmark);
}
$em->flush();
}
if ($answers) {
foreach ($answers as $key => $answer) {
$em->remove($answer);
}
$em->flush();
}
if ($medias) {
foreach ($medias as $key => $media) {
$em->remove($media);
}
$em->flush();
}
}
}
@@ -11,7 +11,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;
class UserController extends Controller
{
@@ -30,7 +29,7 @@ class UserController extends Controller
}
}
return $this->render('admin/user_list.html.twig', [
'users' => $users
'users' => $users,
]);
}
@@ -64,4 +63,142 @@ class UserController extends Controller
'form' => $form->createView(),
]);
}
/**
* @Route("/admin/config/user/list", name="admin_config_others_user")
*/
public function adminOthersUsersListAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$t = $em->getRepository('AppBundle:User')->findTalentsAndCompanies();
return $this->render('admin/users_list.html.twig', array(
'users' => $t,
));
}
/**
* @Route("/admin/config/user/{id}/resend", name="admin_user_resend")
*/
public function adminUserResendAction(Request $request, $id)
{
$userManager = $this->get('fos_user.user_manager');
$user = $userManager->findUserBy(array('id' => $id));
$mailer = $this->get('fos_user.mailer');
$mailer->sendConfirmationEmailMessage($user);
return $this->redirectToRoute('admin_config_user');
}
/**
* @Route("/admin/config/user/{id}/delete", name="admin_user_delete")
*/
public function adminUserDeleteAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$t = $em->getRepository('AppBundle:User')->findByRole('ROLE_TALENT');
$userManager = $this->get('fos_user.user_manager');
$user = $userManager->findUserBy(array('id' => $id));
if (\is_null($user)) {
// user not found, generate $notFoundResponse
$this->addFlash(
'notice',
' user not found !'
);
}
\assert(!\is_null($user));
$company = $user->getCompany();
if ($company) {
$company->setPresentationVideo(null);
$em->persist($company);
$em->flush();
}
$this->deleteRelation($user);
$em->remove($user);
$em->flush();
if ($company) {
$em->remove($company);
$em->flush();
}
// if ($company) {
// $em->remove($company);
// }
$em->flush();
return $this->redirectToRoute('admin_config_others_user');
}
public function deleteRelation($user)
{
$em = $this->getDoctrine()->getManager();
$sendMessage = $em->getRepository('AppBundle:Message')->findBy(array('sender' => $user));
if ($sendMessage) {
foreach ($sendMessage as $key => $message) {
$message->setSender(null);
$message->setAnswer(null);
}
$em->flush();
}
$recipMessage = $em->getRepository('AppBundle:Message')->findBy(array('recipient' => $user));
if ($recipMessage) {
foreach ($recipMessage as $key => $message) {
$message->setRecipient(null);
$message->setAnswer(null);
}
$em->flush();
}
$bookmarks = $em->getRepository('AppBundle:Bookmark')->findBy(array('creator' => $user));
if ($bookmarks) {
foreach ($bookmarks as $key => $bookmark) {
$em->remove($bookmark);
}
$em->flush();
}
$answers = $em->getRepository('AppBundle:Answer')->findBy(array('user' => $user));
if ($answers) {
foreach ($answers as $key => $answer) {
$em->remove($answer);
}
$em->flush();
}
$ads = $em->getRepository('AppBundle:Ad')->findBy(array('creator' => $user));
if ($ads) {
foreach ($ads as $key => $ad) {
$bms = $em->getRepository('AppBundle:BookmarkAd')->findBy(array('ad' => $ad));
foreach ($bms as $key2 => $bm) {
$em->remove($bm);
}
$em->remove($ad);
}
$em->flush();
}
$ads = $em->getRepository('AppBundle:Ad')->findBy(array('company' => $user->getCompany()));
if ($ads) {
foreach ($ads as $key => $ad) {
$bms = $em->getRepository('AppBundle:BookmarkAd')->findBy(array('ad' => $ad));
foreach ($bms as $key2 => $bm) {
$em->remove($bm);
}
$em->remove($ad);
}
$em->flush();
}
$medias = $em->getRepository('AppBundle:Media')->findBy(array('creator' => $user));
if ($medias) {
foreach ($medias as $key => $media) {
$em->remove($media);
}
$em->flush();
}
}
}
@@ -173,25 +173,30 @@ class Ad
***********************/
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Answer", mappedBy="ad", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Answer", mappedBy="ad", cascade={"persist", "remove"})
*/
private $answers;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\ProductAd", mappedBy="ad", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\ProductAd", mappedBy="ad", cascade={"persist", "remove"})
*/
private $products;
/**
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Note", cascade={"persist"})
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Note", cascade={"persist", "remove"})
*/
private $draftNotes;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\TerritoryAd", mappedBy="ad", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\TerritoryAd", mappedBy="ad", cascade={"persist", "remove"})
*/
private $territories;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\BookmarkAd", mappedBy="ad", cascade={"persist", "remove"})
*/
private $bookmarkAds;
/***********************
* Constructor
@@ -71,12 +71,12 @@ class Answer
***********************/
/**
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Note", cascade={"persist"})
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Note", cascade={"persist", "remove"})
*/
private $notes;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Message", mappedBy="answer", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Message", mappedBy="answer", cascade={"persist", "remove"})
*/
private $messages;
@@ -84,7 +84,6 @@ class Answer
* Constructor
***********************/
public function __construct($user = null, $ad = null, $status = null, $company = null)
{
$this->notes = new \Doctrine\Common\Collections\ArrayCollection();
@@ -116,12 +115,10 @@ class Answer
}
/***********************
* Getters & Setters
***********************/
/**
* Get id.
*
@@ -51,7 +51,7 @@ class Bookmark
***********************/
/**
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\User", mappedBy="sharedBookmarks" ,cascade={"persist"})
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\User", mappedBy="sharedBookmarks" ,cascade={"persist", "remove"})
*/
private $sharedWith;
@@ -27,7 +27,7 @@ class BookmarkAd
private $id;
/**
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Note", cascade={"persist"})
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Note", cascade={"persist","remove"})
*/
private $notes;
@@ -42,7 +42,6 @@ class BookmarkAd
*/
private $ad;
/***********************
* Constructor
***********************/
@@ -57,7 +56,6 @@ class BookmarkAd
* Getters & Setters
***********************/
/**
* Get id.
*
@@ -48,7 +48,7 @@ class BookmarkUser
***********************/
/**
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Note", cascade={"persist"})
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Note", cascade={"persist", "remove"})
*/
private $notes;
@@ -85,10 +85,10 @@ class Company
private $alias;
/**
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Media", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Media", cascade={"persist", "remove"})
* @ORM\JoinColumn(name="presentation_video_id", nullable=true)
*/
private $presentation_video;
private $presentationVideo;
/**
* @var string
@@ -135,26 +135,25 @@ class Company
private $users;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Ad",mappedBy="company", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Ad",mappedBy="company", cascade={"persist", "remove"})
*/
private $ads;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\TerritoryAd", mappedBy="territory", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\TerritoryAd", mappedBy="territory", cascade={"persist", "remove"})
*/
private $territoryAds;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\TerritoryAd", mappedBy="company", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\TerritoryAd", mappedBy="company", cascade={"persist", "remove"})
*/
private $territories;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Answer",mappedBy="company", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Answer",mappedBy="company", cascade={"persist", "remove"})
*/
private $spontaneousApplications;
/***********************
* Constructor
***********************/
@@ -171,7 +170,8 @@ class Company
* Custom Function
***********************/
public function init(){
public function init()
{
$this->initAddress();
$this->initTags();
$this->initExtra();
@@ -252,8 +252,8 @@ class Company
{
$arrayPublishedAds = array();
foreach ($this->getAds() as $ad) {
if( $ad->getStatus() == "PUBLISHED") {
array_push($arrayPublishedAds, $ad);
if ($ad->getStatus() == "PUBLISHED") {
array_push($arrayPublishedAds, $ad);
}
}
@@ -274,7 +274,6 @@ class Company
* Getter & Setters
***********************/
/**
* Get id.
*
@@ -498,7 +497,7 @@ class Company
*/
public function setPresentationVideo(\AppBundle\Entity\Media $presentationVideo = null)
{
$this->presentation_video = $presentationVideo;
$this->presentationVideo = $presentationVideo;
return $this;
}
@@ -510,7 +509,7 @@ class Company
*/
public function getPresentationVideo()
{
return $this->presentation_video;
return $this->presentationVideo;
}
/**
@@ -601,7 +600,6 @@ class Company
$this->file = $file;
}
/**
* Set emphasis.
*
@@ -27,7 +27,7 @@ class ProductAd
private $id;
/**
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Product", cascade={"persist"})
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Product", cascade={"persist" , "remove"})
*/
private $product;
@@ -69,49 +69,47 @@ class User extends BaseUser
private $file;
/***********************
* OneToMany Array's
***********************/
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Answer",mappedBy="user", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Answer",mappedBy="user", cascade={"persist", "remove"})
*/
private $answers;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Ad",mappedBy="creator", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Ad",mappedBy="creator", cascade={"persist", "remove"})
*/
private $ads;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Product",mappedBy="user", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Product",mappedBy="user", cascade={"persist", "remove"})
*/
private $products;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Media",mappedBy="creator", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Media",mappedBy="creator", cascade={"persist", "remove"})
*/
private $medias;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Bookmark",mappedBy="creator", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Bookmark",mappedBy="creator", cascade={"persist", "remove"})
*/
private $bookmarks;
/**
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Bookmark", inversedBy="sharedWith", cascade={"persist"})
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Bookmark", inversedBy="sharedWith", cascade={"persist", "remove"})
*/
private $sharedBookmarks;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Message",mappedBy="sender", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Message",mappedBy="sender", cascade={"persist", "remove"})
*/
private $sendedMessages;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Message",mappedBy="recipient", cascade={"persist"})
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Message",mappedBy="recipient", cascade={"persist", "remove"})
*/
private $receivedMessages;
@@ -151,8 +149,6 @@ class User extends BaseUser
*/
private $socialPicture;
/***********************
* Constructor
***********************/
@@ -285,7 +281,6 @@ class User extends BaseUser
* Getters & Setters
***********************/
/**
* Set firstname.
*
@@ -14,6 +14,16 @@ class CompanyRepository extends EntityRepository
{
public function getCompanySortByAds()
{
$qb = $this
->createQueryBuilder('c')
->andWhere('c.type = :type')
->setParameter(':type', "COMPANY")
->andWhere('c.presentationVideo IS NOT NULL')
->orderBy('c.cTime', 'DESC');
$badCompany = $qb->getQuery()->getResult();
$qb = $this
->createQueryBuilder('c')
->from('AppBundle:Ad', 'a')
@@ -21,10 +31,26 @@ class CompanyRepository extends EntityRepository
->andWhere('a.status = :status')
->orderBy('a.publishedAt', 'DESC')
->setParameter(':status', "PUBLISHED");
$firstCompany = $qb->getQuery()->getResult();
return $qb
->getQuery()
->getResult();
$mergeArray = array();
array_map(function($a, $b) use (&$mergeArray) {
if($a){
if(!isset($mergeArray[$a->getId()])) {
$mergeArray[$a->getId()] = $a;
}
}
if ($b) {
if (!isset($mergeArray[$b->getId()])) {
$mergeArray[$b->getId()] = $b;
}
}
}, $firstCompany, $badCompany);
return $mergeArray;
}
public function getTerritorySortByAds()
@@ -18,7 +18,20 @@ class UserRepository extends EntityRepository
$qb->select('u')
->from($this->_entityName, 'u')
->where('u.roles LIKE :roles')
->setParameter('roles', '%"'.$role.'"%');
->setParameter('roles', '%"' . $role . '"%');
return $qb->getQuery()->getResult();
}
public function findTalentsAndCompanies()
{
$qb = $this->_em->createQueryBuilder();
$qb->select('u')
->from($this->_entityName, 'u')
->where('u.roles LIKE :roleT')
->orWhere('u.roles LIKE :roleC')
->setParameter('roleC', '%ROLE_COMPANY%')
->setParameter('roleT', '%ROLE_TALENT%');
return $qb->getQuery()->getResult();
}
@@ -71,14 +71,14 @@ class PrestaBridgeListener implements EventSubscriberInterface
{
if (!$this->avoidMode) {
$user = $this->security->getToken()->getUser();
$prestaBridge = new PrestashopBridge($this->pathToPrestashop, $this->idShop, $this->cookieKey);
if (!$prestaBridge->userExist($user->getEmail()))
$prestaBridge->createUser($user);
$prestaBridge->login($user->getEmail());
if($user->hasRole('ROLE_TALENT') || $user->hasRole('ROLE_COMPANY') || $user->hasRole('ROLE_TERRITORY')) {
$prestaBridge = new PrestashopBridge($this->pathToPrestashop, $this->idShop, $this->cookieKey);
if (!$prestaBridge->userExist($user->getEmail()))
$prestaBridge->createUser($user);
$prestaBridge->login($user->getEmail());
}
}
}
/**
+17
View File
@@ -15606,6 +15606,7 @@ table.highlight > tbody > tr:hover {
#answerPage .col-content.bg-arrow {
background: url(/img/img_popupcv/step_arrow.svg) 40px no-repeat #FFFFFF; }
#answerPage #modal-tuto {
width: 80%;
min-height: 540px;
background: #FFFFFF; }
#answerPage #modal-tuto .col-content {
@@ -15650,6 +15651,22 @@ table.highlight > tbody > tr:hover {
color: #FFF;
text-decoration: none; }
@media only screen and (max-width: 800px) {
#modal-tuto {
width: 98%; }
#modal-tuto .modal-content {
padding: 10px; }
#modal-tuto .modal-content h3 {
font-size: 1.5rem; }
#modal-tuto .modal-content .col {
padding: 0; }
#modal-tuto .modal-content .owl-dots {
display: none; }
#modal-tuto .modal-content .carousel-fixed-item {
margin-top: 0;
margin-right: 0;
font-size: 13px;
margin-bottom: 50px; } }
/*Pages
---------------------------------------------------*/
#ad_show .bg-bordered {
File diff suppressed because one or more lines are too long
+9 -3
View File
@@ -16,6 +16,11 @@ function openModal(){
}
$(document).ready(function(){
var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
padding = 0;
if(width > 800){
var padding = 45;
}
$('#modal-tuto').modal({
dismissible: false,
ready: function(modal, trigger) {
@@ -25,7 +30,7 @@ $(document).ready(function(){
nav: true,
loop: false,
margin: 50,
stagePadding: 45,
stagePadding: padding,
navRewind:false,
navText: ['<span class="left-arrow"></span>', '<span class="right-arrow"></span>']
});
@@ -95,19 +100,20 @@ function eraseCookie(name) {
/* GESTON de la webcam */
var elementExists = document.getElementById("myCvVideo");
if(document.body.contains(elementExists)){
var player = videojs("myCvVideo",
{
controls: true,
width: 320,
height: 240,
fluid: false,
plugins: {
record: {
audio: true,
video: true,
maxLength: 300,
debug: true,
videoMimeType: 'video/mp4',
debug: true
}
}
});
@@ -74,6 +74,7 @@
background: url(/img/img_popupcv/step_arrow.svg) 40px no-repeat #FFFFFF;;
}
#modal-tuto{
width: 80%;
min-height: 540px;
background: $white;
.col-content{
@@ -141,4 +142,28 @@
}
}
}
}
@media only screen and (max-width: 800px) {
#modal-tuto {
width: 98%;
.modal-content{
h3{
font-size: 1.5rem;
}
padding:10px;
.col{
padding: 0;
}
.owl-dots{
display: none;
}
.carousel-fixed-item{
margin-top:0;
margin-right:0;
font-size: 13px;
margin-bottom:50px;
}
}
}
}