From 361861295ffbfed671b565e34392e93846dc3b49 Mon Sep 17 00:00:00 2001
From: Georg Ehrke <georg.stefan.germany@googlemail.com>
Date: Wed, 31 Aug 2011 20:41:18 +0200
Subject: [PATCH] reload page after add event successfully

---
 apps/calendar/ajax/newevent.php           | 2 +-
 apps/calendar/templates/part.newevent.php | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/apps/calendar/ajax/newevent.php b/apps/calendar/ajax/newevent.php
index 93eaef66d1..8ea39c2346 100755
--- a/apps/calendar/ajax/newevent.php
+++ b/apps/calendar/ajax/newevent.php
@@ -152,7 +152,7 @@ if($errnum != 0){
 		$data .= "RRULE:" . $repeat . "\n";
 	}
 	$data .= "END:VEVENT\nEND:VCALENDAR";
-	echo $data;
 	$result = OC_Calendar_Calendar::addCalendarObject($cal, $data);
+	echo json_encode(array("success"=>"true"));
 }
 ?>
\ No newline at end of file
diff --git a/apps/calendar/templates/part.newevent.php b/apps/calendar/templates/part.newevent.php
index 837e032c73..21dddaa7db 100755
--- a/apps/calendar/templates/part.newevent.php
+++ b/apps/calendar/templates/part.newevent.php
@@ -194,6 +194,9 @@
 				}else{
 					window.location.reload();
 				}
+				if(data.success == true){
+					location.reload();
+				}
 			},"json");
 	}
 </script>
\ No newline at end of file
-- 
GitLab