86 changed files with 289 additions and 425 deletions
-
8httpdocs/.idea/.gitignore
-
8httpdocs/.idea/httpdocs.iml
-
8httpdocs/.idea/modules.xml
-
4httpdocs/.idea/php.xml
-
6httpdocs/.idea/vcs.xml
-
10httpdocs/config/services.yaml
-
6httpdocs/config/services/admin.yaml
-
10httpdocs/config/services/registrations.yaml
-
6httpdocs/config/validator/validator.yaml
-
2httpdocs/repositories/rule-engine-bundle-acdr/Command/ActionProcessorCommand.php
-
8httpdocs/repositories/rule-engine-bundle-acdr/Command/FAImporterCommand.php
-
2httpdocs/repositories/rule-engine-bundle-acdr/Command/FillTranslationCommand.php
-
6httpdocs/repositories/rule-engine-bundle-acdr/Command/GEImporterCommand.php
-
2httpdocs/repositories/rule-engine-bundle-acdr/Command/NormalizeTranslationsCommand.php
-
4httpdocs/src/Admin/ContableAdmin.php
-
8httpdocs/src/Admin/ContactsAdmin.php
-
6httpdocs/src/Admin/ConvocatoriaAdmin.php
-
8httpdocs/src/Admin/LicitadorAdmin.php
-
2httpdocs/src/Admin/ServicioAdmin.php
-
2httpdocs/src/Admin/SupervisorAdmin.php
-
12httpdocs/src/Admin/WorkShopAdmin.php
-
10httpdocs/src/Blocks/StatsBlockService.php
-
4httpdocs/src/Blocks/TrainerClassesBlock.php
-
10httpdocs/src/Controller/Admin/CalendarAdminController.php
-
6httpdocs/src/Controller/Admin/ContableAdminController.php
-
10httpdocs/src/Controller/Admin/ContadorAdminController.php
-
2httpdocs/src/Controller/Admin/DashboardAdminController.php
-
4httpdocs/src/Controller/Admin/EncuestaAdminController.php
-
4httpdocs/src/Controller/Admin/FormularioAdminController.php
-
2httpdocs/src/Controller/Admin/IndicadorAdminController.php
-
18httpdocs/src/Controller/Admin/LicitadorAdminController.php
-
6httpdocs/src/Controller/Admin/ProcesoTareaAdminController.php
-
10httpdocs/src/Controller/Admin/RealizarTareaAdminController.php
-
2httpdocs/src/Controller/Admin/RespuestasFormularioAdminController.php
-
4httpdocs/src/Controller/Admin/RespuestasTareaAdminController.php
-
2httpdocs/src/Controller/Admin/ServicioAdminController.php
-
14httpdocs/src/Controller/Admin/SupervisorAdminController.php
-
4httpdocs/src/Controller/Admin/TareaAdminController.php
-
79httpdocs/src/Controller/Admin/TrainerAdminController.php.save
-
91httpdocs/src/Controller/Admin/TrainerAdminController.php.save.1
-
4httpdocs/src/Controller/Admin/WorkShopsAdminController.php
-
6httpdocs/src/Controller/Api/CountersApiController.php
-
22httpdocs/src/Controller/Api/GuardarTareaApiController.php
-
4httpdocs/src/Controller/Api/GuardarTareaApiNonAdminController.php
-
22httpdocs/src/Controller/Api/PreguntasApiController.php
-
4httpdocs/src/Controller/ChatController.php
-
6httpdocs/src/Controller/RegistrationFinancialActorController.php
-
4httpdocs/src/Controller/RegistrationGreenEnterpreneurController.php
-
6httpdocs/src/Controller/RegistrationTrainerController.php
-
2httpdocs/src/Controller/TareaErrorController.php
-
0httpdocs/src/Entity/.gitignore
-
8httpdocs/src/Entity/Bookmarks.php
-
6httpdocs/src/Entity/BussinessStage.php
-
6httpdocs/src/Entity/Comentarios.php
-
12httpdocs/src/Entity/Contable.php
-
8httpdocs/src/Entity/Convocatoria.php
-
6httpdocs/src/Entity/Encuesta.php
-
8httpdocs/src/Entity/Goal.php
-
6httpdocs/src/Entity/Inscripcion.php
-
18httpdocs/src/Entity/Licitador.php
-
2httpdocs/src/Entity/Preguntas.php
-
2httpdocs/src/Entity/PreguntasFormulario.php
-
6httpdocs/src/Entity/ProcesoGreenEnterpreneur.php
-
6httpdocs/src/Entity/Respuestas.php
-
6httpdocs/src/Entity/RespuestasFormulario.php
-
14httpdocs/src/Entity/Sector.php
-
12httpdocs/src/Entity/Servicio.php
-
10httpdocs/src/Entity/Supervisor.php
-
6httpdocs/src/Entity/TareaGreenEnterpreneur.php
-
6httpdocs/src/Entity/User.php
-
16httpdocs/src/Entity/WorkShop.php
-
6httpdocs/src/Form/Type/RegistrationFinancialActorFormType.php
-
4httpdocs/src/Form/Type/RegistrationGreenEnterpreneurFormType.php
-
4httpdocs/src/Form/Type/RegistrationTrainerFormType.php
-
2httpdocs/src/Repository/FinancialActorRepository.php
-
4httpdocs/src/Repository/GreenEntrepreneurRepository.php
-
2httpdocs/src/Resources/SonataAdminBundle/views/CRUD/list__action_share_files.html.twig
-
2httpdocs/src/Resources/SonataAdminBundle/views/CRUD/list__action_view_files.html.twig
-
6httpdocs/src/Resources/views/formcomponents/datatable.html.twig
-
4httpdocs/src/Resources/views/formcomponents/repetible/range.html.twig
-
4httpdocs/src/Resources/views/formcomponents/repetible/text.html.twig
-
6httpdocs/src/Resources/views/formcomponents/text.html.twig
-
2httpdocs/src/RuleEngine/Conditions/PerfilesCondition.php
-
2httpdocs/src/RuleEngine/Conditions/RespuestasCondition.php
-
6httpdocs/templates/database/components/formcomponents/datatable.html.twig
-
6httpdocs/templates/database/components/formcomponents/text.html.twig
@ -0,0 +1,8 @@ |
|||
# Default ignored files |
|||
/shelf/ |
|||
/workspace.xml |
|||
# Datasource local storage ignored files |
|||
/dataSources/ |
|||
/dataSources.local.xml |
|||
# Editor-based HTTP Client requests |
|||
/httpRequests/ |
|||
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<module type="WEB_MODULE" version="4"> |
|||
<component name="NewModuleRootManager"> |
|||
<content url="file://$MODULE_DIR$" /> |
|||
<orderEntry type="inheritedJdk" /> |
|||
<orderEntry type="sourceFolder" forTests="false" /> |
|||
</component> |
|||
</module> |
|||
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="ProjectModuleManager"> |
|||
<modules> |
|||
<module fileurl="file://$PROJECT_DIR$/.idea/httpdocs.iml" filepath="$PROJECT_DIR$/.idea/httpdocs.iml" /> |
|||
</modules> |
|||
</component> |
|||
</project> |
|||
@ -0,0 +1,4 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="PhpProjectSharedConfiguration" php_language_level="8.0" /> |
|||
</project> |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="VcsDirectoryMappings"> |
|||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" /> |
|||
</component> |
|||
</project> |
|||
@ -1,79 +0,0 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
|
|||
namespace App\Controller\Admin; |
|||
|
|||
use App\Controller\ChatController; |
|||
use App\Entity\FinancialActor; |
|||
use App\Entity\Bso; |
|||
use App\Entity\GreenEntrepreneur; |
|||
use App\Entity\Sala; |
|||
use App\Entity\SalaLastAccess; |
|||
use App\Entity\Tarea; |
|||
use App\Entity\User; |
|||
use Doctrine\Common\Collections\ArrayCollection; |
|||
use phpDocumentor\Reflection\Types\Object_; |
|||
use Sonata\AdminBundle\Controller\CRUDController; |
|||
use Symfony\Component\HttpFoundation\JsonResponse; |
|||
use Symfony\Component\HttpFoundation\Response; |
|||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; |
|||
|
|||
final class TrainerAdminController extends CRUDController |
|||
{ |
|||
public function contactarAjaxAction($id){ |
|||
$user = $this->getUser(); |
|||
if(!($user instanceof FinancialActor) && !($user instanceof Bso)){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$em = $this->getDoctrine()->getManager(); |
|||
$ge = $em->getReference(Trainer::class, $id); |
|||
if(!($ge instanceof Trainer)){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$sala = new Sala(); |
|||
$sala->addUser($user); |
|||
$sala->addUser($ge); |
|||
$sala->setDenominacion('Contacto'); |
|||
$lastAccess = new SalaLastAccess(); |
|||
$lastAccess->setSala($sala); |
|||
$lastAccess->setUser($ge); |
|||
$lastAccess->setLastAccess(new \DateTime("1970-01-01")); |
|||
$em->persist($lastAccess); |
|||
$sala->addSalaLastAccess($lastAccess); |
|||
$em->persist($sala); |
|||
$ge->addContacto($user); |
|||
$user->addContacto($ge); |
|||
$em->persist($ge); |
|||
$em->persist($user); |
|||
$em->flush(); |
|||
$route = $this->generateUrl('admin_app_trainer_giveAccessToFiles', ['id'=> $user->getId()]); |
|||
$message = "A financial actor would like to talk to you.<br><a href=\"{$route}\">Give access to files</a>"; |
|||
$this->chatController->publishMessage($message, $user, $sala); |
|||
return new JsonResponse("success", 200); |
|||
} |
|||
public function giveAccessToFilesAction($id){ |
|||
if(!$this->isXmlHttpRequest()){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$user = $this->getUser(); |
|||
if(!($user instanceof Trainer)){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$em = $this->getDoctrine()->getManager(); |
|||
$fa = $em->getReference(User::class, $id); |
|||
if(!($fa instanceof FinancialActor)){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$user->addFinancial($fa); |
|||
$em->persist($user); |
|||
$em->flush(); |
|||
$modalBody = "You have successfully shared your documents with ".$fa->getNombreCompleto(); |
|||
$modalTitle = "Congratulations!!!"; |
|||
return $this->renderWithExtraParams('listajaxactions/modal_content.html.twig', [ |
|||
'modalTitle' => $modalTitle, |
|||
'modalBody' => $modalBody, |
|||
], null); |
|||
} |
|||
|
|||
} |
|||
@ -1,91 +0,0 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
|
|||
namespace App\Controller\Admin; |
|||
|
|||
use App\Controller\ChatController; |
|||
use App\Entity\FinancialActor; |
|||
use App\Entity\Bso; |
|||
use App\Entity\GreenEntrepreneur; |
|||
use App\Entity\Sala; |
|||
use App\Entity\SalaLastAccess; |
|||
use App\Entity\Tarea; |
|||
use App\Entity\User; |
|||
use Doctrine\Common\Collections\ArrayCollection; |
|||
use phpDocumentor\Reflection\Types\Object_; |
|||
use Sonata\AdminBundle\Controller\CRUDController; |
|||
use Symfony\Component\HttpFoundation\JsonResponse; |
|||
use Symfony\Component\HttpFoundation\Response; |
|||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; |
|||
use Symfony\Component\HttpFoundation\RedirectResponse; |
|||
|
|||
final class TrainerAdminController extends CRUDController |
|||
{ |
|||
private $chatController; |
|||
|
|||
public function __construct(ChatController $chatController) |
|||
{ |
|||
$this->chatController = $chatController; |
|||
} |
|||
|
|||
|
|||
public function contactarAjaxAction($id){ |
|||
$user = $this->getUser(); |
|||
if(!($user instanceof FinancialActor) && !($user instanceof Bso)){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$em = $this->getDoctrine()->getManager(); |
|||
$ge = $em->getReference(User::class, $id); |
|||
if(!($ge instanceof Trainer)){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$sala = new Sala(); |
|||
$sala->addUser($user); |
|||
$sala->addUser($ge); |
|||
$sala->setDenominacion('Contacto'); |
|||
$lastAccess = new SalaLastAccess(); |
|||
$lastAccess->setSala($sala); |
|||
$lastAccess->setUser($ge); |
|||
$lastAccess->setLastAccess(new \DateTime("1970-01-01")); |
|||
$em->persist($lastAccess); |
|||
$sala->addSalaLastAccess($lastAccess); |
|||
$em->persist($sala); |
|||
$ge->addContacto($user); |
|||
$user->addContacto($ge); |
|||
$em->persist($ge); |
|||
$em->persist($user); |
|||
$em->flush(); |
|||
$route = $this->generateUrl('admin_app_trainer_giveAccessToFiles', ['id'=> $user->getId()]); |
|||
$message = "A financial actor would like to talk to you.<br><a href=\"{$route}\">Give access to files</a>"; |
|||
$message = "A financial actor would like to talk to you.<br><a href=\"{$route}\">Give access to files</a>"; |
|||
$this->chatController->publishMessage($message, $user, $sala); |
|||
return new RedirectResponse($this->generateUrl('sonata_admin_dashboard')); |
|||
|
|||
return new JsonResponse("success", 200); |
|||
} |
|||
public function giveAccessToFilesAction($id){ |
|||
if(!$this->isXmlHttpRequest()){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$user = $this->getUser(); |
|||
if(!($user instanceof GreenEntrepreneur)){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$em = $this->getDoctrine()->getManager(); |
|||
$fa = $em->getReference(User::class, $id); |
|||
if(!($fa instanceof FinancialActor)){ |
|||
throw new AccessDeniedHttpException(); |
|||
} |
|||
$user->addFinancial($fa); |
|||
$em->persist($user); |
|||
$em->flush(); |
|||
$modalBody = "You have successfully shared your documents with ".$fa->getNombreCompleto(); |
|||
$modalTitle = "Congratulations!!!"; |
|||
return $this->renderWithExtraParams('listajaxactions/modal_content.html.twig', [ |
|||
'modalTitle' => $modalTitle, |
|||
'modalBody' => $modalBody, |
|||
], null); |
|||
} |
|||
|
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue