예제 #1
0
     $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_END')));
 }
 if (strlen($_POST['date_from_time']) == 0 && isset($_POST['dat_all_day']) == false) {
     $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_TIME') . ' ' . $gL10n->get('SYS_START')));
 }
 if (strlen($_POST['date_to_time']) == 0 && isset($_POST['dat_all_day']) == false) {
     $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_TIME') . ' ' . $gL10n->get('SYS_END')));
 }
 if (strlen($_POST['dat_cat_id']) == 0) {
     $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('DAT_CALENDAR')));
 }
 if (isset($_POST['dat_all_day'])) {
     $_POST['date_from_time'] = '00:00';
     $_POST['date_to_time'] = '00:00';
     // Ganztägig ist nur logisch bei 23:59 Uhr (rn)
     $date->setValue('dat_all_day', 1);
 } else {
     $date->setValue('dat_all_day', 0);
 }
 if (isset($_POST['date_roles']) == false || array_count_values($_POST['date_roles']) == 0) {
     $_SESSION['dates_request']['date_roles'] = '';
     $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('DAT_VISIBLE_TO')));
 }
 // das Land nur zusammen mit dem Ort abspeichern
 if (strlen($_POST['dat_location']) == 0) {
     $_POST['dat_country'] = '';
 }
 // ------------------------------------------------
 // Datum und Uhrzeit auf Gueltigkeit pruefen
 // ------------------------------------------------
 $startDateTime = new DateTimeExtended($_POST['date_from'] . ' ' . $_POST['date_from_time'], $gPreferences['system_date'] . ' ' . $gPreferences['system_time']);
예제 #2
0
    // 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'])) {
        $dateCurrentUserAssigned = $_SESSION['dates_request']['date_current_user_assigned'];
    }
    unset($_SESSION['dates_request']);
} else {
    // read all roles that could see this event
    if ($getDateId === 0) {
        // bei neuem Termin Datum mit aktuellen Daten vorbelegen
        $date->setValue('dat_begin', date('Y-m-d H:00:00', time() + 3600));
        $date->setValue('dat_end', date('Y-m-d H:00:00', time() + 7200));
        // a new event will be visible for all users per default
        $date->setVisibleRoles(array('0'));
        $dateRoles = array(0);
    } else {
        $date->readDataById($getDateId);
        // get the saved roles for visibility
        $dateRoles = $date->getVisibleRoles();
        // Pruefung, ob der Termin zur aktuellen Organisation gehoert bzw. global ist
        if (!$date->editRight()) {
            $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
        }
    }
    // check if a registration to this event is possible
    if ($date->getValue('dat_rol_id') > 0) {