Ejemplo n.º 1
0
 public function execute($context)
 {
     $this->component->arResult['member'] = $context['member'];
     $this->component->arResult['project'] = $context['project'];
     if (!$context['project']['allow_subordinates_controlling'] || !$this->registry->getDbHelper('MembersHelper')->isHaveSubordinates($context['member']['email'], $context['project']['projectID'])) {
         LocalRedirect('/enter/' . $context['member']['private_lk_access_key'] . '/');
     }
     $availableLanguages = $this->registry->getDbHelper('TranslationHelper')->getLanguagesByIDs(json_decode($context['project']['~languages']));
     $this->component->arResult['languages'] = $availableLanguages;
     // обработка языка
     if (isset($_POST['language']) && array_key_exists(intval($_POST['language']), $availableLanguages)) {
         $langID = intval($_POST['language']);
         $this->registry->getDbHelper('MembersHelper')->editMember($context['member']['projects_memberID'], array('langID' => $langID));
     } else {
         $langID = $context['member']['langID'];
     }
     $this->component->arResult['langID'] = $langID;
     // Шапка ЛК
     $translator = new \Ecoplay\Model\Translation($this->registry->getDbConnect(), $availableLanguages[$langID]['abbr'], $_SERVER["DOCUMENT_ROOT"] . '/lang/');
     $this->component->arResult['translator'] = $translator;
     $projectViewSettings = $context['project']['param_lk'] ? (array) json_decode($context['project']['~param_lk']) : array();
     $this->component->arResult['projectViewSettings'] = $projectViewSettings;
     $assess = $this->registry->getDbHelper('MembersHelper')->findFirstAssessByMemberID($context['project']['projectID'], $context['member']['projects_memberID']);
     $addonCss = false;
     if ($assess) {
         $addonCss = $this->registry->getDbHelper('ProjectsHelper')->findCSSBySessionsIDs(array($assess['sessionID']));
     }
     if (!$addonCss && $context['project']['myCSS_path']) {
         $addonCss = $context['project']['myCSS_path'];
     }
     $context['APPLICATION']->IncludeComponent("ecoplay:front.header", '', array('TRANSLATOR' => $translator, 'MODE' => 'subordinates', 'MEMEBER_KEY' => $context['member']['private_lk_access_key'], 'NAME' => $translator->translateObject($context['member']['name'], 'member_name', $context['member']['projects_memberID'], $langID) . ' ' . $translator->translateObject($context['member']['surname'], 'member_surname', $context['member']['projects_memberID'], $langID), 'SETTINGS' => $projectViewSettings, 'ADDON_CSS' => $addonCss));
     // выбор языка
     $this->component->includeComponentTemplate('languages');
     $this->component->arResult['TEXT'] = $translator->translateObject($context['project']['~lk_subordinates_text'], 'project_lk_subordinates_text', $context['project']['projectID'], $langID);
     // ищем участников по структуре
     $subordinatesMembers = $this->registry->getDbHelper('MembersHelper')->getSubordinatesMembers($context['member']['email'], $context['project']['projectID']);
     $subordinatesAssess = $this->registry->getDbHelper('MembersHelper')->getAssessByMembersIDs($context['project']['projectID'], array_keys($subordinatesMembers));
     $this->component->arResult['assess'] = $subordinatesAssess;
     $this->component->arResult['members'] = $subordinatesMembers;
     $this->component->IncludeComponentTemplate();
     $context['APPLICATION']->IncludeComponent("ecoplay:front.footer", '', array('TRANSLATOR' => $translator, 'SETTINGS' => $projectViewSettings));
 }
