Compare commits

..

7 Commits

Author SHA1 Message Date
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
14 changed files with 5988 additions and 10177 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 %}
@@ -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()
@@ -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,
));
}
@@ -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,
));
}
}
@@ -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;
}
@@ -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(
+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;
@@ -121,7 +121,7 @@
.fix-search{
position: fixed;
top: 60px;
top: 89px;
width: 100%;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;