Exemplo n.º 1
0
         $seperator = ':';
         break;
     case 'tab':
         $seperator = "\t";
         break;
     default:
         $seperator = '';
 }
 if ($utf16) {
     // Windows hack
     echo "ÿþ";
 }
 if ($_POST['export_type'] == 'contacts') {
     $headings = array($strTitle, $strFirstName, $strMiddleName, $strLastName, $strInitials, $strSex, $strBirthday, $strEmail, $strCountry, $strState, $strCity, $strZip, $strAddress, $strPhone, $strWorkphone, $strFax, $strWorkFax, $strCellular, $strCompany, $strDepartment, $strFunction, $ab_comment, $contacts_group);
     $headings = $quote . implode($quote . $seperator . $quote, $headings) . $quote;
     echo $utf16 ? mb_convert_encoding($headings, "UTF-16LE", "UTF-8") : $vnconv->VnConv($headings);
     echo $utf16 ? mb_convert_encoding($crlf, "UTF-16LE", "UTF-8") : $crlf;
     $ab->get_contacts_for_export($_POST['addressbook_id']);
     while ($ab->next_record()) {
         $record = array($ab->f("title"), $ab->f("first_name"), $ab->f("middle_name"), $ab->f("last_name"), $ab->f("initials"), $ab->f("sex"), $ab->f('birthday'), $ab->f("email"), $ab->f("country"), $ab->f("state"), $ab->f("city"), $ab->f("zip"), $ab->f("address"), $ab->f("home_phone"), $ab->f("work_phone"), $ab->f("fax"), $ab->f("work_fax"), $ab->f("cellular"), $ab->f("company"), $ab->f("department"), $ab->f("function"), $ab->f("comment"), $ab->f("group_name"));
         $record = $quote . implode($quote . $seperator . $quote, $record) . $quote;
         echo $utf16 ? mb_convert_encoding($record, "UTF-16LE", "UTF-8") : $vnconv->VnConv($record);
         echo $utf16 ? mb_convert_encoding($crlf, "UTF-16LE", "UTF-8") : $crlf;
     }
 } else {
     $headings = array($strName, $strCountry, $strState, $strCity, $strZip, $strAddress, $strEmail, $strPhone, $strFax, $strHomepage, $ab_bank_no, $ab_vat_no);
     $headings = $quote . implode($quote . $seperator . $quote, $headings) . $quote;
     echo $utf16 ? mb_convert_encoding($headings, "UTF-16LE", "UTF-8") : $vnconv->VnConv($headings);
     echo $utf16 ? mb_convert_encoding($crlf, "UTF-16LE", "UTF-8") : $crlf;
     $ab->get_companies($_POST['addressbook_id']);
     while ($ab->next_record()) {
Exemplo n.º 2
0
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
*/
require "../../Group-Office.php";
$GO_SECURITY->authenticate();
$GO_MODULES->authenticate('calendar');
require_once $GO_MODULES->class_path . 'calendar.class.inc';
require_once $GO_MODULES->class_path . 'go_ical.class.inc';
require_once $GO_CONFIG->class_path . 'phpvnconv/phpvnconv.class.inc';
$conv = new phpVnconv();
$ical = new go_ical();
if (isset($_REQUEST['calendar_id']) && ($calendar = $ical->get_calendar($_REQUEST['calendar_id']))) {
    $event = false;
    $filename = $conv->VnConv($calendar['name'] . '.ics');
} elseif (isset($_REQUEST['event_id']) && ($event = $ical->get_event($_REQUEST['event_id']))) {
    $calendar = false;
    $filename = $conv->VnConv($event['name'] . '.ics');
}
if (!isset($filename)) {
    die($strDataError);
} else {
    $browser = detect_browser();
    header('Content-Type: text/calendar');
    //header('Content-Length: '.filesize($path));
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    if ($browser['name'] == 'MSIE') {
        header('Content-Disposition: attachment; filename="' . $filename . '"');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');