Ejemplo n.º 2
0
 public function execute($context)
 {
     $this->component->arResult['member'] = $context['member'];
     $this->component->arResult['project'] = $context['project'];
     $availableLanguages = $this->registry->getDbHelper('TranslationHelper')->getLanguagesByIDs(json_decode($context['project']['~languages']));
     $this->component->arResult['languages'] = $availableLanguages;
     // обработка языка
     if (isset($_POST['language']) && array_key_exists(intval($_POST['language']), $availableLanguages)) {
         $langID = intval($_POST['language']);
         $this->registry->getDbHelper('MembersHelper')->editMember($context['member']['projects_memberID'], array('langID' => $langID));
     } else {
         $langID = $context['member']['langID'];
     }
     $this->component->arResult['langID'] = $langID;
     // получаем анкеты
     $seances = $this->registry->getDbHelper('LinearProjectsHelper')->getMemberSeances($context['member']['projects_memberID'], $context['member']['projectID']);
     $this->component->arResult['seances'] = $seances;
     // определяем доп. CSS для первой настроенной сессии
     $addonCss = false;
     if ($seances && count($seances)) {
         $sessionsIDs = array();
         foreach ($seances as $seance) {
             if (!in_array($seance['sessionID'], $sessionsIDs)) {
                 $sessionsIDs[] = $seance['sessionID'];
             }
         }
         $addonCss = $this->registry->getDbHelper('ProjectsHelper')->findCSSBySessionsIDs($sessionsIDs);
     }
     if (!$addonCss && $context['project']['myCSS_path']) {
         $addonCss = $context['project']['myCSS_path'];
     }
     // Шапка ЛК
     $translator = new \Ecoplay\Model\Translation($this->registry->getDbConnect(), $availableLanguages[$langID]['abbr'], $_SERVER["DOCUMENT_ROOT"] . '/lang/', $this->registry);
     $this->component->arResult['translator'] = $translator;
     $projectViewSettings = $context['project']['param_lk'] ? (array) json_decode($context['project']['~param_lk']) : array();
     $this->component->arResult['projectViewSettings'] = $projectViewSettings;
     $memberName = $translator->translateObject($context['member']['name'], 'member_name', $context['member']['projects_memberID'], $langID) . ' ' . $translator->translateObject($context['member']['surname'], 'member_surname', $context['member']['projects_memberID'], $langID);
     /*if ($context['member']['stat2_group_keyID']) {
         $groupKey = $this->registry->getDbHelper('TestsHelper')->findGroupKeyByID($context['member']['stat2_group_keyID']);
         if (!$groupKey['is_registration_available']) {
           $memberName = 'Опрос';
         }
       }*/
     $this->component->arResult["memberName"] = $memberName;
     $context['APPLICATION']->IncludeComponent("ecoplay:front.header", '', array('TRANSLATOR' => $translator, 'MODE' => 'lk', 'NAME' => $memberName, 'SETTINGS' => array_merge($projectViewSettings, array('name' => $memberName)), 'ADDON_CSS' => $addonCss));
     $lkNotAvailable = false;
     if ($context['member']['stat2_group_keyID']) {
         $groupKey = $this->registry->getDbHelper('TestsHelper')->findGroupKeyByID($context['member']['stat2_group_keyID']);
         if (!$groupKey['is_registration_available']) {
             $lkNotAvailable = true;
             $this->component->arResult["groupKey"] = $groupKey;
         }
     }
     if ($lkNotAvailable) {
         $this->component->IncludeComponentTemplate('linear/group_key', '/bitrix/components/ecoplay/member.lk/templates/.default');
     } else {
         // выбор языка
         $this->component->includeComponentTemplate('languages', '/bitrix/components/ecoplay/member.lk/templates/.default');
         $this->component->arResult['TEXT'] = $translator->translateObject($context['project']['~lk_text'], 'project_lk_text', $context['project']['projectID'], $langID);
         if ($this->component->arResult['TEXT']) {
             $this->component->includeComponentTemplate('text', '/bitrix/components/ecoplay/member.lk/templates/.default');
         }
         // логируем посещение
         $this->registry->getModel('Stat')->addHit(0, $context['member']['projects_memberID']);
         $this->component->IncludeComponentTemplate('template_linear', '/bitrix/components/ecoplay/member.lk/templates/.default');
     }
     $context['APPLICATION']->IncludeComponent("ecoplay:front.footer", '', array('TRANSLATOR' => $translator, 'SETTINGS' => $projectViewSettings));
 }
