$getNumberRoleSelect = admFuncVariableIsValid($_GET, 'number_role_select', 'numeric'); // check if module is active 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')));
// set mode, viewmode, startdate and enddate manually $parameter['mode'] = 2; $parameter['view_mode'] = 'period'; $parameter['date_from'] = date('Y-m-d', time() - $gPreferences['dates_ical_days_past'] * 86400); $parameter['date_to'] = date('Y-m-d', time() + $gPreferences['dates_ical_days_future'] * 86400); // read events for output $datesResult = $dates->getDataset(); //Headline für Dateinamen if ($dates->getCatId() > 0) { $calendar = new TableCategory($gDb, $dates->getCatId()); $getHeadline .= '_' . $calendar->getValue('cat_name'); } $date = new TableDate($gDb); $iCal = $date->getIcalHeader(); if ($datesResult['numResults'] > 0) { $date = new TableDate($gDb); foreach ($datesResult['recordset'] as $row) { $date->clear(); $date->setArray($row); $iCal .= $date->getIcalVEvent($_SERVER['HTTP_HOST']); } } $iCal .= $date->getIcalFooter(); if ($parameter['mode'] == 2) { // for IE the filename must have special chars in hexadecimal if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) { $getHeadline = urlencode($getHeadline); } header('Content-Type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename="' . $getHeadline . '.ics"'); // necessary for IE, because without it the download with SSL has problems
case 'description': $columnHeading = array(' ', $gL10n->get('SYS_PERIOD'), $gL10n->get('DAT_DATE'), $gL10n->get('SYS_DESCRIPTION')); $columnAlign = array('center', 'left', 'left', 'left'); $compactTable->disableDatatablesColumnsSort(5); $compactTable->setColumnWidth(4, '35%'); break; } if ($getViewMode === 'html') { $columnHeading[] = ' '; $columnAlign[] = 'right'; } $compactTable->setColumnAlignByArray($columnAlign); $compactTable->addRowHeadingByArray($columnHeading); } // create dummy date object $date = new TableDate($gDb); foreach ($datesResult['recordset'] as $row) { // write of current event data to date object $date->setArray($row); // initialize all output elements $outputEndDate = ''; $outputButtonIcal = ''; $outputButtonEdit = ''; $outputButtonDelete = ''; $outputButtonCopy = ''; $outputButtonParticipation = ''; $outputButtonParticipants = ''; $outputButtonParticipantsEmail = ''; $outputButtonParticipantsAssign = ''; $outputLinkLocation = ''; $outputLinkRoom = '';
$dateCurrentUserAssigned = 0; // set headline of the script if ($getCopy) { $headline = $gL10n->get('SYS_COPY_VAR', $getHeadline); $mode = 5; } elseif ($getDateId > 0) { $headline = $gL10n->get('SYS_EDIT_VAR', $getHeadline); $mode = 5; } else { // @ptabaden: added Value, without translation! $headline = $gL10n->get('SYS_NEW_VAR', $getHeadline); $mode = 1; } $gNavigation->addUrl(CURRENT_URL, $headline); // create date object $date = new TableDate($gDb); if (isset($_SESSION['dates_request'])) { // durch fehlerhafte Eingabe ist der User zu diesem Formular zurueckgekehrt // nun die vorher eingegebenen Inhalte ins Objekt schreiben // first set date and time field to a datetime and add this to date class $_SESSION['dates_request']['dat_begin'] = $_SESSION['dates_request']['date_from'] . ' ' . $_SESSION['dates_request']['date_from_time']; $_SESSION['dates_request']['dat_end'] = $_SESSION['dates_request']['date_to'] . ' ' . $_SESSION['dates_request']['date_to_time']; $date->setArray($_SESSION['dates_request']); // get the selected roles for visibility $dateRoles = $_SESSION['dates_request']['date_roles']; // check if a registration to this event is possible if (array_key_exists('date_registration_possible', $_SESSION['dates_request'])) { $dateRegistrationPossible = $_SESSION['dates_request']['date_registration_possible']; } // check if current user is assigned to this date if (array_key_exists('date_current_user_assigned', $_SESSION['dates_request'])) {
// pruefen ob das Modul ueberhaupt aktiviert ist if ($gPreferences['enable_dates_module'] != 1) { // das Modul ist deaktiviert $gMessage->show($gL10n->get('SYS_MODULE_DISABLED')); } // create Object $dates = new ModuleDates(); // read events for output $datesResult = $dates->getDataset(0, 10); // ab hier wird der RSS-Feed zusammengestellt // create RSS feed object with channel information $rss = new RSSfeed($gCurrentOrganization->getValue('org_longname') . ' - ' . $getHeadline, $gCurrentOrganization->getValue('org_homepage'), $gL10n->get('DAT_CURRENT_DATES_OF_ORGA', $gCurrentOrganization->getValue('org_longname')), $gCurrentOrganization->getValue('org_longname')); $date = new TableDate($gDb); // Dem RSSfeed-Objekt jetzt die RSSitems zusammenstellen und hinzufuegen if ($datesResult['numResults'] > 0) { $date = new TableDate($gDb); foreach ($datesResult['recordset'] as $row) { // ausgelesene Termindaten in Date-Objekt schieben $date->clear(); $date->setArray($row); // set data for attributes of this entry $title = $date->getValue('dat_begin', $gPreferences['system_date']); if ($date->getValue('dat_begin', $gPreferences['system_date']) != $date->getValue('dat_end', $gPreferences['system_date'])) { $title = $title . ' - ' . $date->getValue('dat_end', $gPreferences['system_date']); } $title = $title . ' ' . $date->getValue('dat_headline'); $link = $g_root_path . '/adm_program/modules/dates/dates.php?id=' . $date->getValue('dat_id'); $author = $row['create_name']; $pubDate = date('r', strtotime($date->getValue('dat_timestamp_create'))); // add additional information about the event to the description $descDateTo = '';
} else { $plg_link_target = '_self'; } if (!isset($plg_kal_cat)) { $plg_kal_cat = array('all'); } // Prüfen ob the Link-URL gesetzt wurde oder leer ist // wenn leer, dann Standardpfad zum Admidio-Modul if (!isset($plg_link_url) || $plg_link_url === '') { $plg_link_url = $g_root_path . '/adm_program/modules/dates/dates.php'; } // create Object $plgDates = new ModuleDates(); // read events for output $plgDatesResult = $plgDates->getDataSet(0, $plg_dates_count); $plg_date = new TableDate($gDb); echo '<div id="plugin_' . $plugin_folder . '" class="admidio-plugin-content">'; if ($plg_show_headline == 1) { echo '<h3>' . $gL10n->get('PLG_DATES_HEADLINE') . '</h3>'; } if ($plgDatesResult['numResults'] > 0) { foreach ($plgDatesResult['recordset'] as $plg_row) { $plg_date->clear(); $plg_date->setArray($plg_row); $plg_html_end_date = ''; echo '<div>' . $plg_date->getValue('dat_begin', $gPreferences['system_date']) . ' '; if ($plg_date->getValue('dat_all_day') != 1) { echo $plg_date->getValue('dat_begin', $gPreferences['system_time']); } // Bis-Datum und Uhrzeit anzeigen if ($plg_show_date_end) {
} if (isset($plg_kal_cat) == false) { $plg_kal_cat = array('all'); } // Pr?fen ob the Link-URL gesetzt wurde oder leer ist // wenn leer, dann Standardpfad zum Admidio-Modul if (isset($plg_link_url) == false || $plg_link_url == "") { $plg_link_url = $g_root_path . '/adm_program/modules/dates/dates.php'; } // set database to admidio, sometimes the user has other database connections at the same time $gDb->setCurrentDB(); //create Object $plgDates = new ModuleDates(); // read events for output $plgDatesResult = $plgDates->getDataSet(0, $plg_dates_count); $plg_date = new TableDate($gDb); echo '<div id="plugin_' . $plugin_folder . '" class="admidio-plugin-content">'; if ($plg_show_headline == 1) { echo '<h3>' . $gL10n->get('PLG_DATES_HEADLINE') . '</h3>'; } if ($plgDatesResult['numResults'] > 0) { foreach ($plgDatesResult['recordset'] as $plg_row) { $plg_date->clear(); $plg_date->setArray($plg_row); $plg_html_end_date = ''; echo $plg_date->getValue('dat_begin', $gPreferences['system_date']) . ' '; if ($plg_date->getValue('dat_all_day') != 1) { echo $plg_date->getValue('dat_begin', $gPreferences['system_time']); } // Bis-Datum und Uhrzeit anzeigen if ($plg_show_date_end) {