moving support ticket response to communication (wip)
diff --git a/utilities/page/calendar/calendar.html b/utilities/page/calendar/calendar.html
index 11dd3bf..0f8cc0e 100644
--- a/utilities/page/calendar/calendar.html
+++ b/utilities/page/calendar/calendar.html
@@ -13,7 +13,7 @@
<button class="btn btn-small" onclick="erpnext.calendar.refresh('Month')">
Month View
</button>
- <button class="btn btn-small" onclick="erpnext.calendar.refresh()">
+ <button class="btn btn-small" onclick="erpnext.calendar.refresh(null, true)">
<i class="icon-refresh"></i> Refresh
</button>
</div>
diff --git a/utilities/page/calendar/calendar.js b/utilities/page/calendar/calendar.js
index 0f4ff3b..e7abbab 100644
--- a/utilities/page/calendar/calendar.js
+++ b/utilities/page/calendar/calendar.js
@@ -241,9 +241,19 @@
//------------------------------------------------------
-Calendar.prototype.refresh = function(viewtype){//Sets the viewtype of the Calendar and Calls the View class based on the viewtype
+Calendar.prototype.clear = function() {
+ this.events = {};
+ this.events_by_name = {};
+ locals.Event = {};
+}
+
+Calendar.prototype.refresh = function(viewtype, clear_events){//Sets the viewtype of the Calendar and Calls the View class based on the viewtype
if(viewtype)
this.viewtype = viewtype;
+
+ if(clear_events)
+ this.clear();
+
// switch view if reqd
if(this.cur_view.viewtype!=this.viewtype) {
this.cur_view.hide();
@@ -252,6 +262,7 @@
this.cur_view.show();
}
else{
+ this.cur_view.get_events();
this.cur_view.refresh(this);
}
}