Ejemplo n.º 3
0
 public function execute($context)
 {
     if (!$context['project']['allow_subordinates_controlling'] || !$this->registry->getDbHelper('MembersHelper')->isHaveSubordinates($context['member']['email'], $context['project']['projectID'])) {
         LocalRedirect('/enter/' . $context['member']['private_lk_access_key'] . '/');
     }
     $assess = $this->registry->getDbHelper('MembersHelper')->findAssessById($_GET['ASSESS_ID']);
     if (!$assess || !$assess['active'] || $assess['projectID'] != $context['project']['projectID']) {
         LocalRedirect('/enter/' . $context['member']['private_lk_access_key'] . '/');
     }
     $availableLanguages = $this->registry->getDbHelper('TranslationHelper')->getLanguagesByIDs(json_decode($context['project']['~languages']));
     $this->component->arResult['languages'] = $availableLanguages;
     // обработка языка
     if (isset($_POST['language']) && array_key_exists(intval($_POST['language']), $availableLanguages)) {
         $langID = intval($_POST['language']);
         $this->registry->getDbHelper('MembersHelper')->editMember($context['member']['projects_memberID'], array('langID' => $langID));
     } else {
         $langID = $context['member']['langID'];
     }
     $this->component->arResult['langID'] = $langID;
     // Шапка ЛК
     $translator = new \Ecoplay\Model\Translation($this->registry->getDbConnect(), $availableLanguages[$langID]['abbr'], $_SERVER["DOCUMENT_ROOT"] . '/lang/');
     $this->component->arResult['translator'] = $translator;
     $projectViewSettings = $context['project']['param_lk'] ? (array) json_decode($context['project']['~param_lk']) : array();
     $this->component->arResult['projectViewSettings'] = $projectViewSettings;
     $memberAssess = $this->registry->getDbHelper('MembersHelper')->findFirstAssessByMemberID($context['project']['projectID'], $context['member']['projects_memberID']);
     $addonCss = false;
     if ($memberAssess) {
         $addonCss = $this->registry->getDbHelper('ProjectsHelper')->findCSSBySessionsIDs(array($memberAssess['sessionID']));
     }
     if (!$addonCss && $context['project']['myCSS_path']) {
         $addonCss = $context['project']['myCSS_path'];
     }
     $context['APPLICATION']->IncludeComponent("ecoplay:front.header", '', array('TRANSLATOR' => $translator, 'MODE' => 'subordinate', 'MEMEBER_KEY' => $context['member']['private_lk_access_key'], 'NAME' => $translator->translateObject($context['member']['name'], 'member_name', $context['member']['projects_memberID'], $langID) . ' ' . $translator->translateObject($context['member']['surname'], 'member_surname', $context['member']['projects_memberID'], $langID), 'SETTINGS' => $projectViewSettings, 'ADDON_CSS' => $addonCss));
     // ищем участников по структуре
     $subordinatesMembers = $this->registry->getDbHelper('MembersHelper')->getSubordinatesMembers($context['member']['email'], $context['project']['projectID']);
     if (!array_key_exists($assess['project_memberID'], $subordinatesMembers)) {
         LocalRedirect('/enter/' . $context['member']['private_lk_access_key'] . '/');
     }
     $this->component->arResult['assess'] = $assess;
     $this->component->arResult['assessMember'] = $subordinatesMembers[$assess['project_memberID']];
     // выбор языка
     $this->component->includeComponentTemplate('languages');
     $this->component->arResult['TEXT'] = $translator->translateObject($context['project']['~lk_subordinate_text'], 'project_lk_subordinate_text', $context['project']['projectID'], $langID);
     // определяем роли, по которым можем управлять
     $rolesIDs = array();
     $rolesSrc = $this->registry->getDbHelper('ProjectsHelper')->getProjectRoles($context['project']['projectID']);
     $roles = array();
     $deniedRoles = array('self', 'direct_head', 'functional_head');
     foreach ($rolesSrc as $role) {
         if (!in_array($role['fixed_role'], $deniedRoles)) {
             $rolesIDs[] = $role['roleID'];
         }
         $roles[$role['roleID']] = $role['name'];
     }
     $this->component->arResult['roles'] = $roles;
     $this->component->arResult['controlledRoles'] = $rolesIDs;
     // проверяем, можно ли управлять респондентами
     $canControllRespondents = $assess['status'] == \Ecoplay\Helper\Db\MembersHelper::ASSESS_STATUS_RESPONDENTS_SELECTED ? true : false;
     $this->component->arResult['canControllRespondents'] = $canControllRespondents;
     if ($canControllRespondents) {
         // удаляем
         if (isset($_POST['del_id'])) {
             $respondent = $this->registry->getDbHelper('MembersHelper')->findRespondentById($_POST['del_id']);
             if ($respondent && $respondent['active'] && $respondent['stat1_assessID'] == $assess['assessID'] && in_array($respondent['stat1_roleID'], $rolesIDs)) {
                 $this->registry->getDbHelper('MembersHelper')->deleteRespondent($_POST['del_id']);
             }
         }
         // добавляем
         if (isset($_POST['respondent_id'])) {
             $projectLangID = $this->registry->getModel('Projects')->getDefaultLangID($context['project']);
             $respondentStaff = $this->registry->getDbHelper('MembersHelper')->findStaffByID($_POST['respondent_id']);
             if ($respondentStaff && $respondentStaff['active'] && $respondentStaff['projectID'] == $context['project']['projectID'] && isset($_POST['role']) && in_array($_POST['role'], $rolesIDs)) {
                 // ищем соответствующего участника
                 $respondentMember = $this->registry->getDbHelper('MembersHelper')->findByEmailAndProjectId($respondentStaff['email'], $context['project']['projectID']);
                 if (!$respondentMember) {
                     $respondentMember = array('active' => 1, 'projectID' => $context['project']['projectID'], 'email' => $respondentStaff['email']);
                     $name = $respondentStaff['name'] . ($respondentStaff['name2'] ? ' ' . $respondentStaff['name2'] : '');
                     $respondentMember['projects_memberID'] = $this->registry->getDbHelper('MembersHelper')->addMember($name, $respondentStaff['surname'], $respondentStaff['position'], $respondentStaff['email'], $context['project']['projectID'], $this->registry->getModel('Auth')->generateUid('prep_projects_members', 'private_lk_access_key'), $respondentStaff['langID'] ? $respondentStaff['langID'] : $projectLangID, 1, 'new', $respondentStaff['department_text']);
                     $eventListener = new EventListener($this->registry, $context['project'], $_SERVER["DOCUMENT_ROOT"] . '/');
                     $eventListener->executeEvent('MemberAdded', array('memberID' => $respondentMember['projects_memberID']), true);
                 }
                 if ($respondentMember && $respondentMember['active'] && $respondentMember['projectID'] == $context['project']['projectID']) {
                     $existRespondent = $this->registry->getDbHelper('MembersHelper')->findRespondentByAssessIDAndMemberID($context['project']['projectID'], $assess['sessionID'], $assess['assessID'], $respondentMember['projects_memberID']);
                     if (!$existRespondent) {
                         $roleID = $_POST['role'];
                         $respondentID = $this->registry->getDbHelper('MembersHelper')->addRespondent(array('projectID' => $context['project']['projectID'], 'sessionID' => $assess['sessionID'], 'project_memberID' => $respondentMember['projects_memberID'], 'active' => 1, 'status' => 'new', 'stat1_assessID' => $assess['assessID'], 'private_access_key' => $this->registry->getModel('Auth')->generateUid('prep_respondents', 'private_access_key'), 'stat1_roleID' => $roleID, 'deny_deletion' => 0));
                     }
                 }
             }
         }
         // подтверждение
         if (isset($_POST['view'])) {
             $this->registry->getDbHelper('MembersHelper')->editAssess($assess['assessID'], array('viewed_by_direct_head' => 1));
             LocalRedirect('/enter/' . $context['member']['private_lk_access_key'] . '/subordinates/');
         }
     }
     $grouppedRespondents = array();
     $subordinateRespondents = $this->registry->getDbHelper('MembersHelper')->getSubordinatesRespondents($context['project']['projectID'], array($assess['assessID']));
     foreach ($subordinateRespondents as $respondent) {
         if (!array_key_exists($respondent['stat1_roleID'], $grouppedRespondents)) {
             $grouppedRespondents[$respondent['stat1_roleID']] = array();
         }
         $grouppedRespondents[$respondent['stat1_roleID']][] = $respondent;
     }
     $this->component->arResult['respondents'] = $grouppedRespondents;
     $this->component->IncludeComponentTemplate();
     $context['APPLICATION']->IncludeComponent("ecoplay:front.footer", '', array('TRANSLATOR' => $translator, 'SETTINGS' => $projectViewSettings));
 }
