Author: ralfbecker
New Revision: 55624
URL: http://svn.stylite.de/viewvc/egroupware?rev=55624&view=rev
Log:
move egw_ical_iterator to Api\CalDAV\IcalIterator
Added:
trunk/egroupware/api/src/CalDAV/IcalIterator.php
- copied, changed from r55605, trunk/phpgwapi/inc/class.egw_ical_iterator.inc.php
Removed:
trunk/phpgwapi/inc/class.egw_ical_iterator.inc.php
Modified:
trunk/addressbook/inc/class.addressbook_import_vcard.inc.php
trunk/calendar/inc/class.calendar_ical.inc.php
— trunk/addressbook/inc/class.addressbook_import_vcard.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_import_vcard.inc.php Tue Apr 5 01:45:39 2016
@@ -10,6 +10,7 @@
+use EGroupware\Api;
/**
-
Plugin to import vCard files
@@ -17,7 +18,7 @@
class addressbook_import_vcard implements importexport_iface_import_plugin {
private static $plugin_options = array(
@@ -124,7 +125,7 @@
// Fix for Apple Addressbook
$vCard = preg_replace(’/item\d.(ADR|TEL|EMAIL|URL)/’, ‘\1’, stream_get_contents($_stream));
-
$contacts = new egw_ical_iterator($vCard, '', $charset, array($this, '_vcard'),array(
-
$contacts = new Api\CalDAV\IcalIterator($vCard, '', $charset, array($this, '_vcard'),array(
// Owner (addressbook)
$contact_owner
));
@@ -147,7 +148,7 @@
$count++;
$contacts->next();
}
@@ -166,8 +167,8 @@
if(!array_key_exists($record[‘owner’], $this->bocontacts->get_addressbooks()))
{
$this->errors[$this->current] = lang(“Unable to import into %1, using %2”,
-
Api\Accounts::username($record['owner']),
-
Api\Accounts::username($this->user)
);
$record['owner'] = $this->user;
}
@@ -220,7 +221,7 @@
} else {
//error_log(METHOD.LINE.array2string($changed).’ Old:’.$old[‘adr_one_countryname’].’ (’.$old[‘adr_one_countrycode’].’) New:’.$_data[‘adr_one_countryname’].’ (’.$_data[‘adr_one_countryname’].’)’);
}
@@ -249,8 +250,8 @@
return $result;
}
default:
@@ -289,7 +290,7 @@
$row += $record;
$rows[] = $row;
}
-
return Api\Html::table($rows);
}
/**
@@ -380,4 +381,3 @@
return $this->results;
}
} // end of iface_export_plugin
-?>
— trunk/calendar/inc/class.calendar_ical.inc.php (original)
+++ trunk/calendar/inc/class.calendar_ical.inc.php Tue Apr 5 01:45:39 2016
@@ -2249,10 +2249,10 @@
if (!is_array($this->supportedFields)) $this->setSupportedFields();
-
return new egw_ical_iterator($_vcalData,'VCALENDAR',$charset,array($this,'_ical2egw_callback'),array($this->tzid,$principalURL));
-
return new Api\CalDAV\IcalIterator($_vcalData,'VCALENDAR',$charset,array($this,'_ical2egw_callback'),array($this->tzid,$principalURL));
}
if ($this->tzid)
@@ -2317,7 +2317,7 @@
}
/**
-
- Callback for egw_ical_iterator to convert Horde_iCalendar_Vevent to EGw event array
-
- Callback for Api\CalDAV\IcalIterator to convert Horde_iCalendar_Vevent to EGw event array
-
-
@param Horde_iCalendar $component
-
@param string $tzid timezone
— trunk/phpgwapi/inc/class.egw_ical_iterator.inc.php (original)
+++ trunk/egroupware/api/src/CalDAV/IcalIterator.php Tue Apr 5 01:45:39 2016
@@ -5,11 +5,16 @@
+namespace EGroupware\Api\CalDAV;
+
+use EGroupware\Api;
+use Horde_Icalendar;
// required for tests at the end of this file (run if file called directly)
if (isset($_SERVER[‘SCRIPT_FILENAME’]) && $_SERVER[‘SCRIPT_FILENAME’] == FILE)
@@ -20,7 +25,7 @@
‘nonavbar’ => ‘true’,
),
);
- include(’…/…/header.inc.php’);
- include(’…/…/…/header.inc.php’);
}
/**
@@ -28,7 +33,7 @@
*
-
throw new egw_exception_wrong_parameter(__METHOD__.'($ical_file, ...) NO resource! $ical_file='.substr(array2string($ical_file),0,100));
-
throw new Api\Exception\WrongParameter(__METHOD__.'($ical_file, ...) NO resource! $ical_file='.substr(array2string($ical_file),0,100));
}
}
@@ -425,12 +430,12 @@
END:VEVENT
END:VCALENDAR
’;
- $GLOBALS[‘egw’]->framework->header();
//$ical_file = fopen(’/tmp/KalenderFelicitasKubala.ics’);
if (!is_resource($ical_file)) echo “$ical_file
\n”;
//$calendar_ical = new calendar_ical();
//$calendar_ical->setSupportedFields(‘file’);
- $ical_it = new egw_ical_iterator($ical_file);//,‘VCALENDAR’,‘iso-8859-1’,array($calendar_ical,’_ical2egw_callback’),array(‘Europe/Berlin’));
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs