Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7337 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7337 Rev 7340
Línea 59... Línea 59...
59
use LeadersLinked\Mapper\LanguageMapper;
59
use LeadersLinked\Mapper\LanguageMapper;
60
use LeadersLinked\Mapper\SkillMapper;
60
use LeadersLinked\Mapper\SkillMapper;
61
use LeadersLinked\Mapper\AptitudeMapper;
61
use LeadersLinked\Mapper\AptitudeMapper;
62
use LeadersLinked\Mapper\HobbyAndInterestMapper;
62
use LeadersLinked\Mapper\HobbyAndInterestMapper;
63
use LeadersLinked\Mapper\IndustryMapper;
63
use LeadersLinked\Mapper\IndustryMapper;
-
 
64
use LeadersLinked\Mapper\SurveyTestMapper;
-
 
65
use LeadersLinked\Model\SurveyTest;
-
 
66
use LeadersLinked\Mapper\SurveyCampaignMapper;
Línea 64... Línea 67...
64
 
67
 
65
class HelperController extends AbstractActionController
68
class HelperController extends AbstractActionController
66
{
69
{
67
    /**
70
    /**
Línea 1604... Línea 1607...
1604
            $calendarEventMapper = CalendarEventMapper::getInstance($this->adapter);
1607
            $calendarEventMapper = CalendarEventMapper::getInstance($this->adapter);
1605
            $records = $calendarEventMapper->fetchAllByUserIdAndStartTimeAndEndTime($currentUser->id, $start, $end);
1608
            $records = $calendarEventMapper->fetchAllByUserIdAndStartTimeAndEndTime($currentUser->id, $start, $end);
1606
            foreach ($records as $record) {
1609
            foreach ($records as $record) {
1607
                switch ($record->type) {
1610
                switch ($record->type) {
Línea -... Línea 1611...
-
 
1611
                    
-
 
1612
                    case CalendarEvent::TYPE_SURVEY_NORMAL:
-
 
1613
                        $backgroundColor = $currentNetwork->css_calendar_survey_bg_color;
Línea -... Línea 1614...
-
 
1614
                        $textColor = $currentNetwork->css_calendar_survey_text_color;
-
 
1615
                    
-
 
1616
                        $surveyTestMapper = SurveyTestMapper::getInstance($this->adapter);
-
 
1617
                        $surveyTest = $surveyTestMapper->fetchOne($record->relational_id);
-
 
1618
                        
-
 
1619
                        if($surveyTest && $surveyTest->user_id == $currentUser->id) {
-
 
1620
                            
-
 
1621
                            $surveyCampaingMapper = SurveyCampaignMapper::getInstance($this->adapter);
-
 
1622
                            $surveyCampaing = $surveyCampaingMapper->fetchOne($surveyTest->campaign_id);
-
 
1623
                            
-
 
1624
                            $url = '';
-
 
1625
                            $hasLink = !empty($companyUsers[$surveyTest->company_id]);
-
 
1626
                            
-
 
1627
                            if ($hasLink) {
-
 
1628
                                
-
 
1629
                                if (!isset($companies[$surveyTest->company_id])) {
-
 
1630
                                    $company  = $companyMapper->fetchOne($surveyTest->company_id);
-
 
1631
                                    
-
 
1632
                                    $companies[$company->id]  = $company;
-
 
1633
                                } else {
-
 
1634
                                    $company = $companies[$surveyTest->company_id];
-
 
1635
                                }
-
 
1636
                                
-
 
1637
                                
-
 
1638
                                $url = $this->url()->fromRoute('backend/signin-company', [
-
 
1639
                                    'id' => $company->uuid,
-
 
1640
                                    'relational' => $surveyTest->uuid,
-
 
1641
                                    'type' => CalendarEvent::TYPE_SURVEY_ORGANIZATIONAL_CLIMATE,
-
 
1642
                                ]);
-
 
1643
                            }
-
 
1644
                            
-
 
1645
                            $dtStart = \DateTime::createFromFormat('Y-m-d', $surveyCampaing->end_date);
-
 
1646
                            
-
 
1647
                            
-
 
1648
                            array_push($events, [
-
 
1649
                                'id'                => $surveyTest->uuid,
-
 
1650
                                'title'             => $surveyCampaing->name,
-
 
1651
                                'start'             => $dtStart->format('d/m/Y'),
-
 
1652
                                'url'               => $url,
-
 
1653
                                'backgroundColor'   => $backgroundColor,
-
 
1654
                                'textColor'         => $textColor,
-
 
1655
                                'allDay'            => true,
-
 
1656
                                'type'              => 'task',
-
 
1657
                            ]);
-
 
1658
                        }
-
 
1659
                        
1608
                    
1660
                        break;
1609
                    
1661
                    
1610
                    case CalendarEvent::TYPE_RECRUITMENT_SELECTION_INTERVIEW:
1662
                    case CalendarEvent::TYPE_SURVEY_ORGANIZATIONAL_CLIMATE:
-
 
1663
                        $backgroundColor = $currentNetwork->css_calendar_organizational_climate_bg_color;
-
 
1664
                        $textColor = $currentNetwork->css_calendar_organizational_climate_text_color;
-
 
1665
                        
-
 
1666
                        $surveyTestMapper = SurveyTestMapper::getInstance($this->adapter);
-
 
1667
                        $surveyTest = $surveyTestMapper->fetchOne($record->relational_id);
-
 
1668
                        
-
 
1669
                        if($surveyTest && $surveyTest->user_id == $currentUser->id) {
-
 
1670
                            
-
 
1671
                            $surveyCampaingMapper = SurveyCampaignMapper::getInstance($this->adapter);
-
 
1672
                            $surveyCampaing = $surveyCampaingMapper->fetchOne($surveyTest->campaign_id);
-
 
1673
                            
-
 
1674
                            $url = '';
-
 
1675
                            $hasLink = !empty($companyUsers[$surveyTest->company_id]);
-
 
1676
                            
-
 
1677
                            if ($hasLink) {
-
 
1678
                                
-
 
1679
                                if (!isset($companies[$surveyTest->company_id])) {
-
 
1680
                                    $company  = $companyMapper->fetchOne($surveyTest->company_id);
-
 
1681
                                    
-
 
1682
                                    $companies[$company->id]  = $company;
-
 
1683
                                } else {
-
 
1684
                                    $company = $companies[$surveyTest->company_id];
-
 
1685
                                }
-
 
1686
                                
-
 
1687
                                
-
 
1688
                                $url = $this->url()->fromRoute('backend/signin-company', [
-
 
1689
                                    'id' => $company->uuid,
-
 
1690
                                    'relational' => $surveyTest->uuid,
-
 
1691
                                    'type' => CalendarEvent::TYPE_SURVEY_ORGANIZATIONAL_CLIMATE,
-
 
1692
                                ]);
-
 
1693
                            }
-
 
1694
                            
-
 
1695
                            $dtStart = \DateTime::createFromFormat('Y-m-d', $surveyCampaing->end_date);
-
 
1696
                            
-
 
1697
                            
-
 
1698
                            array_push($events, [
-
 
1699
                                'id'                => $surveyTest->uuid,
-
 
1700
                                'title'             => $surveyCampaing->name,
-
 
1701
                                'start'             => $dtStart->format('d/m/Y'),
-
 
1702
                                'url'               => $url,
-
 
1703
                                'backgroundColor'   => $backgroundColor,
-
 
1704
                                'textColor'         => $textColor,
-
 
1705
                                'allDay'            => true,
-
 
1706
                                'type'              => 'task',
-
 
1707
                            ]);
-
 
1708
                        }
-
 
1709
                        
-
 
1710
                        break;
-
 
1711
                       
-
 
1712
                        
-
 
1713
                        
-
 
1714
                        
-
 
1715
                        
-
 
1716
                        
Línea 1611... Línea 1717...
1611
                        $backgroundColor = $currentNetwork->css_calendar_recruitment_and_selection_bg_color;
1717
                        
1612
                        $textColor = $currentNetwork->css_calendar_recruitment_and_selection_text_color;
1718
                        
1613
                        
1719