Ejemplo n.º 4
0
 public function execute($context)
 {
     $this->component->arResult['member'] = $context['member'];
     $this->component->arResult['project'] = $context['project'];
     $availableLanguages = $this->registry->getDbHelper('TranslationHelper')->getLanguagesByIDs(json_decode($context['project']['~languages']));
     $this->component->arResult['languages'] = $availableLanguages;
     // обработка языка
     if (isset($_POST['language']) && array_key_exists(intval($_POST['language']), $availableLanguages)) {
         $langID = intval($_POST['language']);
         $this->registry->getDbHelper('MembersHelper')->editMember($context['member']['projects_memberID'], array('langID' => $langID));
     } else {
         $langID = $context['member']['langID'];
     }
     $this->component->arResult['langID'] = $langID;
     $roles = $this->registry->getDbHelper('ProjectsHelper')->getProjectRoles($context['project']['projectID']);
     // ищем роли проекта, чтобы самооценку выводить на первом месте
     $selfRoleID = 0;
     foreach ($roles as $role) {
         if ($role['fixed_role'] == 'self') {
             $selfRoleID = $role['roleID'];
             break;
         }
     }
     // получаем анкеты
     $seances = $this->registry->getDbHelper('BlanksHelper')->getMemberSeances($context['member']['projects_memberID'], $context['member']['projectID'], $selfRoleID);
     $projectViewSettings = $context['project']['param_lk'] ? (array) json_decode($context['project']['~param_lk']) : array();
     if (array_key_exists('group_roles', $projectViewSettings) && $projectViewSettings['group_roles']) {
         $groupedRoles = $this->registry->getModel('Members')->getGroupedRoles();
         $groupedSeances = array();
         foreach ($seances as $seance) {
             $groupedRoleIndex = $this->registry->getModel('Members')->getGroupedRoleIndex($seance['fixed_role']);
             if (!array_key_exists($groupedRoleIndex, $groupedSeances)) {
                 $groupedSeances[$groupedRoleIndex] = $groupedRoles[$groupedRoleIndex];
                 $groupedSeances[$groupedRoleIndex]['seances'] = array();
             }
             $groupedSeances[$groupedRoleIndex]['seances'][] = $seance;
         }
         ksort($groupedSeances);
         $this->component->arResult['grouped_seances'] = $groupedSeances;
     } else {
         $this->component->arResult['grouped_seances'] = false;
     }
     $this->component->arResult['seances'] = $seances;
     // определяем доп. CSS для первой настроенной сессии
     $addonCss = false;
     if ($seances && count($seances)) {
         $sessionsIDs = array();
         foreach ($seances as $seance) {
             if (!in_array($seance['sessionID'], $sessionsIDs)) {
                 $sessionsIDs[] = $seance['sessionID'];
             }
         }
         $addonCss = $this->registry->getDbHelper('ProjectsHelper')->findCSSBySessionsIDs($sessionsIDs);
     }
     if (!$addonCss && $context['project']['myCSS_path']) {
         $addonCss = $context['project']['myCSS_path'];
     }
     // Шапка ЛК
     $translator = new \Ecoplay\Model\Translation($this->registry->getDbConnect(), $availableLanguages[$langID]['abbr'], $_SERVER["DOCUMENT_ROOT"] . '/lang/', $this->registry);
     $this->component->arResult['translator'] = $translator;
     $this->component->arResult['projectViewSettings'] = $projectViewSettings;
     $memberName = $translator->translateObject($context['member']['name'], 'member_name', $context['member']['projects_memberID'], $langID) . ' ' . $translator->translateObject($context['member']['surname'], 'member_surname', $context['member']['projects_memberID'], $langID);
     $this->component->arResult["memberName"] = $memberName;
     $context['APPLICATION']->IncludeComponent("ecoplay:front.header", '', array('TRANSLATOR' => $translator, 'MODE' => 'lk', 'NAME' => $memberName, 'SETTINGS' => array_merge($projectViewSettings, array('name' => $memberName)), 'ADDON_CSS' => $addonCss));
     // выбор языка
     $this->component->includeComponentTemplate('languages');
     $this->component->arResult['TEXT'] = $translator->translateObject($context['project']['~lk_text'], 'project_lk_text', $context['project']['projectID'], $langID);
     if ($this->component->arResult['TEXT']) {
         $this->component->includeComponentTemplate('text');
     }
     // удаляем если нужно респондента
     if ($context['project']['allow_assess_deletion'] && isset($_POST['del_respondent'])) {
         $respondent = $this->registry->getDbHelper('MembersHelper')->findRespondentById($_POST['del_respondent']);
         if ($respondent && $respondent['project_memberID'] == $context['member']['projects_memberID'] && $respondent['active'] && $respondent['stat1_roleID'] != $selfRoleID && !$respondent['deny_deletion']) {
             $respondentSeance = $this->registry->getDbHelper('SeancesHelper')->findByRespondentId($respondent['respondentID']);
             if (!$respondentSeance || $respondentSeance['state'] == \Ecoplay\Helper\Db\BlanksHelper::SEANCE_STATE_NEW) {
                 $this->registry->getDbHelper('MembersHelper')->deleteRespondent($respondent['respondentID']);
                 LocalRedirect('/enter/' . $context['member']['private_lk_access_key']);
             }
         }
     }
     // проверяем, возможно можно управлять подчиненными
     $subordinatesLink = false;
     if ($context['project']['allow_subordinates_controlling']) {
         if ($this->registry->getDbHelper('MembersHelper')->isHaveSubordinates($context['member']['email'], $context['project']['projectID'])) {
             $subordinatesLink = true;
         }
     }
     // проверяем, возможно нужно выбирать оцениваемых
     $assess = $this->registry->getDbHelper('MembersHelper')->findFirstAssessByMemberID($context['member']['projectID'], $context['member']['projects_memberID']);
     if ($assess && ($assess['status'] == MembersHelper::ASSESS_STATUS_SELECT_RESPONDENTS || $context['project']['allow_select_respondents_at_assess'] && $assess['status'] == MembersHelper::ASSESS_STATUS_ASSESS || $assess['status'] == MembersHelper::ASSESS_STATUS_SELECT_ASSESS || $context['project']['allow_select_assess_at_assess'] && $assess['status'] == MembersHelper::ASSESS_STATUS_ASSESS)) {
         $context['APPLICATION']->IncludeComponent("ecoplay:lk.members.selector", "", array('ROLES' => $roles, 'TRANSLATOR' => $translator, 'PROJECT' => $context['project'], 'ASSESS' => $assess, 'MEMBER' => $context['member'], 'SUBORDINATES_LINK' => $subordinatesLink));
     } else {
         $this->component->arResult['subordinatesLink'] = $subordinatesLink;
     }
     $this->component->arResult['report'] = $assess && $assess['last_reportID'] ? $assess['last_reportID'] : 0;
     // валидируем существующие группы
     $groupsIDs = array();
     foreach ($seances as $seance) {
         if ($seance['group_keyID'] && !in_array($seance['group_keyID'], $groupsIDs) && $seance['state'] != \Ecoplay\Helper\Db\BlanksHelper::SEANCE_STATE_COMPLETE) {
             $groupsIDs[] = $seance['group_keyID'];
         }
     }
     if (count($groupsIDs)) {
         $groupsValid = $this->registry->getModel('Seances')->validateGroupSeances($groupsIDs);
         if (!$groupsValid) {
             $seances = $this->registry->getDbHelper('BlanksHelper')->getMemberSeances($context['member']['projects_memberID'], $selfRoleID);
         }
     }
     // проверяем возможность группового заполнения
     $groups = array();
     $existGroups = array();
     if ($context['project']['group_filling_available']) {
         // первоначальная группировка - по бланкам, без учета количества
         $groupsSrc = array();
         foreach ($seances as $seance) {
             if ($seance['assess_status'] == \Ecoplay\Helper\Db\MembersHelper::ASSESS_STATUS_ASSESS) {
                 if (($seance['state'] == \Ecoplay\Helper\Db\BlanksHelper::SEANCE_STATE_NOT_EXIST || $seance['state'] == \Ecoplay\Helper\Db\BlanksHelper::SEANCE_STATE_NEW) && !$seance['group_keyID']) {
                     if (!array_key_exists($seance['blankID'], $groupsSrc)) {
                         $groupsSrc[$seance['blankID']] = array();
                     }
                     $groupsSrc[$seance['blankID']][] = $seance;
                 } elseif ($seance['group_keyID']) {
                     if (!array_key_exists($seance['group_keyID'], $existGroups)) {
                         $existGroups[$seance['group_keyID']] = array('key' => '', 'state' => \Ecoplay\Helper\Db\BlanksHelper::SEANCE_STATE_NEW, 'seances' => array());
                     }
                     $existGroups[$seance['group_keyID']]['seances'][] = $seance;
                 }
             }
         }
         // разбиваем на реальные группы
         foreach ($groupsSrc as $blankSeances) {
             if (count($blankSeances) > 1) {
                 $amount = 0;
                 $group = array();
                 foreach ($blankSeances as $seance) {
                     $group[] = $seance;
                     $amount++;
                     if ($amount == GROUP_FILLING_MAX_RESPONDENTS_COUNT) {
                         $groups[] = $group;
                         $amount = 0;
                         $group = array();
                     }
                 }
                 if ($amount > 1) {
                     $groups[] = $group;
                 }
             }
         }
     }
     $this->component->arResult['groups'] = $groups;
     if (count($existGroups)) {
         $groupSeances = $this->registry->getDbHelper('SeancesHelper')->getGroupSeancesByIDs(array_keys($existGroups));
         foreach ($groupSeances as $groupSeance) {
             $existGroups[$groupSeance['ID']]['key'] = $groupSeance['group_key'];
             $existGroups[$groupSeance['ID']]['state'] = $groupSeance['state'];
         }
     }
     $this->component->arResult['existGroups'] = $existGroups;
     // логируем посещение
     $this->registry->getModel('Stat')->addHit(0, $context['member']['projects_memberID']);
     $this->component->IncludeComponentTemplate();
     $context['APPLICATION']->IncludeComponent("ecoplay:front.footer", '', array('TRANSLATOR' => $translator, 'SETTINGS' => $projectViewSettings));
 }