if ($gPreferences['enable_dates_module'] == 0) { // Module is not active $gMessage->show($gL10n->get('SYS_MODULE_DISABLED')); } if ($getMode != 6 || $gPreferences['enable_dates_module'] == 2) { // Alle Funktionen, ausser Exportieren und anmelden, duerfen nur eingeloggte User require_once '../../system/login_valid.php'; } // erst prüfen, ob der User auch die entsprechenden Rechte hat if (!$gCurrentUser->editDates() && $getMode != 3 && $getMode != 4 && $getMode != 6) { $gMessage->show($gL10n->get('SYS_NO_RIGHTS')); } // Terminobjekt anlegen $date = new TableDate($gDb); if ($getDateId > 0) { $date->readDataById($getDateId); // Pruefung, ob der Termin zur aktuellen Organisation gehoert bzw. global ist if ($date->editRight() == false) { $gMessage->show($gL10n->get('SYS_NO_RIGHTS')); } } if ($getMode == 1 || $getMode == 5) { $_SESSION['dates_request'] = $_POST; error_log(print_r($_POST, true)); // ------------------------------------------------ // pruefen ob alle notwendigen Felder gefuellt sind // ------------------------------------------------ if (strlen($_POST['dat_headline']) == 0) { $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_TITLE'))); } if (strlen($_POST['date_from']) == 0) {
$datesTotalCount = $dates->getDataSetCount(); if ($getId == 0 || $getViewMode === 'compact' && $getId > 0) { // Navigation of the module starts here $gNavigation->addStartUrl(CURRENT_URL, $dates->getHeadline($getHeadline)); } // read all events for output if ($datesTotalCount != 0) { // Initialize counter and object instances $count = 0; $date = new TableDate($gDb); $participants = new Participants($gDb); // New array for the participants of a date $memberElements = array(); // Loop date array and add further information in right position of each date. foreach ($datesResult['recordset'] as $row) { $date->readDataById($row['dat_id']); // get avaiable room information if ($date->getValue('dat_room_id') > 0) { $room = new TableRooms($gDb, $date->getValue('dat_room_id')); $datesResult['recordset'][$count]['room_name'] = $room->getValue('room_name'); } // count members and leaders of the date role and push the result to the array if ($date->getValue('dat_rol_id') !== null) { $datesResult['recordset'][$count]['dat_num_members'] = $participants->getCount($date->getValue('dat_rol_id')); $datesResult['recordset'][$count]['dat_num_leaders'] = $participants->getNumLeaders($date->getValue('dat_rol_id')); } // For print view also read the participants and push the result to the array with index 'dat_rol_id' if ($getViewMode === 'print') { if ($date->getValue('dat_rol_id') > 0) { $memberElements[$date->getValue('dat_rol_id')] = $participants->getParticipantsArray($date->getValue('dat_rol_id')); }