} echo '<form action="' . $_SERVER['PHP_SELF'] . '?action=save" method="POST">'; echo '<input type="hidden" name="id" value="' . $fb->freebusy_id . '" />'; echo '<table> <tr> <th>' . $p->t('global/bezeichnung') . '</th> <th>' . $p->t('freebusy/typ') . '</th> <th>' . $p->t('freebusy/url') . '</th> <th>' . $p->t('freebusy/aktiv') . '</th> </tr> <tr> <td><input type="text" name="bezeichnung" size="20" maxlength="256" value="' . $db->convert_html_chars($fb->bezeichnung) . '"/></td> <td> <select name="typ" id="typ" onchange="seturl()">'; echo '<OPTION value="" >-- ' . $p->t('global/auswahl') . ' --</OPTION>'; $fbtyp = new freebusy(); $fbtyp->getTyp(); foreach ($fbtyp->result as $row) { if ($row->freebusytyp_kurzbz == $fb->freebusytyp_kurzbz) { $selected = 'selected'; } else { $selected = ''; } $vorlage = mb_str_replace('$uid', $user, $row->url_vorlage); echo '<OPTION value="' . $db->convert_html_chars($row->freebusytyp_kurzbz) . '" ' . $selected . ' url="' . $db->convert_html_chars($vorlage) . '">' . $db->convert_html_chars($row->bezeichnung), '</OPTION>'; } echo ' </select> </td> <td><input type="text" id="url" name="url" size="60" maxlength="1024" value="' . $db->convert_html_chars($fb->url) . '"/></td> <td><input type="checkbox" name="aktiv" ' . ($fb->aktiv ? 'checked="checked"' : '') . ' /></td>
require_once '../../include/ical.class.php'; if (!isset($_SERVER['PATH_INFO'])) { die('Username fehlt. Aufruf ueber ' . APP_ROOT . 'cis/public/freebusy.php/username/'); } $uid = mb_substr($_SERVER['PATH_INFO'], 1); $bn = new benutzer(); if (!$bn->load($uid)) { // Optional kann auch der Alias als Parameter uebergeben werden // Dies ist fuer die verwendung von Outlook nuetzlich if ($bn->loadAlias($uid)) { $uid = $bn->uid; } else { die('User invalid'); } } $freebusy = new freebusy(); $freebusy->getFreeBusy($uid); header("Content-Type: text/calendar; charset=UTF-8"); echo "BEGIN:VCALENDAR\n"; echo "VERSION:2.0\n"; echo "PRODID:-//FHCOMPLETE//EN\n"; echo "METHOD:PUBLISH\n"; echo 'ORGANIZER;CN=', $bn->vorname, ' ', $bn->nachname, ':mailto:', $uid, '@', DOMAIN, "\n"; echo 'DTSTAMP;TZID=Europe/Vienna:', date('Ymd', mktime(date('H'), date('i'), date('s'), date('m'), date('d') - 5, date('Y'))), 'T', date('Hms'), "\n"; echo 'DTSTART;TZID=Europe/Vienna:', date('Ymd', mktime(0, 0, 0, date('m'), date('d') - 5, date('Y'))), "T000000\n"; echo 'DTEND;TZID=Europe/Vienna:', date('Ymd', mktime(0, 0, 0, date('m'), date('d') + 30, date('Y'))), "T000000\n"; echo 'URL:', APP_ROOT, 'cis/public/freebusy.php/', $uid, "\n"; $ical = new ical(); foreach ($freebusy->result as $row) { if ($row->aktiv) { $fp = fopen($row->url, 'r');