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