diff options
author | AvadootNachankar <avadoot298@gmail.com> | 2015-04-13 12:27:50 +0530 |
---|---|---|
committer | AvadootNachankar <avadoot298@gmail.com> | 2015-04-13 12:27:50 +0530 |
commit | 66647da5ee66f9feef2e8987889a95b1b8bfe5af (patch) | |
tree | 0e873fea634d1659ed9cd54bd8caec8306dff0ec /gnowsys-ndf | |
parent | 88295d4e105a6ecf0235e5000e9da516933f59c3 (diff) | |
parent | 28d6a769279af0205328cb48d55a5ec5751212c0 (diff) | |
download | gnowsys-66647da5ee66f9feef2e8987889a95b1b8bfe5af.tar.gz |
Merge pull request #1127 from makfire/event_work_flow_rectified
Event work flow rectified
Diffstat (limited to 'gnowsys-ndf')
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/event_details.html | 33 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py | 2 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py | 39 | ||||
-rw-r--r-- | gnowsys-ndf/gnowsys_ndf/ndf/views/event.py | 8 |
4 files changed, 52 insertions, 30 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 5c3b4a8..5b777de 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/event_details.html +++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/event_details.html @@ -325,8 +325,8 @@ table, th, td { <fieldset> - <div class = "row" aling="center"> - <label> <h5> Please select what you want to reschedule <h5> </label> + <div class = "row" align="center"> + <label> <h5> Please select what you want to reschedule </h5> </label> <br> <form> @@ -737,7 +737,7 @@ if ( pass[0] == 'Edit'){ { $('#attendance').append("<div class='row'>" + "<div class='small-8 columns'> " - + " <fieldset> " + + " <fieldset>" + "<div id='assessmentdiv'> <input type='checkbox' class='assessmentchkbx' id='assessmentchkbx'> Assessment Done </div>" + "<div id='attendancediv'> <input type='checkbox' class='attendancechkbx' id='attendancechkbx'> Attendance Done </div>" + " <br> <span style='color:red;'> Note:- Edit option will be closed after asessment is done. </span> " @@ -765,20 +765,23 @@ 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'>" ) } if(reschedule == false) { + <!-- reschedule == false meaning event edit functionality if closed and reschedule is not allow --> if ('{{Add}}' == 'Allow'){ - $('#attendance').append("<input class='tiny button' onclick=reschedule_time('attendance_reschedule') value='Re-Schedule'>" ) + <!-- if admin show the reschedule till panel --> + $('#attendance').append("<input class='tiny button' onclick=reschedule_time('attendance_reschedule',pass) value='Re-Schedule'>" ) } if ('{{task_attendance}}' != 'False') { if('{{Add}}' == 'Stop') { - $('#attendance').append("<input class='tiny button' onclick=reschedule_event('attendance_reschedule') value='Re-Schedule'>" ) + $('#attendance').append("<input class='tiny button' onclick = reschedule_event('attendance_reschedule') value='Re-Schedule'>" ) } } if ('{{task_attendance}}' == 'False') @@ -795,16 +798,24 @@ else } -function reschedule_time(type) +function reschedule_time(type,value) { + var event_type = "" - var event_reschedule_check = '{{event_reschedule_check}}' + var marks_entry_completed = '{{marks_entry_completed}}' event_type = String(type) - if (event_reschedule_check == 'False' && event_type == 'attendance_reschedule') + if (marks_entry_completed == 'True' && event_type == 'attendance_reschedule') { + if(value[1] != '1'){ $('#rescheduleoption').foundation('reveal', 'open'); $('#reschedule_check').empty() - $('#reschedule_check').append( "<input type='button' class='tiny button' onclick = reschedule_till_overlay('" + event_type + "') value='ok'>") + $('#reschedule_check').append( "<input type='button' class='tiny button' onclick = reschedule_till_overlay('" + event_type + "') value='ok'>")} + else + { + $('#reschedule_save').empty() + $('#reschedule_save').append( "<input type='button' class='tiny button' onclick=reschedule_event('" + event_type + "') value='Save'>") + $('#reschedulemodal').foundation('reveal', 'open'); + } } else { @@ -815,7 +826,7 @@ function reschedule_time(type) } function reschedule_till_overlay(type) - { + { if ( $('.sessiontype:checked').val() == 'Attendance') { $('#rescheduleoption').foundation('reveal', 'close'); diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py index cc00c17..0b2b8b7 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/ajax-urls.py @@ -72,7 +72,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 bc47463..d1abc21 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/ajax_views.py @@ -4668,7 +4668,7 @@ def reschedule_task(request, group_id, node): if request.user.id in listing: reschedule_attendance = node_collection.one({"_type":"AttributeType","name":"reschedule_attendance"}) - marks_entry_completed = node_collection.find({"_type":"AttributeType","name":"marks_entry_completed"}) + marks_entry = node_collection.find({"_type":"AttributeType","name":"marks_entry_completed"}) reschedule_type = request.POST.get('reschedule_type','') reshedule_choice = request.POST.get('reshedule_choice','') session = request.POST.get('session','') @@ -4719,7 +4719,7 @@ def reschedule_task(request, group_id, node): if unicode ('reschedule_dates') in i['reschedule_attendance']: reschedule_dates = i['reschedule_attendance']['reschedule_dates'] if unicode('marks_entry_completed') in i.keys(): - event_details = i['marks_entry_completed'] + marks_entry_completed = i['marks_entry_completed'] if unicode("event_attendance_task") in i.keys(): task_id = i["event_attendance_task"] @@ -4733,10 +4733,10 @@ def reschedule_task(request, group_id, node): break reschedule_dates.append(datetime.datetime.today()) - if event_details != False or reshedule_choice == "Attendance" : - 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 reshedule_choice == "Attendance" or reshedule_choice == "" : + create_gattribute(ObjectId(node),reschedule_attendance,{"reschedule_till":b,"reschedule_allow":True,"reschedule_dates":reschedule_dates}) + if session != str(1) and reshedule_choice == "Assessment" : + create_gattribute(ObjectId(node),marks_entry[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) @@ -4831,11 +4831,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={} @@ -4868,22 +4868,32 @@ 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,'relation_set.acourse_for_college':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)}) - course_modules=node_collection.find({"_id":{'$in':courses[0].collection_set}}) + if unicode('acourse_for_college') in i.keys(): + for j in i['acourse_for_college']: + 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: @@ -5177,7 +5187,8 @@ def attendees_relations(request,group_id,node): course_assignment=False course_assessment=False reschedule = True - marks = False + #marks = False + marks = True member_of=node_collection.one({"_id":{'$in':event_has_attended[0].member_of}}) if member_of.name != "Exam": diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/event.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/event.py index 2d7e62a..dce8142 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 + marks_entry_completed = True marks_list=[] Assesslist=[] batch=[] @@ -219,7 +219,7 @@ def event_detail(request, group_id, app_id=None, app_set_id=None, app_set_instan if(unicode('event_date_task')) in i.keys(): event_task_date_reschedule = i['event_date_task']['Reschedule_Task'] if(unicode('marks_entry_completed')) in i.keys(): - event_reschedule_check = i['marks_entry_completed'] + marks_entry_completed = i['marks_entry_completed'] for i in node.relation_set: if unicode('event_has_batch') in i.keys(): @@ -262,7 +262,7 @@ def event_detail(request, group_id, app_id=None, app_set_id=None, app_set_instan 'reschedule' : reschedule, 'task_date' : event_task_date_reschedule, 'task_attendance' : event_task_Attendance_reschedule, - 'event_reschedule_check' :event_reschedule_check, + 'marks_entry_completed' :marks_entry_completed, 'Eventtype':Eventtype, # 'property_order_list': property_order_list } @@ -423,7 +423,7 @@ def event_create_edit(request, group_id, app_set_id=None, app_set_instance_id=No # print " ", field_set["name"] # * Fetch only Attribute field(s) / Relation field(s) - print "getting some thing****" + if field_set.has_key('_id'): field_instance = node_collection.one({'_id': field_set['_id']}) field_instance_type = type(field_instance) |