link the different doctype in the school module (#8844)

diff --git a/erpnext/schools/doctype/course/course.js b/erpnext/schools/doctype/course/course.js
index f84c59f..c667eca 100644
--- a/erpnext/schools/doctype/course/course.js
+++ b/erpnext/schools/doctype/course/course.js
@@ -1,18 +1,30 @@
 frappe.ui.form.on("Course", "refresh", function(frm) {
 	if(!cur_frm.doc.__islocal) {
 		frm.add_custom_button(__("Program"), function() {
+			frappe.route_options = {
+				"Program Course.course": frm.doc.name
+			}
 			frappe.set_route("List", "Program");
 		});
 		
 		frm.add_custom_button(__("Student Group"), function() {
+			frappe.route_options = {
+				course: frm.doc.name
+			}
 			frappe.set_route("List", "Student Group");
 		});
 		
 		frm.add_custom_button(__("Course Schedule"), function() {
+			frappe.route_options = {
+				course: frm.doc.name
+			}
 			frappe.set_route("List", "Course Schedule");
 		});
 		
 		frm.add_custom_button(__("Assessment Plan"), function() {
+			frappe.route_options = {
+				course: frm.doc.name
+			}
 			frappe.set_route("List", "Assessment Plan");
 		});
 	}
diff --git a/erpnext/schools/doctype/program/program.js b/erpnext/schools/doctype/program/program.js
index cc09d0e..5146a19 100644
--- a/erpnext/schools/doctype/program/program.js
+++ b/erpnext/schools/doctype/program/program.js
@@ -6,22 +6,37 @@
 frappe.ui.form.on("Program", "refresh", function(frm) {
 	if(!frm.doc.__islocal) {
 		frm.add_custom_button(__("Student Applicant"), function() {
+			frappe.route_options = {
+				program: frm.doc.name
+			}
 			frappe.set_route("List", "Student Applicant");
 		});
 		
 		frm.add_custom_button(__("Program Enrollment"), function() {
+			frappe.route_options = {
+				program: frm.doc.name
+			}
 			frappe.set_route("List", "Program Enrollment");
 		});
 		
 		frm.add_custom_button(__("Student Group"), function() {
+			frappe.route_options = {
+				program: frm.doc.name
+			}
 			frappe.set_route("List", "Student Group");
 		});
 		
 		frm.add_custom_button(__("Fee Structure"), function() {
+			frappe.route_options = {
+				program: frm.doc.name
+			}
 			frappe.set_route("List", "Fee Structure");
 		});
 		
 		frm.add_custom_button(__("Fees"), function() {
+			frappe.route_options = {
+				program: frm.doc.name
+			}
 			frappe.set_route("List", "Fees");
 		});
 	}
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js
index 6f8c6cd..11a79e1 100644
--- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js
+++ b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js
@@ -4,6 +4,12 @@
 
 frappe.ui.form.on('Student Attendance Tool', {
 	refresh: function(frm) {
+		if (frappe.route_options) {
+			frm.set_value("based_on", frappe.route_options.based_on);
+			frm.set_value("student_group", frappe.route_options.student_group);
+			frm.set_value("course_schedule", frappe.route_options.course_schedule);
+			frappe.route_options = null;
+		}
 		frm.disable_save();
 	},
 
diff --git a/erpnext/schools/doctype/student_group/student_group.js b/erpnext/schools/doctype/student_group/student_group.js
index ed94690..83fe094 100644
--- a/erpnext/schools/doctype/student_group/student_group.js
+++ b/erpnext/schools/doctype/student_group/student_group.js
@@ -13,11 +13,23 @@
 
 	refresh: function(frm) {
 		if (!frm.doc.__islocal) {
+			frm.add_custom_button(__("Attendance"), function() {
+				frappe.route_options = {
+					based_on: "Student Group",
+					student_group: frm.doc.name
+				}
+				frappe.set_route("List", "Student Attendance Tool");
+			});
 			frm.add_custom_button(__("Course Schedule"), function() {
+				frappe.route_options = {
+					student_group: frm.doc.name
+				}
 				frappe.set_route("List", "Course Schedule");
 			});
-
 			frm.add_custom_button(__("Assessment Plan"), function() {
+				frappe.route_options = {
+					student_group: frm.doc.name
+				}
 				frappe.set_route("List", "Assessment Plan");
 			});
 			frm.add_custom_button(__("Update Email Group"), function() {
@@ -30,6 +42,9 @@
 				});
 			});
 			frm.add_custom_button(__("Newsletter"), function() {
+				frappe.route_options = {
+					"Newsletter Email Group.email_group": frm.doc.name
+				}
 				frappe.set_route("List", "Newsletter");
 			});
 		}