new ics lib
This commit is contained in:
parent
f97daa514b
commit
2c18071de4
@ -507,8 +507,8 @@ Zarafa.plugins.calendarimporter.dialogs.ImportPanel = Ext.extend(Ext.Panel, {
|
||||
waitMsg: 'Uploading and parsing calendar...',
|
||||
url: 'plugins/calendarimporter/php/upload.php',
|
||||
failure: function(file, action) {
|
||||
Ext.getCmp('submitButton').disable();
|
||||
Ext.getCmp('submitAllButton').disable();
|
||||
this.submitButton.disable();
|
||||
this.submitAllButton.disable();
|
||||
Zarafa.common.dialogs.MessageBox.show({
|
||||
title : _('Error'),
|
||||
msg : _(action.result.error),
|
||||
|
@ -21,6 +21,8 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
namespace calendarimporter;
|
||||
|
||||
class DownloadHandler
|
||||
{
|
||||
/**
|
||||
|
@ -395,10 +395,6 @@ class CalendarModule extends Module
|
||||
*/
|
||||
private function importCalendar($actionType, $actionData)
|
||||
{
|
||||
if ($this->DEBUG) {
|
||||
error_log("PHP Timezone: " . $tz);
|
||||
}
|
||||
|
||||
if (is_readable($actionData["ics_filepath"])) {
|
||||
$ical = new ICal($actionData["ics_filepath"], $GLOBALS["settings"]->get("zarafa/v1/plugins/calendarimporter/default_timezone"), $actionData["timezone"], $actionData["ignore_dst"]); // Parse it!
|
||||
|
||||
@ -591,9 +587,11 @@ class CalendarModule extends Module
|
||||
try {
|
||||
$parser = new vcalendar([
|
||||
"unique_id" => md5($actionData["ics_filepath"]),
|
||||
"filename" => $actionData["ics_filepath"]
|
||||
"directory" => dirname($actionData["ics_filepath"]),
|
||||
"filename" => basename($actionData["ics_filepath"])
|
||||
]);
|
||||
$parser->parse();
|
||||
error_log(print_r($parser, true));
|
||||
} catch (Exception $e) {
|
||||
$error = true;
|
||||
$error_msg = $e->getMessage();
|
||||
@ -602,7 +600,7 @@ class CalendarModule extends Module
|
||||
$response['status'] = false;
|
||||
$response['message'] = $error_msg;
|
||||
} else {
|
||||
if (iterator_count($parser) == 0) {
|
||||
if (count($parser->components) == 0) {
|
||||
$response['status'] = false;
|
||||
$response['message'] = "No event in ics file";
|
||||
} else {
|
||||
|
@ -62,7 +62,7 @@ class Plugincalendarimporter extends Plugin
|
||||
break;
|
||||
case 'server.index.load.custom':
|
||||
if ($data['name'] == 'download_ics') {
|
||||
DownloadHandler::doDownload();
|
||||
calendarimporter\DownloadHandler::doDownload();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user