diff options
4 files changed, 28 insertions, 13 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/event_details.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/event_details.html index 5c3b4a82..30ab09aa 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/event_details.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/event_details.html @@ -765,7 +765,7 @@ else { $('#attendance').append("<input class='tiny button' id='d' onclick='Download("+pass[1]+")' value='Download'>") - if(reschedule == true || marks_enter == true) + if(reschedule == true || marks_enter == false) { $('#attendance').append("<input class='tiny button' id='d' onclick=EditAttendance('Edit') value='Edit'>" ) } @@ -800,7 +800,7 @@ function reschedule_time(type) var event_type = "" var event_reschedule_check = '{{event_reschedule_check}}' event_type = String(type) - if (event_reschedule_check == 'False' && event_type == 'attendance_reschedule') + if (event_reschedule_check == 'True' && event_type == 'attendance_reschedule') { $('#rescheduleoption').foundation('reveal', 'open'); $('#reschedule_check').empty() diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py index ad5a7c75..f896df74 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py @@ -73,7 +73,7 @@ urlpatterns = patterns('gnowsys_ndf.ndf.views.ajax_views', url(r'^attendees_relations/(?P<node>[\w-]+)$', 'attendees_relations', name='attendees_relations'), url(r'^close_event/(?P<node>[\w-]+)$', 'close_event', name='close_event'), url(r'^fetch_course_name/(?P<Course_type>[^/]+)$', 'fetch_course_name', name='fetch_course_name'), - url(r'^fetch_course_Module/(?P<Course_name>[^/]+)$', 'fetch_course_Module', name='fetch_course_Module'), + url(r'^fetch_course_Module/(?P<announced_course>[^/]+)$', 'fetch_course_Module', name='fetch_course_Module'), url(r'^fetch_course_session/(?P<Course_name>[^/]+)$', 'fetch_course_session', name='fetch_course_session'), url(r'^fetch_course_batches/(?P<Course_name>[^/]+)$', 'fetch_course_batches', name='fetch_course_batches'), url(r'^fetch_batch_student/(?P<Course_name>[^/]+)$', 'fetch_batch_student', name='fetch_batch_student'), diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py index 25910d89..7da7ff4a 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py @@ -4794,10 +4794,12 @@ def reschedule_task(request, group_id, node): break reschedule_dates.append(datetime.datetime.today()) - if event_details != False or reshedule_choice == "Attendance" : + if reshedule_choice == "Attendance" : + print "sfsfsaffasdfsaf" create_gattribute(ObjectId(node),reschedule_attendance,{"reschedule_till":b,"reschedule_allow":True,"reschedule_dates":reschedule_dates}) - if session != str(1): - create_gattribute(ObjectId(node),marks_entry_completed[0],True) + if session != str(1) and reshedule_choice == "Assessment" : + print "coming here" + create_gattribute(ObjectId(node),marks_entry_completed[0],False) task_id['Reschedule_Task'] = True reschedule_event=node_collection.one({"_type":"AttributeType","name":"event_attendance_task"}) create_gattribute(ObjectId(node),reschedule_event,task_id) @@ -4892,11 +4894,11 @@ def event_assginee(request, group_id, app_set_instance_id=None): attendedlist.append(a['Name']) if attendancesession != str(1): - create_gattribute(ObjectId(app_set_instance_id),marks_entry_completed[0],True) + create_gattribute(ObjectId(app_set_instance_id),marks_entry_completed[0],False) if assessmentdone == 'True': event_status = node_collection.one({"_type":"AttributeType","name":"event_status"}) create_gattribute(ObjectId(app_set_instance_id),event_status,unicode('Completed')) - create_gattribute(ObjectId(app_set_instance_id),marks_entry_completed[0],False) + create_gattribute(ObjectId(app_set_instance_id),marks_entry_completed[0],True) reschedule_dates={} @@ -4929,22 +4931,35 @@ def fetch_course_name(request, group_id,Course_type): return HttpResponse(json.dumps(course_list)) @get_execution_time -def fetch_course_Module(request, group_id,Course_name): +def fetch_course_Module(request, group_id,announced_course): + #Course_name batch = request.GET.get('batchid','') + superdict={} module_Detail={} module_list=[] event_type_ids=[] - courses = node_collection.one({"_id":ObjectId(Course_name)},{'relation_set.announced_for':1}) + + courses = node_collection.one({"_id":ObjectId(announced_course)},{'relation_set.announced_for':1}) + group_node = node_collection.one({"_id":ObjectId(group_id)},{'relation_set.group_of':1}) + eventtypes = node_collection.find({'_type': "GSystemType", 'name': {'$in': ["Classroom Session", "Exam"]}}) for i in eventtypes: event_type_ids.append(i._id) + for i in courses.relation_set: if unicode('announced_for') in i.keys(): announced_for = i['announced_for'] - courses=node_collection.find({"_id":{'$in':announced_for}}) - trainers=node_collection.find({"relation_set.trainer_of_course":ObjectId(Course_name)}) + + for i in group_node.relation_set: + if unicode('group_of') in i.keys(): + for j in i['group_of']: + group_of = j + + courses = node_collection.find({"_id":{'$in':announced_for}}) + trainers = node_collection.find({"relation_set.trainer_teaches_course_in_college":[ObjectId(courses[0]._id),ObjectId(group_of)]}) course_modules=node_collection.find({"_id":{'$in':courses[0].collection_set}}) + #condition for all the modules to be listed is session in it should not be part of the event checklist=[] for i in course_modules: diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/event.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/event.py index 571bd54e..f67e5e8f 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/event.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/event.py @@ -188,7 +188,7 @@ def event_detail(request, group_id, app_id=None, app_set_id=None, app_set_instan nodes = node_collection.find({'member_of': event_gst._id, 'group_set': ObjectId(group_id)}).sort('last_update', -1) node = None - event_reschedule_check = False + event_reschedule_check = True marks_list=[] Assesslist=[] batch=[] |