src/Controller/RegionsController.php line 260

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\ClassTheatre\asides;
  4. use App\ClassTheatre\TheatreController;
  5. use App\Exception\RedirectException;
  6. use Doctrine\ORM\EntityManagerInterface;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
  9. use Symfony\Contracts\Translation\TranslatorInterface;
  10. use TheatreCore\Entity\AnnAnnonces;
  11. use TheatreCore\Entity\Bigregions;
  12. use TheatreCore\Entity\Contacts;
  13. use TheatreCore\Entity\Contents;
  14. use TheatreCore\Entity\Multimedias;
  15. use TheatreCore\Entity\News;
  16. use TheatreCore\Entity\Persons;
  17. use TheatreCore\Entity\Playlists;
  18. use TheatreCore\Entity\Spectacles;
  19. use TheatreCore\Entity\Texts;
  20. class RegionsController extends TheatreController
  21. {
  22.     // objet newsletters
  23.     public $newsletters null;
  24.     // objet abonnés / subscribers
  25.     public $subscribers null;
  26.     // raccourci view
  27.     public $view null;
  28.     // raccourci form
  29.     public $form null;
  30.     //les aides
  31.     private $asides null;
  32.     private $menu_content null;
  33.     private $area null;
  34.     private $regions null;
  35.     private $spectacles null;
  36.     // {{{ _construct()
  37.     public function __construct(EntityManagerInterface $emTranslatorInterface $translatorTokenStorageInterface $tokenStorage)
  38.     {
  39.         parent::__construct($translator$tokenStorage);
  40.         $this->context['controller'] = $this->view->controller 'regions';
  41.         $this->em $em;
  42.     }
  43.     // }}}
  44.     // {{{
  45.     private function InitController($area null$action null)
  46.     {
  47.         $this->view->action $this->context['action'] = $action;
  48.         // regions
  49.         $this->regions $this->em->getRepository(Bigregions::class);
  50.         $this->spectacles $this->em->getRepository(Spectacles::class);
  51.         $this->area $area;
  52.         //si une zone est bien sélectionné par l'utilisateur
  53.         if($this->area){
  54.             // nom de la région et code
  55.             if($this->regions->my_is_int($this->area)) {
  56.                 //le nom de la région
  57.                 $this->context['view']->region_name $this->regions->getRegionName($this->area);
  58.             } else {
  59.                 //le nom du pays
  60.                 $this->context['view']->country_name $this->spectacles->getNameCountry($this->area);
  61.             }
  62.             $this->context['view']->area $this->area;
  63.             $this->asides = new asides();
  64.         }
  65.         //sinon on redirige l'utiisateur dans la bonne direction
  66.         else{
  67.             throw new RedirectException($this->generateUrl('index'));
  68.         }
  69.     }
  70.     // }}}
  71.     // {{{ finalizeAction()
  72.     /** Code exécuté après chaque action
  73.      *
  74.      *
  75.      * @access protected
  76.      * @return void
  77.      */
  78.     protected function finalizeAction(){
  79.         $this->getAsides();
  80.         $this->context['view']->aside $this->asides->view($this->context['view']);
  81.         $region_name = (!empty($this->context['view']->region_name)) ? $this->context['view']->region_name $this->context['view']->country_name;
  82.         $this->context['view']->meta_description 'Toute l\'actualité de la scène théâtrale contemporaine en '.$region_name.'. Textes théâtraux contemporains et classiques, danse, performances, opéra... Le site propose des contenus pédagogiques, des vidéos, des critiques, des sélections de textes...';
  83.         $asides_top = new asides();
  84.         $asides_top->load(['aside_top' => array(
  85.             'php' => array(
  86.                 'method' => 'asidesUrlRegions',
  87.             )
  88.         )
  89.         ]);
  90.         $this->context['view']->aside_top $asides_top->view($this->context['view']);
  91.     }
  92.     // // }}}
  93.     // {{{ action_actualites()
  94.     /** page d'accueil de la région
  95.      *
  96.      * @Route("/regions/actualites/area/{area}", name="regions_actualites")
  97.      *
  98.      * @access public
  99.      * @return void
  100.      */
  101.     public function action_actualites($area null)
  102.     {
  103.         $this->InitController($area'actualites');
  104.         $ann_annonces $this->em->getRepository(AnnAnnonces::class);
  105.         // SQL des régions
  106.         $sql_region $this->em->getRepository(Bigregions::class)->getZipCode($this->area'contacts');
  107.         if ($sql_region) {
  108.             $this->context['view']->dernieres_annonces_emploi $ann_annonces->getLastAnnonces(array(0,3),array(3),65$this->area);
  109.             $this->context['view']->dernieres_annonces_stages $ann_annonces->getLastAnnonces(array(0,3),array(1),65$this->area);
  110.         } else {
  111.             return $this->redirectToRoute('erreur_type', ['type' => 'introuvable']);
  112.         }
  113.         //On récupère la liste des écoles disponibles pour la région
  114.         $idtypestructure 'EC';
  115.         $params_sql_typestructure = array(
  116.             'where' => array(
  117.                 array('contacts''idtypestructure'$idtypestructure),
  118.                 ' AND contacts.idcontact NOT IN (SELECT idcontact FROM contact_classification WHERE idclassification=99) ',
  119.                 ' AND '.$sql_region.' '
  120.             ),
  121.             'order' => array('contacts' => 'organisation'),
  122.             'direction' => 'ASC',
  123.             'idclassification' => array('NOT' => array(99)),
  124.             'limit' => array(0,300),
  125.             'dbg' => array('ecoles','Ecoles supérieures'),
  126.         );
  127.         $this->context['view']->ecoles $this->em->getRepository(Contacts::class)->getListContacts($params_sql_typestructure,array(),array('get_profile_picture' => true));
  128.         $this->getSpectaclesAffiches(); //les spectacles à l'affiche
  129.         $this->getSpectaclesJTN();
  130.         $this->getContamporainAffiche(); //les auteurs contemporainrs à l'affiche
  131.         $this->getSpectaclesAffichesVideos(); //les spectacles à l'affiche en vidéo
  132.         $this->getEvenements(); //les évènements
  133.         $this->getCritiques(); //les critiques
  134.         $this->getTextesByAuteurs(); //textes par l'auteur (inutilisé ?)
  135.         $this->getSpectaclesEduc(); //(inutilisé ?)
  136.         $this->getFondsInsertionProfessionnels();
  137.         return $this->view('regions/actualites.html.twig');
  138.     }
  139.     // }}}
  140.     // {{{ action_videos()
  141.     /** page d'accueil de la région
  142.      *
  143.      *
  144.      * @access public
  145.      * @return void
  146.      */
  147.     public function action_videos(){
  148.         echo" ok";
  149.         exit;
  150.     }
  151.     // }}}
  152.     // {{{ getContamporainAffiche()
  153.     /** Nous récupérons les informrations des auteurs contemporains à l'affiche
  154.      *
  155.      *
  156.      * @access public
  157.      * @return void
  158.      */
  159.     private function getContamporainAffiche(){
  160.         $person $this->em->getRepository(Persons::class);
  161.         $sql_area ' AND '.$this->regions->getZipCode($this->area);
  162.         $params_sql = array(
  163.             'special' => array(
  164.                 'with_photo' => true,
  165.                 'spectacle' => array(
  166.                     'type' => 'author',
  167.                     'prochains' => '365D',
  168.                     'person_periode' => 'contemporain',
  169.                     // 'text_edite' => true,
  170.                     'country' => 'FR'
  171.                 ),
  172.                 'random' => '',
  173.             ),
  174.             'params' => array(
  175.                 'limit' => array(0,4),
  176.                 'where' => $sql_area
  177.             ),
  178.             'dbg' => array('affiche_persons','Les auteurs à l\'affiche')
  179.         );
  180.         $params_display['vignette_format'] = array('width'=>$_ENV['VIGN_PERSONS_WIDTH'],'height'=>$_ENV['VIGN_PERSONS_HEIGHT'],'direction'=>'crop');
  181.         $this->context['view']->persons $person->getListPersons($params_sql,$params_display);
  182.     }
  183.     // }}}
  184.     public function getSpectaclesAffichesVideos(){
  185.         $multimedias $this->em->getRepository(Multimedias::class);
  186.         $sql_area ' AND'.$this->regions->getZipCode($this->area,'contacts');
  187.         $params_videos_affiche = array(
  188.             'where' => array($sql_area),
  189.             'affiche' => array('today' => 365),
  190.             'limit' => array(0,5),
  191.             'dbg' => array('affiche','Vidéos de spectacles à l\'affiche'),
  192.         );
  193.         $video_tete_result $multimedias->getListMultimedias($params_videos_affiche,
  194.             array('width'=>$_ENV['VIGN_VIDEO_WIDTH'],'height'=>$_ENV['VIGN_VIDEO_HEIGHT'],'fleche'=>'none','ratio' => '169'),
  195.             array('get_schedule' => true'get_schedule_ville' => $this->area,'format_vignette' => true));
  196.         foreach($video_tete_result as $k=>$v) {
  197.             $video_tete $v;
  198.             unset($video_tete_result[$v['idmultimedia']]);
  199.             break;
  200.         }
  201.         if(!empty($video_tete)){
  202.             $set_format = array('width'=>$_ENV['VIGN_VIDEO_WIDTH'],'height'=>$_ENV['VIGN_VIDEO_HEIGHT'],'fleche'=>'none','ratio' => '169');
  203.             $video_tete array_merge($video_tete, array(
  204.                 'vignette' => $multimedias->getVignetteMultimedia($video_tete['idmultimedia'],$set_format),
  205.                 'description_courte' => $multimedias->cutSentence($video_tete['description'],100),
  206.                 'langue' => $multimedias->getNameLanguage($video_tete['language'])
  207.             ));
  208.             // lien vers la video
  209.             foreach($video_tete['spectacles'] as $s) {
  210.                 $video_tete['url_clean_video'] = '/spectacles/'.$s['url_clean'].'/videos/'.$video_tete['url_clean'].'?autostart';
  211.             }
  212.             $this->context['view']->video_tete = array($video_tete);
  213.         }
  214.         $this->context['view']->videos_affiche $video_tete_result;
  215.     }
  216.     //on récupère les textes par l'auteurs auteurs
  217.     public function getTextesByAuteurs(){
  218.         $textes $this->em->getRepository(Texts::class);
  219.         $params_sql_spectacles = array(
  220.             'params' => array(
  221.                 'limit' => array(0,2),
  222.             ),
  223.             'special' => array(
  224.                 'playlists' => array(
  225.                     'text' => true,
  226.                     'idclassifications' => array(144), // par l'auteur
  227.                 ),
  228.                 'textfictif' => 0,
  229.                 'prochains' => '365',
  230.                 'area' => $this->area,
  231.                 'carte_version' => 'bigregions',
  232.                 'get_schedule_ville' => $this->area
  233.                 // 'plus_proche' => true,
  234.             ),
  235.             'dbg' => array('spectacles_auteurs_affiche','Texte par l\'auteur à l\'affiche'),
  236.         );
  237.         $list_spectacles $this->spectacles->getListSpectacles($params_sql_spectaclesnullfalse, ['carrer_couleurs' => true]);
  238.         $this->context['view']->textes_par_auteurs $textes->getTextsFromSpectacles($list_spectacles);
  239.         if(isset($this->context['view']->textes_par_auteurs)) {
  240.             foreach ($this->context['view']->textes_par_auteurs as $k => $v) {
  241.                 // voir s'il y a des contenus le texte par l'auteur
  242.                 if ($this->em->getRepository(Playlists::class)->countPlaylists('texts'$v['idtext'], 'class_texte_parauteur') > 0) {
  243.                     $playlist $this->em->getRepository(Playlists::class)->getByClassification('texts'$v['idtext'], 'class_texte_parauteur');
  244.                     $this->context['view']->textes_par_auteurs[$k]['url_clean_more'] = 'playlist/id/' $playlist['urlClean'];
  245.                     $playlists $this->em->getRepository(Playlists::class);
  246.                     $sql 'SELECT p.idplaylist
  247.                           FROM playlists p
  248.                           LEFT JOIN playlist_classification pc ON p.idplaylist = pc.idplaylist
  249.                           WHERE pc.idclassification = 144 AND p.idtext = '.$v['idtext'].'
  250.                           GROUP BY p.idtext';
  251.                     $x $playlists->queryOne($sql);
  252.                     $pl $playlists->getInfosPlaylist(
  253.                         $x,
  254.                         array(
  255.                             'all' => true,
  256.                             'multimedias' => true,
  257.                             'format_vignette' => array('width'=>$_ENV['VIGN_VIDEO_WIDTH'],'height'=>$_ENV['VIGN_VIDEO_HEIGHT'],'fleche'=>'none','ratio' => '169'//'direction'=>'crop'
  258.                         ),
  259.                         array('format_vignette' => true)
  260.                     );
  261.                     $video = (array_shift($pl['multimedias']));
  262.                     $this->context['view']->textes_par_auteurs[$k]['playlist']['vignette'] = $video['vignette'];
  263.                     $this->context['view']->textes_par_auteurs[$k]['playlist']['vignette_flou'] = $video['vignette_flou'];
  264.                     $this->context['view']->textes_par_auteurs[$k]['playlist']['thtv'] = true;
  265.                     $this->context['view']->textes_par_auteurs[$k]['playlist']['thtv_permalink'] = $video['permalink'];
  266.                     $this->context['view']->textes_par_auteurs[$k]['playlist']['url_clean_video'] = $playlist['urlClean'];
  267.                 }
  268.             }
  269.         }
  270.     }
  271.     public function getEvenements()
  272.     {
  273.         $news $this->em->getRepository(News::class);
  274.         // récupérer les prochains évènements
  275.         $news_params = array(
  276.             'params' => array(
  277.                 'limit' => array(0,5),
  278.             ),
  279.             'special' => array(
  280.                 'prochains' => 365,
  281.                 'publish_valid' => true,
  282.                 'type_news' => 'news',
  283.                 // 'is_homepage' => 1,
  284.                 'idbigregion' => array($this->area)
  285.             ),
  286.             'dbg' => array('news','Liste des prochains évènements')
  287.         );
  288.         $total_prochains_evements 0;
  289.         $this->context['view']->is_news_list_news true;
  290.         if($contents $news->getListNews($news_params)){
  291.             $this->context['view']->news_list_news['prochains'] = $contents;
  292.             $total_prochains_evements count($contents);
  293.         }
  294.         unset($news_params['special']['prochains']);
  295.         $news_params['params']['limit'] = array(0$total_prochains_evements);
  296.         $news_params['special']['anciens'] = true;
  297.         if($contents $news->getListNews($news_params)){
  298.             $this->context['view']->news_list_news['anciens'] = $contents;
  299.         }
  300.     }
  301.     public function getCritiques() {
  302.         $where_zone ' AND'.$this->regions->getZipCode($this->area);
  303.         /* -- les dernières critiques -- */
  304.         $params_sql_regions = array(
  305.             'params' => array(
  306.                 'where' => $where_zone,
  307.                 'limit' => array(04),
  308.                 'groupby' => 'sc.date'
  309.                 // 'order' => 'sc.date DESC'
  310.             ),
  311.             'special' => array(
  312.                 'prochains' => 365,
  313.                 'publish_valid' => 1,
  314.                 // 'random' => '',
  315.                 'idclassification' => 101,
  316.                 'get_schedule_ville' => $this->area
  317.             ),
  318.             'dbg' => array('affiche_region','A l\'affiche en région')
  319.         );
  320.         $this->context['view']->critiques_spectacles $this->spectacles->getListSpectacles($params_sql_regions,array(),false,['allauthors' => true'carrer_couleurs' => true]);
  321.         $nb_total_critiques 0;
  322.         $contents $this->em->getRepository(Contents::class);
  323.         foreach($this->context['view']->critiques_spectacles AS $k => $v){
  324.             $this->context['view']->critiques_spectacles[$k]['footer_critique'] = true;
  325.             $nb_total_critiques += $this->context['view']->critiques_spectacles[$k]['nombre_critique'] = $contents->countAssociateContent('spectacles',$v['idspectacle'],'class_critique',array('publish_valid' => 1));
  326.         }
  327.     }
  328.     public function getSpectaclesAffiches() {
  329.         $contacts $this->em->getRepository(Contacts::class);
  330.         $where_zone $this->regions->getZipCode($this->area);
  331.         //Spectacles à l'afafiche en régions :
  332.         $params_spectacles_affiche = array(
  333.             'params' => array(
  334.                 'where' => $where_zone,
  335.                 'limit' => array(0,6),
  336.             ),
  337.             'special' => array(
  338.                 'prochains' => 365,
  339.                 //ancienne condition remplacer par structures_specifiques && idtypestructure
  340.                 // 'random' => '',
  341.                 'publish_valid' => 1// les spectacles publiées
  342.                 'get_schedule_ville' => $this->area
  343.             ),
  344.             'dbg' => array('spectacles_affiche_region''Spectacles à l\'affiche pour la région ')
  345.         );
  346.         $params_display = array('allauthors' => true'carrer_couleurs' => true);
  347.         $format_vignette['vignette'] = array('width' => $_ENV['VIGN_SPECTACLE_HEIGHT'],'height' => $_ENV['VIGN_SPECTACLE_HEIGHT'], 'direction'=>'crop');
  348.         $spectacles_affiche $this->spectacles->getListSpectacles($params_spectacles_affiche,$format_vignette,false,$params_display);
  349.         foreach($spectacles_affiche as $k=>$v) {
  350.             //ajout footer_contact pour region spectacles
  351.             $spectacles_affiche[$k]['footer_contact'] = true;
  352.         }
  353.         $this->view->spectacles_affiche $spectacles_affiche;
  354.         //Spectacles à l'affiche dans les strucutres correspondants TN/CDN/Autres théare
  355.         $nb_spectacles 2;
  356.         $groupe_contacts = array(128,129,130,131);
  357.         if(in_array($this->area, ['CH','BE','LU'])){
  358.             $nb_spectacles 6;
  359.             $groupe_contacts = array(113); //autres théâtres partenaires
  360.         }
  361.         $partenaires $contacts->getContactsByClassification($groupe_contactsnullnullnull$this->area);// idgroupclassification = 10
  362.         // grouper par type de partenaires
  363.         if(in_array($this->area, ['CH','BE','LU'])){
  364.             foreach($partenaires as $k=>$v) {
  365.                 $spectacles_affiche_order['THIN']['contacts'][$v['idcontact']] = $v;
  366.                 $spectacles_affiche_order['THIN']['idcontacts'][$v['idcontact']] = $v['idcontact'];
  367.                 $spectacles_affiche_order['THIN']['idclassification'] = $v['idclassification'];
  368.                 $spectacles_affiche_order['THIN']['idtypestructure'] = 'THIN';
  369.             }
  370.         }
  371.         else{
  372.             foreach($partenaires as $k=>$v) {
  373.                 $spectacles_affiche_order[$v['idtypestructure']]['contacts'][$v['idcontact']] = $v;
  374.                 $spectacles_affiche_order[$v['idtypestructure']]['idcontacts'][$v['idcontact']] = $v['idcontact'];
  375.                 if($v['idtypestructure']=='THIN') {
  376.                     $spectacles_affiche_order[$v['idtypestructure']]['classification'] = 'Autres théâtres partenaires';
  377.                     $spectacles_affiche_order[$v['idtypestructure']]['no_link'] = true;
  378.                     $spectacles_affiche_order[$v['idtypestructure']]['classification_nomaj'] = strtolower($spectacles_affiche_order[$v['idtypestructure']]['classification']);
  379.                 } elseif($v['idtypestructure']=='CDN') {
  380.                     $spectacles_affiche_order[$v['idtypestructure']]['classification'] = 'Centres dramatiques';
  381.                     $spectacles_affiche_order[$v['idtypestructure']]['classification_nomaj'] = 'centres dramatiques';
  382.                 } else {
  383.                     $spectacles_affiche_order[$v['idtypestructure']]['classification_nomaj'] = strtolower($this->context['tr']->trans($v['classification']));
  384.                     $spectacles_affiche_order[$v['idtypestructure']]['classification'] = $this->context['tr']->trans($v['classification']);
  385.                 }
  386.                 $spectacles_affiche_order[$v['idtypestructure']]['idclassification'] = $v['idclassification'];
  387.                 $spectacles_affiche_order[$v['idtypestructure']]['idtypestructure'] = $v['idtypestructure'];
  388.             }
  389.         }
  390.         if(!empty($spectacles_affiche_order)){
  391.             foreach($spectacles_affiche_order as $k=>$v) {
  392.                 // pour les scènes nationales, rechercher dans toutes les scènes
  393.                 if($v['idclassification']==130) {
  394.                     $v['idcontacts'] = array();
  395.                     $contacts_sn $this->em->getRepository(Contacts::class)->getListContacts(array(
  396.                         'idtypestructure' => 'SN',
  397.                         'limit' => array(0,100),
  398.                         'dbg' => array('liste_sn''liste des scènes nationales'),
  399.                     ));
  400.                     foreach($contacts_sn as $kb=>$vb) {
  401.                         $v['idcontacts'][$vb['idcontact']] = $vb['idcontact'];
  402.                     }
  403.                 }
  404.                 // rechercher les spectacles à l'affiche
  405.                 $params_spectacles_affiche = array(
  406.                     'params' => array(
  407.                         'where' => $where_zone,
  408.                         'limit' => array(0,20),
  409.                     ),
  410.                     'special' => array(
  411.                         'prochains' => 365,
  412.                         //ancienne condition remplacer par structures_specifiques && idtypestructure
  413.                         'idcontacts' => array('IN'$v['idcontacts']),
  414.                         'idcontact' => $v['idcontacts'],
  415.                         // 'random' => '',
  416.                         'publish_valid' => 1// les critiques publiées
  417.                         'get_schedule_ville' => $this->area
  418.                     ),
  419.                     'dbg' => array('spectacles_'.$v['idtypestructure'], 'Spectacles à l\'affiche pour les '.$v['idtypestructure'])
  420.                 );
  421.                 $spectacles_affiche $this->spectacles->getListSpectacles($params_spectacles_affiche,$format_vignette,false,$params_display);
  422.                 if(!empty($spectacles_affiche)) {
  423.                     $spectacles_affiche_reduce = array();
  424.                     $i 0;
  425.                     foreach($spectacles_affiche as $kb=>$vb) {
  426.                         $vb['footer_contact'] = true;
  427.                         $spectacles_affiche_reduce[$kb] = $vb;
  428.                         $i++;
  429.                         if($i==$nb_spectacles) {
  430.                             break;
  431.                         }
  432.                     }
  433.                     $spectacles_affiche_order[$k]['spectacles'] = $spectacles_affiche_reduce;
  434.                 } else {
  435.                     unset($spectacles_affiche_order[$k]);
  436.                 }
  437.             }
  438.         }
  439.         $filtre_cdn = ['TN','CDN','SN','THIN'];
  440.         foreach($filtre_cdn as $vc){
  441.             if(!empty($spectacles_affiche_order[$vc])){
  442.                 if($spectacles_affiche_order[$vc]){
  443.                     $spectacles_affiche_by_classification[$vc] = $spectacles_affiche_order[$vc];
  444.                 }
  445.             }
  446.         }
  447.         if(isset($spectacles_affiche_by_classification)){
  448.             $this->context['view']->spectacles_affiche_dans true;
  449.             $this->context['view']->spectacles_affiche_by_contact $spectacles_affiche_by_classification;
  450.         }
  451.     }
  452.     private function getSpectaclesJTN(){
  453.         $where_zone ' AND'.$this->regions->getZipCode($this->area);
  454.         $params_sql_soutien = array(
  455.             'params' => array(
  456.                 'limit' => array(0,20),
  457.                 'where' => $where_zone
  458.             ),
  459.             'special' => array(
  460.                 'prochains' => 365,
  461.                 'random' => '',
  462.                 'by_classification' => 103,
  463.                 'get_schedule_ville' => $this->area
  464.             ),
  465.             'dbg' => array('spectacle_soutien','Les spectacles avec un soutien à l\'affiche'),
  466.         );
  467.         $params_display = array('allauthors' => true'carrer_couleurs' => true);
  468.         $spectacles_soutien $this->spectacles->getListSpectacles($params_sql_soutien, array(), false$params_display);
  469.         $nb_spectacles 2;
  470.         if(!empty($spectacles_soutien)) {
  471.             $i 0;
  472.             foreach($spectacles_soutien as $k=>$v) {
  473.                 $v['footer_contact'] = true;
  474.                 $this->context['view']->spectacles_affiche_dans true;
  475.                 $this->context['view']->spectacles_soutien[$k] = $v;
  476.                 $i++;
  477.                 if($i==$nb_spectacles) {
  478.                     break;
  479.                 }
  480.             }
  481.         }
  482.     }
  483.     private function getFondsInsertionProfessionnels()
  484.     {
  485.         $where_zone ' AND'.$this->regions->getZipCode($this->area);
  486.         // spectacles du JTN
  487.         $params_sql_soutien = array(
  488.             'params' => array(
  489.                 'where' => $where_zone,
  490.                 'limit' => array(04),
  491.             ),
  492.             'special' => array(
  493.                 'prochains' => 180,
  494.                 'random' => '',
  495.                 'aide' => [
  496.                     'idaidecontact' => 105
  497.                 ],
  498.                 'spectacle_aide' => true
  499.             ),
  500.             'dbg' => array('spectacle_soutien''Les spectacles avec un soutien à l\'affiche'),
  501.         );
  502.         $format_vignette['vignette'] = array('width' => 100'height' => 100'direction' => 'crop''valround' => 7);
  503.         $params_display = array('allauthors' => true);
  504.         $spectacles_soutien $this->spectacles->getListSpectacles($params_sql_soutien$format_vignettefalse$params_display);
  505.         if (!empty($spectacles_soutien)) {
  506.             $i 0;
  507.             foreach ($spectacles_soutien as $k => $v) {
  508.                 $v['footer_contact'] = true;
  509.                 $this->context['view']->spectacles_soutien[$k] = $v;
  510.             }
  511.         }
  512.     }
  513.     private function getSpectaclesEduc(){
  514.         // trouver les spectacles qui ont des contenus éduc => 125
  515.         $sql 'SELECT s.`idspectacle` FROM spectacles s
  516.             JOIN object_content oc  ON oc.`idobject`=s.`idspectacle`
  517.             JOIN contents c ON c.`idcontent`=oc.`idcontent`
  518.             JOIN content_classification cc ON cc.`idcontent`=c.`idcontent`
  519.         WHERE c.publish=1
  520.             AND oc.object=\'spectacles\'
  521.             AND cc.idclassification=125
  522.             AND s.`publish`=1 AND s.`valid`=1';
  523.         $idspectacles_from_spectacles $this->spectacles->queryCol($sql);
  524.         if(!empty($idspectacles_from_spectacles)) {
  525.             foreach($idspectacles_from_spectacles as $k=>$v) {
  526.                 $idspectacles[$v] = $v;
  527.             }
  528.             $params_spectacles = array(
  529.                 'special' => array(
  530.                     'idspectacle' => $idspectacles,
  531.                     'plus_proche' => true,
  532.                     'prochains' => 720,
  533.                     'area' => $this->area,
  534.                     'carte_version' => 'bigregions',
  535.                     'get_schedule_ville' => $this->area
  536.                 ),
  537.                 'params' => array(
  538.                     'limit' => 2,
  539.                 ),
  540.                 'dbg' => array('list_spectacles_educ''Liste des spectacles avec un contenu educ'),
  541.             );
  542.             $this->context['view']->spectacles_educ $this->spectacles->getListSpectacles($params_spectacles,array(),false,array('allauthors' => true'carrer_couleurs' => true));
  543.             foreach($this->context['view']->spectacles_educ as $k=>$v) {
  544.                 $this->context['view']->spectacles_educ[$k]['footer_contact'] = true;
  545.             }
  546.             $this->context['view']->spectacles_affiche_dans true;
  547.         }
  548.     }
  549.     private function getAsides(){
  550.         $this->asides->load(['common_carte' => array(
  551.             'url' => '/regions/actualites/area/get_id'
  552.         )]);
  553.         asides::setEntityManager($this->em);
  554.         asides::loadaside('Publicite')->addWithRegion($this->asides, ['region' => $this->area]); //$this->area
  555.         $this->asides->load(['common_carrer_informations'=> array(
  556.             'color' => 'spectacles'
  557.         )]);
  558.         $this->asides->load(['common_prochain_evenement' => array(
  559.             'url_custom' => '/evenements/view/area/'.$this->area
  560.         )]);
  561.         $this->asides->load('common_facebook');
  562.         $this->asides->load('common_twitter');
  563.         $this->asides->load(['common_participer' => array(
  564.             'php' => array(
  565.                 'method' => 'asidesUrlLists_Ajoutez'
  566.             )
  567.         )]);
  568.         $this->asides->load('contact_ecoles_list');
  569.         $this->asides->load('common_offre_annonce');
  570.     }
  571. }