From 749070af79105c0f642444ec7c757fe0d4a5dd14 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Fri, 10 Aug 2018 14:40:14 +0000 Subject: [PATCH 01/10] Possibility to set custom calendar options --- frappe/core/doctype/user/user.json | 304 +++++++++++++++++- .../js/frappe/views/calendar/calendar.js | 42 ++- 2 files changed, 333 insertions(+), 13 deletions(-) diff --git a/frappe/core/doctype/user/user.json b/frappe/core/doctype/user/user.json index 69030e547bd..86010491adc 100644 --- a/frappe/core/doctype/user/user.json +++ b/frappe/core/doctype/user/user.json @@ -15,6 +15,7 @@ "fields": [ { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -40,10 +41,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -72,10 +75,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -102,10 +107,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -134,10 +141,12 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -165,10 +174,12 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -196,10 +207,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 1, "collapsible": 0, @@ -227,10 +240,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -257,10 +272,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 1, "collapsible": 0, @@ -289,10 +306,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -318,10 +337,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -348,11 +369,13 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "50%" }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -379,10 +402,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 1 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -410,10 +435,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -440,10 +467,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -470,10 +499,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -501,10 +532,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -532,10 +565,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -561,10 +596,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -592,10 +629,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -622,10 +661,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -654,10 +695,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -684,10 +727,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -714,10 +759,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 1 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -745,10 +792,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -774,10 +823,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -802,10 +853,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -831,10 +884,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -861,10 +916,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -891,10 +948,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -920,10 +979,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -951,10 +1012,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -982,10 +1045,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1011,10 +1076,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1041,10 +1108,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -1072,10 +1141,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1103,10 +1174,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1133,10 +1206,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1162,10 +1237,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -1192,10 +1269,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1224,10 +1303,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -1255,10 +1336,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1285,10 +1368,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1316,10 +1401,173 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "calendar_options_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Calendar Options", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "month", + "fieldname": "calendar_defaultview", + "fieldtype": "Select", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Calendar Default View", + "length": 0, + "no_copy": 0, + "options": "month\nagendaWeek\nagendaDay", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "calendar_nowindicator", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Indicate Current Time", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_71", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "calendar_weekends", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Show Weekends", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -1348,10 +1596,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1378,10 +1628,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1409,10 +1661,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1441,11 +1695,13 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "50%" }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1473,10 +1729,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -1504,10 +1762,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1535,10 +1795,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1569,10 +1831,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1599,10 +1863,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1629,10 +1895,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1659,10 +1927,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1691,10 +1961,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1721,11 +1993,13 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "50%" }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1753,10 +2027,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1784,10 +2060,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1814,10 +2092,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1845,10 +2125,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -1875,10 +2157,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1906,10 +2190,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -1936,10 +2222,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1967,10 +2255,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 1 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1997,10 +2287,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -2026,10 +2318,12 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -2056,6 +2350,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -2072,15 +2367,14 @@ "istable": 0, "max_attachments": 5, "menu_index": 0, - "modified": "2018-06-29 10:55:32.946017", - "modified_by": "shridhar.p@zerodha.com", + "modified": "2018-08-10 16:24:17.653213", + "modified_by": "Administrator", "module": "Core", "name": "User", "owner": "Administrator", "permissions": [ { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 1, "delete": 1, @@ -2100,7 +2394,6 @@ }, { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 0, "delete": 0, @@ -2127,6 +2420,5 @@ "sort_order": "DESC", "title_field": "full_name", "track_changes": 1, - "track_seen": 0, - "track_views": 0 + "track_seen": 0 } \ No newline at end of file diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index 51c549cb6af..e8a868d475f 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt frappe.provide("frappe.views.calendar"); @@ -26,7 +26,7 @@ frappe.views.CalendarView = class CalendarView extends frappe.views.ListView { setup_defaults() { super.setup_defaults(); - this.page_title = this.page_title + ' ' + __('Calendar'); + this.page_title = __('{0} Calendar', [this.page_title]); this.calendar_settings = frappe.views.calendar[this.doctype] || {}; this.calendar_name = frappe.get_route()[3]; } @@ -97,9 +97,26 @@ frappe.views.CalendarView = class CalendarView extends frappe.views.ListView { frappe.views.Calendar = Class.extend({ init: function(options) { $.extend(this, options); - this.make_page(); - this.setup_options(); - this.make(); + this.get_default_options(); + }, + get_default_options: function() { + return new Promise ((resolve) => { + frappe.db.get_doc('User', frappe.session.user).then((r) => { + let doc = r; + let defaults = { + 'defaultView': doc.calendar_defaultview ? doc.calendar_defaultview : 'month', + 'weekends': doc.calendar_weekends==1 ? true : false, + 'nowIndicator': doc.calendar_nowindicator==1 ? true: false + } + resolve(defaults) + }); + }) + .then(defaults => { + this.make_page(); + this.setup_options(defaults); + this.make(); + this.bind(); + }) }, make_page: function() { var me = this; @@ -129,6 +146,14 @@ frappe.views.Calendar = Class.extend({ this.$cal.fullCalendar(this.cal_options); this.set_css(); }, + bind: function() { + var me = this; + let btn_group = me.$wrapper.find(".fc-button-group"); + btn_group.find(".btn").on("click", function(e) { + let value = ($(this).hasClass('fc-agendaWeek-button')) ? 'agendaWeek' : (($(this).hasClass('fc-agendaDay-button')) ? 'agendaDay' : 'month'); + frappe.db.set_value('User', frappe.session.user, 'calendar_defaultview', value); + }); + }, set_css: function() { // flatify buttons this.$wrapper.find("button.fc-state-default") @@ -166,19 +191,22 @@ frappe.views.Calendar = Class.extend({ date._offset = moment.user_utc_offset; return frappe.datetime.convert_to_system_tz(date); }, - setup_options: function() { + setup_options: function(defaults) { var me = this; this.cal_options = { locale: frappe.boot.user.language || "en", header: { left: 'title', center: '', - right: 'prev,next month,agendaWeek,agendaDay' + right: 'prev,today,next month,agendaWeek,agendaDay' }, editable: true, selectable: true, selectHelper: true, forceEventDuration: true, + defaultView: defaults.defaultView, + weekends: defaults.weekends, + nowIndicator: defaults.nowIndicator, events: function(start, end, timezone, callback) { return frappe.call({ method: me.get_events_method || "frappe.desk.calendar.get_events", From 41eb81d6c7b4a4788d9172ec8f523e5869dbbe6a Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Fri, 10 Aug 2018 17:11:33 +0000 Subject: [PATCH 02/10] Codacy corrections --- .../public/js/frappe/views/calendar/calendar.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index e8a868d475f..4bdca0b9853 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -107,16 +107,16 @@ frappe.views.Calendar = Class.extend({ 'defaultView': doc.calendar_defaultview ? doc.calendar_defaultview : 'month', 'weekends': doc.calendar_weekends==1 ? true : false, 'nowIndicator': doc.calendar_nowindicator==1 ? true: false - } - resolve(defaults) + }; + resolve(defaults); }); }) .then(defaults => { - this.make_page(); - this.setup_options(defaults); - this.make(); - this.bind(); - }) + this.make_page(); + this.setup_options(defaults); + this.make(); + this.bind(); + }); }, make_page: function() { var me = this; @@ -149,7 +149,7 @@ frappe.views.Calendar = Class.extend({ bind: function() { var me = this; let btn_group = me.$wrapper.find(".fc-button-group"); - btn_group.find(".btn").on("click", function(e) { + btn_group.find(".btn").on("click", function() { let value = ($(this).hasClass('fc-agendaWeek-button')) ? 'agendaWeek' : (($(this).hasClass('fc-agendaDay-button')) ? 'agendaDay' : 'month'); frappe.db.set_value('User', frappe.session.user, 'calendar_defaultview', value); }); From 23db516ebbd9066a25ad8cd61c2ad16ab436a88b Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Sat, 11 Aug 2018 08:00:55 +0000 Subject: [PATCH 03/10] Codacy correction --- frappe/public/js/frappe/views/calendar/calendar.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index 4bdca0b9853..2aeed7a54aa 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -110,8 +110,7 @@ frappe.views.Calendar = Class.extend({ }; resolve(defaults); }); - }) - .then(defaults => { + }).then(defaults => { this.make_page(); this.setup_options(defaults); this.make(); From b8ebe02b606a13571d9bf6e9a23358d3fbbfb3a1 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Sat, 11 Aug 2018 08:05:41 +0000 Subject: [PATCH 04/10] Codacy corrections --- frappe/public/js/frappe/views/calendar/calendar.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index 2aeed7a54aa..7862458d086 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -111,11 +111,11 @@ frappe.views.Calendar = Class.extend({ resolve(defaults); }); }).then(defaults => { - this.make_page(); - this.setup_options(defaults); - this.make(); - this.bind(); - }); + this.make_page(); + this.setup_options(defaults); + this.make(); + this.bind(); + }); }, make_page: function() { var me = this; From 1157383d19a63aa4d5192db64e1b2f90a6cc7e7e Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Tue, 14 Aug 2018 07:07:18 +0000 Subject: [PATCH 05/10] Set now indicator as default --- frappe/core/doctype/user/user.json | 65 +------------------ .../js/frappe/views/calendar/calendar.js | 5 +- 2 files changed, 3 insertions(+), 67 deletions(-) diff --git a/frappe/core/doctype/user/user.json b/frappe/core/doctype/user/user.json index 86010491adc..b60bf523b50 100644 --- a/frappe/core/doctype/user/user.json +++ b/frappe/core/doctype/user/user.json @@ -1470,69 +1470,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "calendar_nowindicator", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Indicate Current Time", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_71", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -2367,7 +2304,7 @@ "istable": 0, "max_attachments": 5, "menu_index": 0, - "modified": "2018-08-10 16:24:17.653213", + "modified": "2018-08-14 09:03:24.516999", "modified_by": "Administrator", "module": "Core", "name": "User", diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index 7862458d086..9274f87fbd2 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -105,8 +105,7 @@ frappe.views.Calendar = Class.extend({ let doc = r; let defaults = { 'defaultView': doc.calendar_defaultview ? doc.calendar_defaultview : 'month', - 'weekends': doc.calendar_weekends==1 ? true : false, - 'nowIndicator': doc.calendar_nowindicator==1 ? true: false + 'weekends': doc.calendar_weekends==1 ? true : false }; resolve(defaults); }); @@ -205,7 +204,7 @@ frappe.views.Calendar = Class.extend({ forceEventDuration: true, defaultView: defaults.defaultView, weekends: defaults.weekends, - nowIndicator: defaults.nowIndicator, + nowIndicator: true, events: function(start, end, timezone, callback) { return frappe.call({ method: me.get_events_method || "frappe.desk.calendar.get_events", From 653f03443f90cadb1b29bb27440ebd8810d96255 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Tue, 14 Aug 2018 12:35:34 +0000 Subject: [PATCH 06/10] Weekend options as a button --- frappe/core/doctype/user/user.json | 6 +++--- .../public/js/frappe/views/calendar/calendar.js | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/user/user.json b/frappe/core/doctype/user/user.json index b60bf523b50..b705829b537 100644 --- a/frappe/core/doctype/user/user.json +++ b/frappe/core/doctype/user/user.json @@ -1413,7 +1413,7 @@ "columns": 0, "fieldname": "calendar_options_section", "fieldtype": "Section Break", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -1479,7 +1479,7 @@ "columns": 0, "fieldname": "calendar_weekends", "fieldtype": "Check", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -2304,7 +2304,7 @@ "istable": 0, "max_attachments": 5, "menu_index": 0, - "modified": "2018-08-14 09:03:24.516999", + "modified": "2018-08-14 12:58:29.724450", "modified_by": "Administrator", "module": "Core", "name": "User", diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index 9274f87fbd2..4b8188321d3 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -113,6 +113,7 @@ frappe.views.Calendar = Class.extend({ this.make_page(); this.setup_options(defaults); this.make(); + this.setup_view_mode_button(defaults); this.bind(); }); }, @@ -144,6 +145,13 @@ frappe.views.Calendar = Class.extend({ this.$cal.fullCalendar(this.cal_options); this.set_css(); }, + setup_view_mode_button(defaults) { + var me = this; + $(me.footnote_area).find('.btn-weekend').detach() + let btnTitle = (defaults.weekends) ? __('Hide Weekends') : __('Show Weekends') + const btn = `` + me.footnote_area.append(btn); + }, bind: function() { var me = this; let btn_group = me.$wrapper.find(".fc-button-group"); @@ -151,6 +159,15 @@ frappe.views.Calendar = Class.extend({ let value = ($(this).hasClass('fc-agendaWeek-button')) ? 'agendaWeek' : (($(this).hasClass('fc-agendaDay-button')) ? 'agendaDay' : 'month'); frappe.db.set_value('User', frappe.session.user, 'calendar_defaultview', value); }); + + me.footnote_area.on('click', '.btn-weekend', () => { + this.cal_options.weekends = !this.cal_options.weekends; + frappe.db.set_value('User', frappe.session.user, 'calendar_weekends', this.cal_options.weekends).then((r) => { + this.$cal.fullCalendar('option', 'weekends', this.cal_options.weekends); + this.set_css(); + this.setup_view_mode_button(this.cal_options); + }) + }); }, set_css: function() { // flatify buttons From 83f4587bac7d8e9816e548769f88a5da525f6081 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Tue, 14 Aug 2018 12:41:47 +0000 Subject: [PATCH 07/10] Codacy corrections --- frappe/public/js/frappe/views/calendar/calendar.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index 4b8188321d3..ac2bece7c94 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -147,9 +147,9 @@ frappe.views.Calendar = Class.extend({ }, setup_view_mode_button(defaults) { var me = this; - $(me.footnote_area).find('.btn-weekend').detach() - let btnTitle = (defaults.weekends) ? __('Hide Weekends') : __('Show Weekends') - const btn = `` + $(me.footnote_area).find('.btn-weekend').detach(); + let btnTitle = (defaults.weekends) ? __('Hide Weekends') : __('Show Weekends'); + const btn = ``; me.footnote_area.append(btn); }, bind: function() { @@ -162,11 +162,11 @@ frappe.views.Calendar = Class.extend({ me.footnote_area.on('click', '.btn-weekend', () => { this.cal_options.weekends = !this.cal_options.weekends; - frappe.db.set_value('User', frappe.session.user, 'calendar_weekends', this.cal_options.weekends).then((r) => { + frappe.db.set_value('User', frappe.session.user, 'calendar_weekends', this.cal_options.weekends).then(() => { this.$cal.fullCalendar('option', 'weekends', this.cal_options.weekends); this.set_css(); this.setup_view_mode_button(this.cal_options); - }) + }); }); }, set_css: function() { From 259003a63a3f973c2095d4c3198a5b894629c8da Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Wed, 15 Aug 2018 10:13:02 +0000 Subject: [PATCH 08/10] Move preferences to localStorage --- frappe/core/doctype/user/user.json | 100 +----------------- .../js/frappe/views/calendar/calendar.js | 45 ++++---- 2 files changed, 25 insertions(+), 120 deletions(-) diff --git a/frappe/core/doctype/user/user.json b/frappe/core/doctype/user/user.json index b705829b537..15e7e5eaef2 100644 --- a/frappe/core/doctype/user/user.json +++ b/frappe/core/doctype/user/user.json @@ -1404,104 +1404,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fieldname": "calendar_options_section", - "fieldtype": "Section Break", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Calendar Options", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "month", - "fieldname": "calendar_defaultview", - "fieldtype": "Select", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Calendar Default View", - "length": 0, - "no_copy": 0, - "options": "month\nagendaWeek\nagendaDay", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "calendar_weekends", - "fieldtype": "Check", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Show Weekends", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -2304,7 +2206,7 @@ "istable": 0, "max_attachments": 5, "menu_index": 0, - "modified": "2018-08-14 12:58:29.724450", + "modified": "2018-08-15 12:12:06.215199", "modified_by": "Administrator", "module": "Core", "name": "User", diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index ac2bece7c94..4a973c79089 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -49,13 +49,13 @@ frappe.views.CalendarView = class CalendarView extends frappe.views.ListView { } this.load_lib - .then(() => this.get_calendar_options()) + .then(() => this.get_calendar_preferences()) .then(options => { this.calendar = new frappe.views.Calendar(options); }); } - get_calendar_options() { + get_calendar_preferences() { const options = { doctype: this.doctype, parent: this.$result, @@ -100,15 +100,15 @@ frappe.views.Calendar = Class.extend({ this.get_default_options(); }, get_default_options: function() { + const me = this; return new Promise ((resolve) => { - frappe.db.get_doc('User', frappe.session.user).then((r) => { - let doc = r; - let defaults = { - 'defaultView': doc.calendar_defaultview ? doc.calendar_defaultview : 'month', - 'weekends': doc.calendar_weekends==1 ? true : false - }; - resolve(defaults); - }); + let defaultView = localStorage.getItem('defaultView'); + let weekends = localStorage.getItem('weekends'); + let defaults = { + 'defaultView': defaultView ? defaultView : "month", + 'weekends': weekends ? weekends : true + }; + resolve(defaults); }).then(defaults => { this.make_page(); this.setup_options(defaults); @@ -145,28 +145,31 @@ frappe.views.Calendar = Class.extend({ this.$cal.fullCalendar(this.cal_options); this.set_css(); }, - setup_view_mode_button(defaults) { + setup_view_mode_button: function(defaults) { var me = this; $(me.footnote_area).find('.btn-weekend').detach(); let btnTitle = (defaults.weekends) ? __('Hide Weekends') : __('Show Weekends'); const btn = ``; me.footnote_area.append(btn); }, + set_localStorage_option: function(option, value) { + localStorage.removeItem(option); + localStorage.setItem(option, value); + }, bind: function() { - var me = this; + const me = this; let btn_group = me.$wrapper.find(".fc-button-group"); - btn_group.find(".btn").on("click", function() { + btn_group.on("click", ".btn", function() { let value = ($(this).hasClass('fc-agendaWeek-button')) ? 'agendaWeek' : (($(this).hasClass('fc-agendaDay-button')) ? 'agendaDay' : 'month'); - frappe.db.set_value('User', frappe.session.user, 'calendar_defaultview', value); + me.set_localStorage_option("defaultView", value); }); - me.footnote_area.on('click', '.btn-weekend', () => { - this.cal_options.weekends = !this.cal_options.weekends; - frappe.db.set_value('User', frappe.session.user, 'calendar_weekends', this.cal_options.weekends).then(() => { - this.$cal.fullCalendar('option', 'weekends', this.cal_options.weekends); - this.set_css(); - this.setup_view_mode_button(this.cal_options); - }); + me.$wrapper.on("click", ".btn-weekend", function() { + me.cal_options.weekends = !me.cal_options.weekends; + me.$cal.fullCalendar('option', 'weekends', me.cal_options.weekends); + me.set_localStorage_option("weekends", me.cal_options.weekends) + me.set_css(); + me.setup_view_mode_button(me.cal_options); }); }, set_css: function() { From 4eb9a5e32ef2a9c6cf8fbf520745d623ea49d14f Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Wed, 15 Aug 2018 11:30:56 +0000 Subject: [PATCH 09/10] Codacy corrections --- frappe/public/js/frappe/views/calendar/calendar.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index 4a973c79089..64ddb5614b7 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -100,7 +100,6 @@ frappe.views.Calendar = Class.extend({ this.get_default_options(); }, get_default_options: function() { - const me = this; return new Promise ((resolve) => { let defaultView = localStorage.getItem('defaultView'); let weekends = localStorage.getItem('weekends'); @@ -167,7 +166,7 @@ frappe.views.Calendar = Class.extend({ me.$wrapper.on("click", ".btn-weekend", function() { me.cal_options.weekends = !me.cal_options.weekends; me.$cal.fullCalendar('option', 'weekends', me.cal_options.weekends); - me.set_localStorage_option("weekends", me.cal_options.weekends) + me.set_localStorage_option("weekends", me.cal_options.weekends); me.set_css(); me.setup_view_mode_button(me.cal_options); }); From fadd51086ba8931215c6fbe6d89bda64467f3c59 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 24 Aug 2018 15:22:24 +0530 Subject: [PATCH 10/10] Update calendar.js --- frappe/public/js/frappe/views/calendar/calendar.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frappe/public/js/frappe/views/calendar/calendar.js b/frappe/public/js/frappe/views/calendar/calendar.js index 64ddb5614b7..d7a93de5722 100644 --- a/frappe/public/js/frappe/views/calendar/calendar.js +++ b/frappe/public/js/frappe/views/calendar/calendar.js @@ -101,8 +101,8 @@ frappe.views.Calendar = Class.extend({ }, get_default_options: function() { return new Promise ((resolve) => { - let defaultView = localStorage.getItem('defaultView'); - let weekends = localStorage.getItem('weekends'); + let defaultView = localStorage.getItem('cal_defaultView'); + let weekends = localStorage.getItem('cal_weekends'); let defaults = { 'defaultView': defaultView ? defaultView : "month", 'weekends': weekends ? weekends : true @@ -160,13 +160,13 @@ frappe.views.Calendar = Class.extend({ let btn_group = me.$wrapper.find(".fc-button-group"); btn_group.on("click", ".btn", function() { let value = ($(this).hasClass('fc-agendaWeek-button')) ? 'agendaWeek' : (($(this).hasClass('fc-agendaDay-button')) ? 'agendaDay' : 'month'); - me.set_localStorage_option("defaultView", value); + me.set_localStorage_option("cal_defaultView", value); }); me.$wrapper.on("click", ".btn-weekend", function() { me.cal_options.weekends = !me.cal_options.weekends; me.$cal.fullCalendar('option', 'weekends', me.cal_options.weekends); - me.set_localStorage_option("weekends", me.cal_options.weekends); + me.set_localStorage_option("cal_weekends", me.cal_options.weekends); me.set_css(); me.setup_view_mode_button(me.cal_options); });