From a202f8d3745cc820b0443325310ecf161ac9b246 Mon Sep 17 00:00:00 2001 From: Ujjawal Lele Date: Thu, 2 Mar 2023 00:14:19 +0530 Subject: [PATCH 1/6] workers would be assigned by SecIncharge instead of Caretaker --- .../applications/complaint_system/admin.py | 3 +- .../applications/complaint_system/models.py | 17 +- .../applications/complaint_system/urls.py | 38 +- .../applications/complaint_system/views.py | 459 +++++++++--------- .../complaintModule/add_workers.html | 2 +- .../complaintModule/assignworker.html | 79 +-- .../complaintModule/complaint_caretaker.html | 31 +- .../complaint_secincharge.html | 161 ++++++ ...html => complaint_secincharge_detail.html} | 334 ++++++------- .../complainthistory_caretaker.html | 4 +- .../complainthistory_secincharge.html | 160 ++++++ .../complaintModule/lodgecomplaint_user.html | 2 +- .../complaintModule/reassignworker.html | 82 +--- .../complaintModule/resolve_pending.html | 2 +- .../resolvecomplaint_caretaker.html | 131 +++++ ...html => resolvecomplaint_secincharge.html} | 134 +---- .../complaintModule/worker_id_know_more.html | 2 +- 17 files changed, 894 insertions(+), 747 deletions(-) create mode 100644 FusionIIIT/templates/complaintModule/complaint_secincharge.html rename FusionIIIT/templates/complaintModule/{complaint_caretaker_detail.html => complaint_secincharge_detail.html} (96%) create mode 100644 FusionIIIT/templates/complaintModule/complainthistory_secincharge.html create mode 100644 FusionIIIT/templates/complaintModule/resolvecomplaint_caretaker.html rename FusionIIIT/templates/complaintModule/{resolvecomplaint.html => resolvecomplaint_secincharge.html} (51%) diff --git a/FusionIIIT/applications/complaint_system/admin.py b/FusionIIIT/applications/complaint_system/admin.py index 84314fcd9..8bf43cab7 100644 --- a/FusionIIIT/applications/complaint_system/admin.py +++ b/FusionIIIT/applications/complaint_system/admin.py @@ -1,8 +1,9 @@ from django.contrib import admin -from .models import Caretaker, StudentComplain, Supervisor, Workers +from .models import Caretaker, StudentComplain, Supervisor, Workers, SectionIncharge admin.site.register(Caretaker) admin.site.register(Workers) admin.site.register(StudentComplain) admin.site.register(Supervisor) +admin.site.register(SectionIncharge) diff --git a/FusionIIIT/applications/complaint_system/models.py b/FusionIIIT/applications/complaint_system/models.py index 9f8849e69..9dda42684 100644 --- a/FusionIIIT/applications/complaint_system/models.py +++ b/FusionIIIT/applications/complaint_system/models.py @@ -12,11 +12,13 @@ class Constants: ('hall-1', 'hall-1'), ('hall-3', 'hall-3'), ('hall-4', 'hall-4'), - ('CC1', 'CC1'), - ('CC2', 'CC2'), + ('library', 'CC1'), + ('computer center', 'CC2'), ('core_lab', 'core_lab'), ('LHTC', 'LHTC'), ('NR2', 'NR2'), + ('NR3', 'NR3'), + ('Admin building', 'Admin building'), ('Rewa_Residency', 'Rewa_Residency'), ('Maa Saraswati Hostel', 'Maa Saraswati Hostel'), ('Nagarjun Hostel', 'Nagarjun Hostel'), @@ -44,9 +46,16 @@ class Caretaker(models.Model): def __str__(self): return str(self.id) + '-' + self.area +class SectionIncharge(models.Model): + staff_id = models.ForeignKey(ExtraInfo, on_delete=models.CASCADE) + work_type = models.CharField(choices=Constants.COMPLAINT_TYPE, + max_length=20, default='Electricity') + + def __str__(self): + return str(self.id) + '-' + self.work_type class Workers(models.Model): - caretaker_id = models.ForeignKey(Caretaker, on_delete=models.CASCADE) + secincharge_id = models.ForeignKey(SectionIncharge, on_delete=models.CASCADE) name = models.CharField(max_length=50) age = models.CharField(max_length=10) phone = models.BigIntegerField(blank=True) @@ -83,6 +92,6 @@ def __str__(self): class Supervisor(models.Model): sup_id = models.ForeignKey(ExtraInfo, on_delete=models.CASCADE) area = models.CharField(choices=Constants.AREA, max_length=20) - + def __str__(self): return str(self.sup_id.user.username) diff --git a/FusionIIIT/applications/complaint_system/urls.py b/FusionIIIT/applications/complaint_system/urls.py index b95605ade..5c49008de 100644 --- a/FusionIIIT/applications/complaint_system/urls.py +++ b/FusionIIIT/applications/complaint_system/urls.py @@ -9,43 +9,37 @@ url(r'^$', views.check, name='complaint'), # url(r'^login/$', views.login1, name='complaint'), url(r'^user/$', views.user), - url(r'^user/caretakerfb/$' , views.caretaker_feedback), - url(r'^user/(?P[0-9]+)/$', views.submitfeedback), url(r'^user/detail/(?P[0-9]+)/$', views.detail,name='detail'), - # url(r'^user/check_complaint/$', views.save_comp), - + # url(r'^user/check_complaint/$', views.save_comp), # caretaker url(r'^caretaker/$', views.caretaker, name='caretaker'), url(r'^caretaker/feedback/(?P[0-9]+)/$', views.feedback_care), - url(r'^caretaker/worker_id_know_more/(?P[0-9]+)/complaint_reassign/(?P[0-9]+)/discharge_worker/$', views.discharge_worker,name='discharge_worker'), - url(r'^caretaker/worker_id_know_more/(?P[0-9]+)/$', views.worker_id_know_more, name='come_back_to_this'), - url(r'^caretaker/worker_id_know_more/(?P[0-9]+)/complaint_reassign/(?P[0-9]+)/$', views.complaint_reassign), - #url(r'^caretaker/list_caretakers_area/$', views.caretaker, name='caretaker'), url(r'^caretaker/pending/(?P[0-9]+)/$', views.resolvepending), - url(r'^caretaker/detail2/(?P[0-9]+)/$', views.detail2,name='detail2'), + url(r'^caretaker/detail/(?P[0-9]+)/$', views.detail), url(r'^caretaker/search_complaint$', views.search_complaint), - - + url(r'^caretaker/(?P[0-9]+)/(?P[0-9]+)/$', views.changestatus), + + # secincharge + url(r'^secincharge/$', views.section_incharge, name='department_head'), + url(r'^secincharge/worker_id_know_more/(?P[0-9]+)/complaint_reassign/(?P[0-9]+)/discharge_worker/$', views.discharge_worker,name='discharge_worker'), + url(r'^secincharge/worker_id_know_more/(?P[0-9]+)/$', views.worker_id_know_more, name='come_back_to_this'), + url(r'^secincharge/worker_id_know_more/(?P[0-9]+)/complaint_reassign/(?P[0-9]+)/$', views.complaint_reassign), + url(r'^secincharge/detail2/(?P[0-9]+)/$', views.detail2,name='detail2'), + url(r'^secincharge/worker_id_know_more/(?P[0-9]+)/removew/$', views.removew), + url(r'^secincharge/(?P[0-9]+)/$', views.assign_worker,name='assign_worker'), + url(r'^secincharge/deletecomplaint/(?P[0-9]+)/$', views.deletecomplaint), + # supervisor url(r'^supervisor/$', views.supervisor), url(r'^supervisor/feedback/(?P[0-9]+)/$', views.feedback_super), url(r'^supervisor/caretaker_id_know_more/(?P[0-9]+)/$', views.caretaker_id_know_more), url(r'^supervisor/caretaker_id_know_more/(?P[0-9]+)/complaint_reassign_super/(?P[0-9]+)/$', views.complaint_reassign_super, name = 'complaint_reassign_super'), - url(r'^supervisor/detail3/(?P[0-9]+)/$', views.detail3, name = 'detail3'), - - + url(r'^supervisor/detail3/(?P[0-9]+)/$', views.detail3, name = 'detail3'), - - # CRUD task - url(r'^caretaker/worker_id_know_more/(?P[0-9]+)/removew/$', views.removew), - url(r'^caretaker/(?P[0-9]+)/$', views.assign_worker,name='assign_worker'), - url(r'^caretaker/deletecomplaint/(?P[0-9]+)/$', views.deletecomplaint), - # url(r'^caretaker/(?P[0-9]+)/$', views.assign_worker), - url(r'^caretaker/(?P[0-9]+)/(?P[0-9]+)/$', views.changestatus), - + # api's for complaint system url(r'^api/',include('applications.complaint_system.api.urls')) ] \ No newline at end of file diff --git a/FusionIIIT/applications/complaint_system/views.py b/FusionIIIT/applications/complaint_system/views.py index b566856aa..a2c98b242 100644 --- a/FusionIIIT/applications/complaint_system/views.py +++ b/FusionIIIT/applications/complaint_system/views.py @@ -10,9 +10,11 @@ from applications.globals.models import User , ExtraInfo, HoldsDesignation from notifications.models import Notification -from .models import Caretaker, StudentComplain, Supervisor, Workers +from .models import Caretaker, StudentComplain, Supervisor, Workers, SectionIncharge from notification.views import complaint_system_notif -#function for reassign to another worker + + +#for SectionIncharge @login_required def complaint_reassign(request,wid,iid): current_user = get_object_or_404(User, username=request.user.username) @@ -26,64 +28,49 @@ def complaint_reassign(request,wid,iid): complaint_finish = request.POST.get('complaint_finish', '') worker_id = request.POST.get('assign_worker', '') - w = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').get(id=worker_id) + w = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').get(id=worker_id) StudentComplain.objects.select_for_update().filter(id=iid).\ update(worker_id=w, status=1) - url = '/complaint/caretaker/worker_id_know_more/'+wid; - complainer_details = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=iid) + url = '/complaint/secincharge/worker_id_know_more/'+wid; + complainer_details = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=iid) student=0 message = "Your complaint has been re-assigned" complaint_system_notif(request.user, complainer_details.complainer.user ,'reassign_worker_alert',complainer_details.id,student,message) return HttpResponseRedirect(url) - elif type == 'redirect': - assign_caretaker = request.POST.get('assign_caretaker', '') - c = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').get(id=assign_caretaker) - c1 = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').get(id=iid) - remark = 'Redirect complaint from ' + c1.area - StudentComplain.objects.select_for_update().filter(id=iid).\ - update(location=c.area, remarks=remark) - url = '/complaint/caretaker/worker_id_know_more/'+wid; - complainer_details = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=iid) - student=0 - message = "Your complaint has been redirected to another caretaker" - complaint_system_notif(request.user, complainer_details.complainer.user ,'comp_redirect_alert',complainer_details.id,student,message) - return HttpResponseRedirect(url) else: y = ExtraInfo.objects.all().select_related('user','department').get(id=y.id) - a = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').get(staff_id=y) - b = a.area + a = SectionIncharge.objects.select_related('staff_id','staff_id__user','staff_id__department').get(staff_id=y) + b = a.work_type comp_id = y.id try: - detail = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(id=iid).first() - total_caretaker = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').all() - total_caretakers_in_area = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').filter(area=b) + detail = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(id=iid).first() + total_secincharge = SectionIncharge.objects.select_related('staff_id','staff_id__user','staff_id__department').all() + total_secincharges_in_area = SectionIncharge.objects.select_related('staff_id','staff_id__user','staff_id__department').filter(work_type=b) worker = [] workertemp = [] flag = '' temp = detail.location try: - if Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').filter(caretaker_id=a).count() == 0: + if Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').filter(secincharge_id=a).count() == 0: flag = 'no_worker' else: - workertemp = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').filter(caretaker_id=a) + workertemp = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').filter(secincharge_id=a) j = 1 for i in workertemp: worker.append(i) - # if j%2 != 0: - # worker.append(i) - # j = j + 1 - - except Caretaker.DoesNotExist: + except SectionIncharge.DoesNotExist: flag = 'no_worker' except StudentComplain.DoesNotExist: return HttpResponse("

Not a valid complaint

") return render(request, "complaintModule/reassignworker.html", {'detail': detail, 'worker': worker, 'flag': - flag, 'total_caretaker': total_caretaker,'a':a, 'wid':wid, 'total_caretakers_in_area':total_caretakers_in_area}) + flag, 'total_secincharge': total_secincharge,'a':a, 'wid':wid, 'total_secincharges_in_area':total_secincharges_in_area}) + + @login_required def complaint_reassign_super(request,caretaker_id,iid): @@ -97,9 +84,7 @@ def complaint_reassign_super(request,caretaker_id,iid): comp_id = y.id - - - +#for SectionIncharge @login_required def assign_worker(request, comp_id1): current_user = get_object_or_404(User, username=request.user.username) @@ -124,85 +109,65 @@ def assign_worker(request, comp_id1): if type == 'assign': complaint_finish = request.POST.get('complaint_finish', '') worker_id = request.POST.get('assign_worker', '') - w = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').get(id=worker_id) - StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').select_for_update().filter(id=comp_id1).\ + w = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').get(id=worker_id) + StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').select_for_update().filter(id=comp_id1).\ update(worker_id=w, status=1) - complainer_details = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=comp_id1) + complainer_details = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=comp_id1) student = 0 message = "Worker has been assigned to your complaint" complaint_system_notif(request.user, complainer_details.complainer.user ,'assign_worker_alert',complainer_details.id,student,message) - - return HttpResponseRedirect('/complaint/caretaker/') - elif type == 'redirect': - assign_caretaker = request.POST.get('assign_caretaker', '') - c = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').get(id=assign_caretaker) - c1 = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').get(id=comp_id) - remark = 'Redirect complaint from ' + c1.area - StudentComplain.objects.select_for_update().filter(id=comp_id1).\ - update(location=c.area, remarks=remark) - complainer_details = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=comp_id1) - student=0 - message = "Your Complaint has been redirected to another caretaker" - complaint_system_notif(request.user, complainer_details.complainer.user ,'comp_redirect_alert',complainer_details.id,student,message) - return HttpResponseRedirect('/complaint/caretaker/') + return HttpResponseRedirect('/complaint/secincharge/') + else: y = ExtraInfo.objects.all().select_related('user','department').get(id=y.id) - a = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').get(staff_id=y) - b = a.area + a = SectionIncharge.objects.select_related('staff_id','staff_id__user','staff_id__department').get(staff_id=y) + b = a.work_type comp_id = y.id try: - detail = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(id=comp_id1).first() - total_caretaker = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').all() - total_caretakers_in_area = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').filter(area=b and id!=a.id) + detail = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(id=comp_id1).first() + total_secincharge = SectionIncharge.objects.select_related('staff_id','staff_id__user','staff_id__department').all() + total_secincharges_in_area = SectionIncharge.objects.select_related('staff_id','staff_id__user','staff_id__department').filter(work_type=b and id!=a.id) workertemp = [] worker = [] flag = '' temp = detail.location try: - #care = Caretaker.objects.filter(area=temp).first() - if Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').filter(caretaker_id=a).count() == 0: + if Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').filter(secincharge_id=a).count() == 0: flag = 'no_worker' else: - workertemp1 = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').filter(caretaker_id=a) + workertemp1 = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').filter(secincharge_id=a) workertemp = workertemp1.filter(worker_type=detail.complaint_type) j = 1 for i in workertemp: worker.append(i) - # if j%2 != 0: - # worker.append(i) - # j = j + 1 - - - except Caretaker.DoesNotExist: + + except SectionIncharge.DoesNotExist: flag = 'no_worker' except StudentComplain.DoesNotExist: return HttpResponse("

Not a valid complaint

") return render(request, "complaintModule/assignworker.html", {'detail': detail, 'worker': worker, 'flag': - flag, 'total_caretaker': total_caretaker,'a':a, 'total_caretakers_in_area':total_caretakers_in_area}) + flag, 'total_secincharge': total_secincharge,'a':a, 'total_secincharges_in_area':total_secincharges_in_area}) + +#for SectionIncharge @login_required def discharge_worker(request,wid,cid): current_user = get_object_or_404(User, username=request.user.username) y = ExtraInfo.objects.all().select_related('user','department').filter(user=current_user).first() - this_worker = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').get(id=wid) - com_in_concern= StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=cid); + this_worker = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').get(id=wid) + com_in_concern= StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=cid); com_in_concern.worker_id=None; com_in_concern.status=0; StudentComplain.objects.select_for_update().filter(id=cid).\ update(worker_id=None, status=0) - #StudentComplain.objects.get(id=cid).delete() - url='/complaint/caretaker/detail2/'+cid; + url='/complaint/secincharge/detail2/'+cid; return HttpResponseRedirect(url) - - - - @login_required def caretaker_feedback(request): """ @@ -234,23 +199,23 @@ def caretaker_feedback(request): return render(request, "complaintModule/submit_feedback_caretaker.html", {'a': a}) +#for SectionIncharge @login_required def worker_id_know_more(request, work_id): """ function to know pending complaints assigned to the worker """ - this_worker = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').get(id=work_id) - num = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(worker_id=this_worker).count(); - complaints_list = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(worker_id=this_worker); + this_worker = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').get(id=work_id) + num = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(worker_id=this_worker).count(); + complaints_list = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(worker_id=this_worker); complaints_list_onhold = [] for i in complaints_list: if i.status == 1: complaints_list_onhold.append(i) numpend = len(complaints_list_onhold) - work_under_caretaker1 = this_worker.caretaker_id.staff_id.user.first_name - work_under_caretaker2 = this_worker.caretaker_id.staff_id.user.last_name - return render(request, "complaintModule/worker_id_know_more.html",{'this_worker':this_worker,'work_under_caretaker1':work_under_caretaker1,'work_under_caretaker2':work_under_caretaker2, 'num':num, 'complaints_list':complaints_list, 'complaints_list_onhold':complaints_list_onhold, 'numpend':numpend}) - + work_under_secincharge1 = this_worker.secincharge_id.staff_id.user.first_name + work_under_secincharge2 = this_worker.secincharge_id.staff_id.user.last_name + return render(request, "complaintModule/worker_id_know_more.html",{'this_worker':this_worker,'work_under_secincharge1':work_under_secincharge1,'work_under_secincharge2':work_under_secincharge2, 'num':num, 'complaints_list':complaints_list, 'complaints_list_onhold':complaints_list_onhold, 'numpend':numpend}) @@ -286,7 +251,10 @@ def check(request): if b.user_type == 'student': return HttpResponseRedirect('/complaint/user/') elif b.user_type == 'staff': - return HttpResponseRedirect('/complaint/caretaker/') + if SectionIncharge.objects.all().select_related('work_type').filter(staff_id=b).count() == 0: + return HttpResponseRedirect('/complaint/caretaker/') + else: + return HttpResponseRedirect('/complaint/secincharge/') elif b.user_type == 'faculty': return HttpResponseRedirect('/complaint/supervisor/') else: @@ -341,17 +309,6 @@ def user(request): y = ExtraInfo.objects.all().select_related('user','department').get(id=comp_id) #check if location given if location!="": - # x = StudentComplain(complainer=y, - # complaint_type=comp_type, - # location=location, - # specific_location=specific_location, - # details=details, - # status=status, - # complaint_finish=complaint_finish, - # upload_complaint=comp_file) - - - # x.save() obj1, created = StudentComplain.objects.get_or_create(complainer=y, complaint_type=comp_type, location=location, @@ -362,26 +319,17 @@ def user(request): upload_complaint=comp_file) - historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(complainer=y).order_by('-id') + historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complainer=y).order_by('-id') history = [] j = 1 k = 1 for i in historytemp: history.append(i) - # if j%2 != 0: - # history.append(i) - # j = j+1 - - + for h in history: h.serial_no = k k = k+1 - # if location == "hall1": - # dsgn = "hall1caretaker" - # elif location == "hall3": - # dsgn = "hall3caretaker" - # else : - # dsgn = "hall4caretaker" + if location == "hall-1": dsgn ="hall1caretaker" elif location =="hall-3": @@ -414,68 +362,31 @@ def user(request): message = "A New Complaint has been lodged" complaint_system_notif(request.user, caretaker_name.user,'lodge_comp_alert',obj1.id,student,message) - # return render(request, "complaintModule/complaint_user.html", - # {'history': history, 'comp_id': comp_id }) - # next = request.POST.get('next', '/') - messages.success(request,message) return HttpResponseRedirect('/complaint/user') else: a = get_object_or_404(User, username=request.user.username) y = ExtraInfo.objects.all().select_related('user','department').filter(user=a).first() - historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(complainer=y).order_by('-id') + historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complainer=y).order_by('-id') history=[] notification = Notification.objects.filter(recipient=a.id) notification = notification.filter(data__exact={'url':'complaint:detail','module':'Complaint System'}) - # notification_message = [] - # for notification in x: - # to = User.objects.get(id=notification.actor_object_id).username - # from django.utils.timesince import timesince as timesince_ - # duration = timesince_(notification.timestamp,None) - # notification_message.append(notification.verb+' by '+ to + ' ' + duration + ' ago ') - - - j = 1 for i in historytemp: history.append(i) - # if j%2 != 0: - # history.append(i) - # j = j+1 - + for i in history: i.serial_no = j j = j+1 - # if location == "hall-1": - # dsgn ="hall1caretaker" - # elif location =="hall-3": - # dsgn ="hall3caretaker" - # elif location =="hall-4": - # dsgn ="hall4caretaker" - # elif location =="CC1": - # dsgn ="CC convenor" - # elif location =="CC2": - # dsgn ="CC2 convener" - # elif location == "core_lab": - # dsgn = "corelabcaretaker" - # elif location =="LHTC": - # dsgn ="lhtccaretaker" - # elif location =="NR2": - # dsgn ="nr2caretaker" - # else: - # dsgn = "rewacaretaker" - # caretaker_name = HoldsDesignation.objects.get(designation__name = dsgn) - # complaint_system_notif(request.user, caretaker_name.user,'lodge_comp_alert') return render(request, "complaintModule/complaint_user.html", {'history': history,'notification':notification, 'comp_id': y.id}) - return render(request, "complaintModule/complaint_user.html", - {'history': history, 'comp_id': comp_id }) + @login_required def save_comp(request): """ @@ -523,14 +434,15 @@ def save_comp(request): upload_complaint =comp_file) x.save() - # messages.info(request,'Complaint successfully launched.') - # return HttpResponseRedirect('/complaint/user/') + return HttpResponseRedirect('/complaint/user/') + + @login_required def caretaker(request): """ - The function is used to display details to the caretaker such as registered complaints and allows to assign workers + The function is used to display details to the caretaker such as registered complaints @param: request - trivial. @@ -558,44 +470,126 @@ def caretaker(request): y = None intage = int(age) intphone = int(phone) - # if len(phone) == 10 and intage > 20 and intage < 50 and intphone > 1999999999: - # x = Workers(caretaker_id=a, - # name=name, - # age=age, - # phone=phone, - # worker_type=worker_type) - # if not Workers.objects.filter(caretaker_id=a,name=name, age=age,phone=phone,worker_type=worker_type).exists(): - # x.save() + + b = a.area + historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(location=b).order_by('-id') + history = [] + j = 1 + k = 1 + for i in historytemp: + history.append(i) + + for h in history: + h.serial_no = k + k=k+1 + + + notification = Notification.objects.filter(recipient=current_user.id) + notification = notification.filter(data__exact={'url':'complaint:detail2','module':'Complaint System'}) + return render(request, "complaintModule/complaint_caretaker.html", + {'history': history, + 'notification': notification}) + + + else: + y = ExtraInfo.objects.all().select_related('user','department').get(id=y.id) + a = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').get(staff_id=y) + b = a.area + history = [] + historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(location=b).order_by('-id') + + + overduecomplaint = [] + j = 1 + k = 1 + for i in historytemp: + history.append(i) + + for i in history: + i.serial_no = k + k = k + 1 + + if i.status != 2 and i.status !=3: + if i.complaint_finish < date.today(): + i.delay = date.today() - i.complaint_finish + overduecomplaint.append(i) + + notification = Notification.objects.filter(recipient=current_user.id) + notification = notification.filter(data__exact={'url':'complaint:detail2','module':'Complaint System'}) + + + + return render(request, "complaintModule/complaint_caretaker.html", + { 'history': history, 'comp_id': y.id, + 'notification':notification, + 'overduecomplaint': overduecomplaint, 'care_id': a}) + + + +#for SectionIncharge +@login_required +def section_incharge(request): + """ + The function is used to display details to the department head such as registered complaints and allows to assign workers + @param: + request - trivial. + + + @variables: + issue - The issue object. + supported - True if the user's intention is to support the issue. + support_count - Total supporters of the above issue. + context - Holds data needed to make necessary changes in the template. + """ + current_user = get_object_or_404(User, username=request.user.username) + y = ExtraInfo.objects.all().select_related('user','department').filter(user=current_user).first() + + if request.method == 'POST': + type = request.POST.get('submit', '') + worker_type = request.POST.get('complaint_type', '') + name = request.POST.get('name', '') + phone = request.POST.get('phone_no', '') + age = request.POST.get('age', '') + try: + y = ExtraInfo.objects.all().select_related('user','department').get(id=y.id) + a = SectionIncharge.objects.select_related('staff_id','staff_id__user','staff_id__department').get(staff_id=y) + except Exception as e: + a = None + y = None + intage = int(age) + intphone = int(phone) + if len(phone) == 10 and intage > 20 and intage < 50 and intphone > 1999999999: + x = Workers(secincharge_id=a, + name=name, + age=age, + phone=phone, + worker_type=worker_type) + if not Workers.objects.filter(secincharge_id=a,name=name, age=age,phone=phone,worker_type=worker_type).exists(): + x.save() if len(phone) == 10 and intage > 20 and intage < 50 and intphone > 1999999999: - obj, created = Workers.objects.get_or_create(caretaker_id=a, + obj, created = Workers.objects.get_or_create( secincharge_id=a, name=name, age=age, phone=phone, worker_type=worker_type) - b = a.area - historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(location=b).order_by('-id') + b = a.work_type + historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complaint_type=b).order_by('-id') history = [] j = 1 k = 1 for i in historytemp: history.append(i) - # if j%2 == 1: - # history.append(i) - # j = j+1 + for h in history: h.serial_no = k k=k+1 total_worker = [] - total_workertemp = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').filter(caretaker_id=a) + total_workertemp = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').filter(secincharge_id=a) j = 1 - # for i in total_workertemp: - # if j%2 != 0: - # total_worker.append(i) - # j = j + 1 for i in total_workertemp: @@ -604,14 +598,14 @@ def caretaker(request): complaint_assign_no = [] for x in total_worker: - worker = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').get(id=x.id) - temp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(worker_id=worker).count() + worker = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').get(id=x.id) + temp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(worker_id=worker).count() worker.total_complaint = temp complaint_assign_no.append(worker) notification = Notification.objects.filter(recipient=current_user.id) notification = notification.filter(data__exact={'url':'complaint:detail2','module':'Complaint System'}) - return render(request, "complaintModule/complaint_caretaker.html", + return render(request, "complaintModule/complaint_secincharge.html", {'history': history, 'comp_id': y.id, 'notification': notification, 'total_worker': total_worker, 'complaint_assign_no': complaint_assign_no}) @@ -620,12 +614,12 @@ def caretaker(request): else: y = ExtraInfo.objects.all().select_related('user','department').get(id=y.id) - a = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').get(staff_id=y) - b = a.area + a = SectionIncharge.objects.select_related('staff_id','staff_id__user','staff_id__department').get(staff_id=y) + b = a.work_type history = [] - historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(location=b).order_by('-id') + historytemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complaint_type=b).order_by('-id') total_worker = [] - total_workertemp = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').filter(caretaker_id=a) + total_workertemp = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').filter(secincharge_id=a) j = 1 for i in total_workertemp: total_worker.append(i) @@ -634,8 +628,8 @@ def caretaker(request): complaint_assign_no = [] for x in total_worker: - worker = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').get(id=x.id) - temp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(worker_id=worker).count() + worker = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').get(id=x.id) + temp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(worker_id=worker).count() worker.total_complaint = temp complaint_assign_no.append(worker) @@ -644,9 +638,7 @@ def caretaker(request): k = 1 for i in historytemp: history.append(i) - # if j%2 != 0: - # history.append(i) - # j=j+1 + for i in history: i.serial_no = k k = k + 1 @@ -661,22 +653,24 @@ def caretaker(request): - return render(request, "complaintModule/complaint_caretaker.html", + return render(request, "complaintModule/complaint_secincharge.html", { 'history': history, 'comp_id': y.id, 'total_worker': total_worker, 'complaint_assign_no': total_worker, 'notification':notification, - 'overduecomplaint': overduecomplaint, 'care_id': a}) + 'overduecomplaint': overduecomplaint, 'secincharge_id': a}) + + @login_required def remove_worker_from_complaint(request,complaint_id): """ - The function is used by caretaker to remove a worker + The function is used by secincharge to remove a worker already assigned to a complaint @param: request - trivial complaint_id - used to get complaint_id registered """ - complaint = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(complaint_id=complaint_id).update(worker_id='') + complaint = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complaint_id=complaint_id).update(worker_id='') return HttpResponseRedirect('/complaint/caretaker/') @@ -698,23 +692,26 @@ def changestatus(request, complaint_id, status): context - Holds data needed to make necessary changes in the template. """ if status == '3': - StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(id=complaint_id).\ + StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(id=complaint_id).\ update(status=status, worker_id='') return HttpResponseRedirect('/complaint/caretaker/') elif status == '2': - StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(id=complaint_id).\ + StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(id=complaint_id).\ update(status=status, worker_id='') return HttpResponseRedirect('/complaint/caretaker/') else: - StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(id=complaint_id).\ + StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(id=complaint_id).\ update(status=status) return HttpResponseRedirect('/complaint/caretaker/') + + +#for SectionIncharge @login_required def removew(request, work_id): """ - The function is used by caretaker to remove workers. + The function is used by secincharge to remove workers. @param: request - trivial. work_id - id of the issue object which the user intends to support/unsupport. @@ -725,11 +722,11 @@ def removew(request, work_id): support_count - Total supporters of the above issue. context - Holds data needed to make necessary changes in the template. """ - worker = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').get(id=work_id) - temp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(worker_id=worker).count() + worker = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').get(id=work_id) + temp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(worker_id=worker).count() if temp == 0: worker.delete() - return HttpResponseRedirect('/complaint/caretaker/') + return HttpResponseRedirect('/complaint/secincharge/') else: return HttpResponse('

Worker is assign some complaint

') @@ -752,9 +749,9 @@ def submitfeedback(request, complaint_id): if request.method == 'POST': feedback = request.POST.get('feedback', '') rating = request.POST.get('rating', '') - StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(id=complaint_id).\ + StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(id=complaint_id).\ update(feedback=feedback, flag=rating) - a = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(id=complaint_id).first() + a = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(id=complaint_id).first() care = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').filter(area=a.location).first() rate = care.rating newrate = 0 @@ -768,27 +765,26 @@ def submitfeedback(request, complaint_id): Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').filter(area=a.location).update(rating=newrate) return HttpResponseRedirect('/complaint/user/') - return render(request,"complaintModule/feedback.html",{'a' : a}) else: - a = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=complaint_id) + a = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=complaint_id) return render(request, "complaintModule/submit_feedback.html", {'a': a}) - - +#for SectionIncharge @login_required def deletecomplaint(request, comp_id1): """ function to delete complaint """ StudentComplain.objects.get(id=comp_id1).delete() - return HttpResponseRedirect('/complaint/caretaker/') + return HttpResponseRedirect('/complaint/secincharge/') + + def testEntry(): - # list1 = [('SKM','hall-1'),('HS','hall-3'),('PS','hall-4'),('MSR','Maa Saraswati Hostel'),('KKB','Maa Saraswati Hostel'), ('RP','Nagarjun Hostel'),('DS','Nagarjun Hostel'),('AV','Panini Hostel')] list1 = [('eecivil','NR2'),('eecivil','Rewa_Residency'),('eecivil','LHTC'),('eecivil','core_lab')] # to delete supervisors @@ -834,15 +830,13 @@ def supervisor(request): area = all_caretaker[0].area # ExtraInfo.objects.get(id=sup_id) all_complaint = [] - numtemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(location = area).filter(status = 0).count() + numtemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(location = area).filter(status = 0).count() num = int(numtemp/2+0.5) - all_complainttemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(location=a.area).order_by('-id') + all_complainttemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(location=a.area).order_by('-id') j = 1 for i in all_complainttemp: all_complaint.append(i) - # if j%2 != 0: - # all_complaint.append(i) - # j = j + 1 + overduecomplaint = [] for i in all_complaint: if i.status != 2 and i.status != 3: @@ -861,16 +855,14 @@ def supervisor(request): except : return HttpResponseRedirect('/') - #print(a) - # if(len(a)==0) : - # return render('../dashboard/') + a = Supervisor.objects.select_related('sup_id','sup_id__user','sup_id__department').get(sup_id=y) all_caretaker = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').filter(area=a.area).order_by('-id') area = all_caretaker[0].area - numtemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(location = area).filter(status = 0).count() + numtemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(location = area).filter(status = 0).count() num = int(numtemp/2+0.5) all_complaint = [] - all_complainttemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(location=a.area).order_by('-id') + all_complainttemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(location=a.area).order_by('-id') j = 1 for i in all_complainttemp: all_complaint.append(i) @@ -893,15 +885,12 @@ def caretaker_id_know_more(request,caretaker_id): this_caretaker = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').get(id = caretaker_id) this_caretaker_area = this_caretaker.area; list_pending_complaints = [] - list_pending_complaintstemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(location = this_caretaker_area).filter(status = 0) + list_pending_complaintstemp = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(location = this_caretaker_area).filter(status = 0) j = 1 for i in list_pending_complaintstemp: list_pending_complaints.append(i) - # if j%2 != 0: - # list_pending_complaints.append(i) - # j = j + 1 + - # num = StudentComplain.objects.filter(location = this_caretaker_area).filter(status = 0).count(); num = len(list_pending_complaints) return render(request, "complaintModule/caretaker_id_know_more.html",{'this_caretaker':this_caretaker , 'list_pending_complaints':list_pending_complaints, 'num':num}) @@ -913,7 +902,7 @@ def search_complaint(request): def resolvepending(request, cid): a = get_object_or_404(User, username=request.user.username) y = ExtraInfo.objects.all().select_related('user','department').filter(user=a).first() - thiscomplaint = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=cid) + thiscomplaint = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=cid) if request.method == 'POST': newstatus = request.POST.get('yesorno','') comment = request.POST.get('comment') @@ -922,11 +911,11 @@ def resolvepending(request, cid): intstatus = 2 else: intstatus = 3 - StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(id=cid).\ + StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(id=cid).\ update(status=intstatus) - StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(id=cid).\ + StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(id=cid).\ update(comment=comment) - complainer_details = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=cid) + complainer_details = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=cid) student=0 message = "Congrats! Your complaint has been resolved" complaint_system_notif(request.user, complainer_details.complainer.user ,'comp_resolved_alert',complainer_details.id,student,message) @@ -938,6 +927,7 @@ def resolvepending(request, cid): + def login1(request): if request.method == 'POST': u = request.POST.get('username', '') @@ -956,10 +946,10 @@ def login1(request): @login_required def feedback_super(request, feedcomp_id): - detail3 = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=feedcomp_id) + detail3 = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=feedcomp_id) a=User.objects.get(username=detail3.complainer.user.username) y=ExtraInfo.objects.all().select_related('user','department').get(user=a) - temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(complainer=y).first() + temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complainer=y).first() comp_id=temp.id loc = detail3.location care = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').filter(area=loc).first() @@ -968,47 +958,49 @@ def feedback_super(request, feedcomp_id): @login_required def feedback_care(request, feedcomp_id): - detail2 = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=feedcomp_id) + detail2 = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=feedcomp_id) a=User.objects.get(username=detail2.complainer.user.username) y=ExtraInfo.objects.all().select_related('user','department').get(user=a) - temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(complainer=y).first() + temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complainer=y).first() comp_id=temp.id return render(request, "complaintModule/feedback_care.html", {"detail2": detail2,"comp_id":comp_id}) - - +#for complainaint and caretaker @login_required def detail(request, detailcomp_id1): """ function that shows detail about complaint """ - detail = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=detailcomp_id1) + detail = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=detailcomp_id1) if(detail.worker_id is None): worker_name = None worker_id = detail.worker_id else: worker_id = detail.worker_id.id - worker = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').get(id=worker_id) + worker = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').get(id=worker_id) worker_name = worker.name a=User.objects.get(username=detail.complainer.user.username) y=ExtraInfo.objects.all().select_related('user','department').get(user=a) num=0 if detail.upload_complaint != "": num = 1 - temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(complainer=y).first() + temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complainer=y).first() comp_id=temp.id return render(request, "complaintModule/complaint_user_detail.html", {"detail": detail, "comp_id":detail.id,"num":num,"worker_name":worker_name}) + + +#for SectionIncharge @login_required def detail2(request, detailcomp_id1): - detail2 = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=detailcomp_id1) + detail2 = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=detailcomp_id1) if(detail2.worker_id is None): worker_name = None worker_id = detail2.worker_id else: worker_id = detail2.worker_id.id - worker = Workers.objects.select_related('caretaker_id','caretaker_id__staff_id','caretaker_id__staff_id__user','caretaker_id__staff_id__department').get(id=worker_id) + worker = Workers.objects.select_related('secincharge_id','secincharge_id__staff_id','secincharge_id__staff_id__user','secincharge_id__staff_id__department').get(id=worker_id) worker_name = worker.name a=User.objects.get(username=detail2.complainer.user.username) y=ExtraInfo.objects.all().select_related('user','department').get(user=a) @@ -1016,20 +1008,21 @@ def detail2(request, detailcomp_id1): if detail2.upload_complaint != "": num = 1 - temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(complainer=y).first() + temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complainer=y).first() comp_id=temp.id - return render(request, "complaintModule/complaint_caretaker_detail.html", {"detail2": detail2, "comp_id":detail2.id,"num":num,"worker_name":worker_name,"wid":worker_id}) + return render(request, "complaintModule/complaint_secincharge_detail.html", {"detail2": detail2, "comp_id":detail2.id,"num":num,"worker_name":worker_name,"wid":worker_id}) + @login_required def detail3(request, detailcomp_id1): - detail3 = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').get(id=detailcomp_id1) + detail3 = StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').get(id=detailcomp_id1) a=User.objects.get(username=detail3.complainer.user.username) y=ExtraInfo.objects.all().select_related('user','department').get(user=a) num=0 if detail3.upload_complaint != "": num = 1 - temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__caretaker_id__staff_id','worker_id__caretaker_id__staff_id__user','worker_id__caretaker_id__staff_id__department').filter(complainer=y).first() + temp=StudentComplain.objects.select_related('complainer','complainer__user','complainer__department','worker_id','worker_id__secincharge_id__staff_id','worker_id__secincharge_id__staff_id__user','worker_id__secincharge_id__staff_id__department').filter(complainer=y).first() comp_id=temp.id loc = detail3.location care = Caretaker.objects.select_related('staff_id','staff_id__user','staff_id__department').filter(area=loc).first() - return render(request, "complaintModule/complaint_supervisor_detail.html", {"detail3": detail3,"comp_id":comp_id,"care":care,"num":num}) + return render(request, "complaintModule/complaint_supervisor_detail.html", {"detail3": detail3,"comp_id":comp_id,"care":care,"num":num}) \ No newline at end of file diff --git a/FusionIIIT/templates/complaintModule/add_workers.html b/FusionIIIT/templates/complaintModule/add_workers.html index 842d4397a..eafae79c7 100644 --- a/FusionIIIT/templates/complaintModule/add_workers.html +++ b/FusionIIIT/templates/complaintModule/add_workers.html @@ -118,7 +118,7 @@ Click on the particular worker to remove

- These Worker present under Caretaker : {{ request.user.first_name}} + These Worker present under Department Head : {{ request.user.first_name}} {{ request.user.last_name}}


diff --git a/FusionIIIT/templates/complaintModule/assignworker.html b/FusionIIIT/templates/complaintModule/assignworker.html index 458d05ff9..7cab80338 100644 --- a/FusionIIIT/templates/complaintModule/assignworker.html +++ b/FusionIIIT/templates/complaintModule/assignworker.html @@ -1,4 +1,4 @@ - + {% extends 'globals/base.html' %} {% load static %} @@ -57,9 +57,6 @@ Assign Worker - - Redirect -
@@ -161,80 +158,6 @@

- -
-
-

If you think that this complaint does not belong to you .
- You a can pass this complaint to required caretaker .

-
- {% csrf_token %} -
- -
Complaint ID :{{ detail.complainer }}
-
Complainer :{{ detail.complainer.user.first_name }} - {{detail.complainer.user.last_name}} -
-
-
- -
-
- - - - -
-
- - - - -
-
- - - - -
Complaint Type: {{ detail.complaint_type }}
Location: {{ detail.location }}
Specific Location: {{ detail.specific_location }}
-
- - {% if detail.status != 0 %} - -

You have assigned a worker. First, remove the worker from this complaint then - declined this complaint. - .

- {% else %} - - -

- - - - - {% if total_caretakers_in_area %} - - {% endif %} - {% endif %} -
-
-
-
-
- - {% comment %}The ... end here!{% endcomment %} diff --git a/FusionIIIT/templates/complaintModule/complaint_caretaker.html b/FusionIIIT/templates/complaintModule/complaint_caretaker.html index 688097058..42bfaad3a 100644 --- a/FusionIIIT/templates/complaintModule/complaint_caretaker.html +++ b/FusionIIIT/templates/complaintModule/complaint_caretaker.html @@ -61,24 +61,15 @@ {% comment %}The Tab-Menu ends here!{% endcomment %} @@ -94,16 +85,9 @@ The central-rail segment starts here! {% endcomment %}
- {% comment %}The ... start here!{% endcomment %} -
- {% block lodgecomplaint %} - {% include 'complaintModule/add_workers.html' %} - {% endblock %} -
- {% comment %}The ... end here!{% endcomment %} {% comment %}The ... starts here!{% endcomment %} -
+
{% block complainthistory %} {% include 'complaintModule/complainthistory_caretaker.html' %} {% endblock %} @@ -111,14 +95,9 @@ {% comment %}The ... ends here!{% endcomment %} {% comment %}The ... starts here!{% endcomment %} -
+
{% block resolvecomplaint %} - {% include 'complaintModule/resolvecomplaint.html' %} - {% endblock %} -
-
- {% block overduecomplaint %} - {% include 'complaintModule/overduecomplaint.html' %} + {% include 'complaintModule/resolvecomplaint_caretaker.html' %} {% endblock %}
{% comment %}The ... ends here!{% endcomment %} diff --git a/FusionIIIT/templates/complaintModule/complaint_secincharge.html b/FusionIIIT/templates/complaintModule/complaint_secincharge.html new file mode 100644 index 000000000..5b941db40 --- /dev/null +++ b/FusionIIIT/templates/complaintModule/complaint_secincharge.html @@ -0,0 +1,161 @@ + + +{% extends 'globals/base.html' %} +{% load static %} + + +{% block title %} + Complaint +{% endblock %} + + + + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + + {% comment %}The grid starts here!{% endcomment %} +
+ + {% comment %}The left-margin segment!{% endcomment %} +
+ + {% comment %} + The left-rail segment starts here! + {% endcomment %} +
+ + {% comment %}The user image card starts here!{% endcomment %} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} + {% comment %}The user image card ends here!{% endcomment %} + + {% comment %}
{% endcomment %} +       + {% comment %}
+ {% if care_id.rating == 5 %} + + + {% elif care_id.rating == 4 %} + + + {% elif care_id.rating == 3 %} + + + {% elif care_id.rating == 2 %} + + + {% elif care_id.rating == 1 %} + + + {% elif care_id.rating == 0 %} + + + {% endif %} +
{% endcomment %} + {% comment %}The Tab-Menu starts here!{% endcomment %} + + {% comment %}The Tab-Menu ends here!{% endcomment %} + +
+ {% comment %} + The left-rail segment ends here! + {% endcomment %} + + + + {% comment %} + The central-rail segment starts here! + {% endcomment %} +
+ {% comment %}The ... start here!{% endcomment %} +
+ {% block lodgecomplaint %} + {% include 'complaintModule/add_workers.html' %} + {% endblock %} +
+ {% comment %}The ... end here!{% endcomment %} + + {% comment %}The ... starts here!{% endcomment %} +
+ {% block complainthistory %} + {% include 'complaintModule/complainthistory_secincharge.html' %} + {% endblock %} +
+ {% comment %}The ... ends here!{% endcomment %} + + {% comment %}The ... starts here!{% endcomment %} +
+ {% block resolvecomplaint %} + {% include 'complaintModule/resolvecomplaint_secincharge.html' %} + {% endblock %} +
+
+ {% block overduecomplaint %} + {% include 'complaintModule/overduecomplaint.html' %} + {% endblock %} +
+ {% comment %}The ... ends here!{% endcomment %} + + {% comment %}The ... starts here!{% endcomment %} + + {% comment %}The ... ends here!{% endcomment %} + +
+ {% comment %}The central-rail segment ends here!{% endcomment %} + + {% comment %}The right-rail segment starts here!{% endcomment %} +
+
+ {% block complaint_notification %} + {% include 'complaintModule/complaint_notification.html' %} + {% endblock %} +
+ +
+ {% comment %}The right-rail segment ends here!{% endcomment %} + + {% comment %}The right-margin segment!{% endcomment %} +
+ +
+ {% comment %}The grid ends here!{% endcomment %} + +{% endblock %} + +{% block javascript %} + + + + + +{% endblock %} + + + diff --git a/FusionIIIT/templates/complaintModule/complaint_caretaker_detail.html b/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html similarity index 96% rename from FusionIIIT/templates/complaintModule/complaint_caretaker_detail.html rename to FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html index 790d00b6f..cd8d75cb0 100644 --- a/FusionIIIT/templates/complaintModule/complaint_caretaker_detail.html +++ b/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html @@ -1,167 +1,167 @@ - -{% extends 'globals/base.html' %} -{% load static %} - - -{% block title %} -Complaint -{% endblock %} - - -{% block body %} -{% block navBar %} -{% include 'dashboard/navbar.html' %} -{% endblock %} - - -{% comment %}The grid starts here!{% endcomment %} -
- - {% comment %}The left-margin segment!{% endcomment %} -
- - {% comment %} - The left-rail segment starts here! - {% endcomment %} -
- - {% comment %}The user image card starts here!{% endcomment %} - {% block usercard %} - {% include 'globals/usercard.html' %} - {% endblock %} - {% comment %}The user image card ends here!{% endcomment %} - - -
- - {% comment %}The Tab-Menu starts here!{% endcomment %} - - {% comment %}The Tab-Menu ends here!{% endcomment %} - -
- {% comment %} - The left-rail segment ends here! - {% endcomment %} -
- {% comment %}The ... start here!{% endcomment %} -
- - - - -
- -
-
- {% csrf_token %} -
-

-
Complainer : - {{detail2.complainer.user.first_name}} - {{detail2.complainer.user.last_name}} -
Complainer ID : {{ detail2.complainer.id }} -
-
-

-
-

-
Complaint ID : {{ comp_id }}
- Complaint Details : {{detail2.details }}
- Worker Assigned : {{ worker_name }} -
-
- {% if num == 1 %} -
-

- -

-
- {% else%} -
-

- -

-
- {% endif %} - - -
-
- -
- - - {% if worker_name is None %} - - {% else %} - - - {% endif %} -
- -
- {% comment %}The ... end here!{% endcomment %} -
- {% comment %}The central-rail segment ends here!{% endcomment %} - - {% comment %}The right-rail segment starts here!{% endcomment %} -
-
- {% comment %} - TODO: the right rail! - {% endcomment %} -
-
- {% comment %}The right-rail segment ends here!{% endcomment %} - - {% comment %}The right-margin segment!{% endcomment %} -
- -
- {% comment %}The grid ends here!{% endcomment %} - - {% endblock %} - - {% block javascript %} - - - - - {% endblock %} - - {% block css %} - - {% endblock %} - + +{% extends 'globals/base.html' %} +{% load static %} + + +{% block title %} +Complaint +{% endblock %} + + +{% block body %} +{% block navBar %} +{% include 'dashboard/navbar.html' %} +{% endblock %} + + +{% comment %}The grid starts here!{% endcomment %} +
+ + {% comment %}The left-margin segment!{% endcomment %} +
+ + {% comment %} + The left-rail segment starts here! + {% endcomment %} +
+ + {% comment %}The user image card starts here!{% endcomment %} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} + {% comment %}The user image card ends here!{% endcomment %} + + +
+ + {% comment %}The Tab-Menu starts here!{% endcomment %} + + {% comment %}The Tab-Menu ends here!{% endcomment %} + +
+ {% comment %} + The left-rail segment ends here! + {% endcomment %} +
+ {% comment %}The ... start here!{% endcomment %} +
+ + + + +
+ +
+
+ {% csrf_token %} +
+

+
Complainer : + {{detail2.complainer.user.first_name}} + {{detail2.complainer.user.last_name}} +
Complainer ID : {{ detail2.complainer.id }} +
+
+

+
+

+
Complaint ID : {{ comp_id }}
+ Complaint Details : {{detail2.details }}
+ Worker Assigned : {{ worker_name }} +
+
+ {% if num == 1 %} +
+

+ +

+
+ {% else%} +
+

+ +

+
+ {% endif %} + + +
+
+ +
+ + + {% if worker_name is None %} + + {% else %} + + + {% endif %} +
+ +
+ {% comment %}The ... end here!{% endcomment %} +
+ {% comment %}The central-rail segment ends here!{% endcomment %} + + {% comment %}The right-rail segment starts here!{% endcomment %} +
+
+ {% comment %} + TODO: the right rail! + {% endcomment %} +
+
+ {% comment %}The right-rail segment ends here!{% endcomment %} + + {% comment %}The right-margin segment!{% endcomment %} +
+ +
+ {% comment %}The grid ends here!{% endcomment %} + + {% endblock %} + + {% block javascript %} + + + + + {% endblock %} + + {% block css %} + + {% endblock %} + diff --git a/FusionIIIT/templates/complaintModule/complainthistory_caretaker.html b/FusionIIIT/templates/complaintModule/complainthistory_caretaker.html index 74ef9798f..6d3afc30c 100644 --- a/FusionIIIT/templates/complaintModule/complainthistory_caretaker.html +++ b/FusionIIIT/templates/complaintModule/complainthistory_caretaker.html @@ -1,7 +1,7 @@ {% load static %} -{% block complainthistory %} +{% block complainthistory_caretaker.html %} {% comment %}The tab menu starts here!{% endcomment %}
@@ -162,79 +160,7 @@

-
-
-

If you think that this complaint does not belong to you .
- You a can pass this complaint to required caretaker .

-
- {% csrf_token %} -
- -
Complaint ID :{{ detail.complainer }}
-
Complainer :{{ detail.complainer.user.first_name }} - {{detail.complainer.user.last_name}} -
-
-
- -
-
- - - - -
-
- - - - -
-
- - - - -
Complaint Type: {{ detail.complaint_type }}
Location: {{ detail.location }}
Specific Location: {{ detail.specific_location }}
-
- - {% if detail.status != 0 %} - -

You have assigned a worker. First, remove the worker from this complaint then - declined this complaint. - .

- - - - {% else %} - - -

- - - - - - {% endif %} -
-
-
-
-
- - {% comment %}The ... end here!{% endcomment %} - +
diff --git a/FusionIIIT/templates/complaintModule/resolve_pending.html b/FusionIIIT/templates/complaintModule/resolve_pending.html index 71fc9ef80..57cdd816d 100644 --- a/FusionIIIT/templates/complaintModule/resolve_pending.html +++ b/FusionIIIT/templates/complaintModule/resolve_pending.html @@ -99,7 +99,7 @@
diff --git a/FusionIIIT/templates/complaintModule/resolvecomplaint_caretaker.html b/FusionIIIT/templates/complaintModule/resolvecomplaint_caretaker.html new file mode 100644 index 000000000..86dd57bc4 --- /dev/null +++ b/FusionIIIT/templates/complaintModule/resolvecomplaint_caretaker.html @@ -0,0 +1,131 @@ +{% load static %} +{% block resolvecomplaint_caretaker %} + + {% comment %}The tab menu starts here!{% endcomment %} + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + {% for a in history %} + {% if a.status == 1 %} + + + + + + + + + + + + + + + {% endif %} + {% endfor %} +
+ Student + + Date + + Type + + Location + + Details + + Worker
Name
+
+ change status +
+

+ +
+ {{ a.complainer.user }} +
+
+
+

+
+ {{ a.complaint_date }} + + {{ a.complaint_type }} + + {{ a.specific_location }},  + {{ a.location }} + + + + + {{ a.worker_id }} + +
+
+ + + +
+
+
+ +
+
+ + + +
+
+ : These Complaints have been ASSIGNED to Workers! Please Change their status as soon as they are Resolved !       + +
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/complaintModule/resolvecomplaint.html b/FusionIIIT/templates/complaintModule/resolvecomplaint_secincharge.html similarity index 51% rename from FusionIIIT/templates/complaintModule/resolvecomplaint.html rename to FusionIIIT/templates/complaintModule/resolvecomplaint_secincharge.html index a2d48ec12..105e7581d 100644 --- a/FusionIIIT/templates/complaintModule/resolvecomplaint.html +++ b/FusionIIIT/templates/complaintModule/resolvecomplaint_secincharge.html @@ -1,5 +1,5 @@ {% load static %} -{% block resolvecomplaint %} +{% block resolvecomplaint_secincharge %} {% comment %}The tab menu starts here!{% endcomment %} @@ -133,132 +131,4 @@

- - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - {% for a in history %} - {% if a.status == 1 %} - - - - - - - - - - - - - - - {% endif %} - {% endfor %} -
- Student - - Date - - Type - - Location - - Details - - Worker
Name
-
- change status -
-

- -
- {{ a.complainer.user }} -
-
-
-

-
- {{ a.complaint_date }} - - {{ a.complaint_type }} - - {{ a.specific_location }},  - {{ a.location }} - - - - - {{ a.worker_id }} - -
-
- - - -
-
-
- -
-
- - - -
-
- : These Complaints have been ASSIGNED to Workers! Please Change their status as soon as they are Resolved !       - -
-
-
-
- {% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/complaintModule/worker_id_know_more.html b/FusionIIIT/templates/complaintModule/worker_id_know_more.html index 8d1f2d801..fae142121 100644 --- a/FusionIIIT/templates/complaintModule/worker_id_know_more.html +++ b/FusionIIIT/templates/complaintModule/worker_id_know_more.html @@ -72,7 +72,7 @@
-

{{this_worker.name}} works under {{work_under_caretaker1}} {{work_under_caretaker2}}




+

{{this_worker.name}} works under {{work_under_secincharge1}} {{work_under_secincharge2}}




{%if numpend == 0 %}

The Worker does not hold any pending complaints.

From 59c4aa0b7a8bc64c3a2cb32f263d4a44e5d4bfcb Mon Sep 17 00:00:00 2001 From: ujjawallele13 <111732396+ujjawallele13@users.noreply.github.com> Date: Sun, 5 Mar 2023 20:34:09 +0530 Subject: [PATCH 2/6] Update FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com> --- .../complaint_secincharge_detail.html | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html b/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html index cd8d75cb0..0ae4e2ca2 100644 --- a/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html +++ b/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html @@ -43,19 +43,7 @@ - +
{% comment %}The Tab-Menu ends here!{% endcomment %} From 8ad2aa75e5067105fdd00f9232880c12d4e3e3e2 Mon Sep 17 00:00:00 2001 From: ujjawallele13 <111732396+ujjawallele13@users.noreply.github.com> Date: Sun, 5 Mar 2023 20:37:15 +0530 Subject: [PATCH 3/6] Update FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com> --- .../complaintModule/complaint_secincharge_detail.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html b/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html index 0ae4e2ca2..9a8a24262 100644 --- a/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html +++ b/FusionIIIT/templates/complaintModule/complaint_secincharge_detail.html @@ -65,11 +65,7 @@
- +
{% csrf_token %} From 07c01b140ba53256a0850939dd924d99fc2b1a8f Mon Sep 17 00:00:00 2001 From: ujjawallele13 <111732396+ujjawallele13@users.noreply.github.com> Date: Sun, 5 Mar 2023 20:37:27 +0530 Subject: [PATCH 4/6] Update FusionIIIT/templates/complaintModule/complainthistory_secincharge.html Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com> --- .../complaintModule/complainthistory_secincharge.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/FusionIIIT/templates/complaintModule/complainthistory_secincharge.html b/FusionIIIT/templates/complaintModule/complainthistory_secincharge.html index 5cf2903b1..6369ade43 100644 --- a/FusionIIIT/templates/complaintModule/complainthistory_secincharge.html +++ b/FusionIIIT/templates/complaintModule/complainthistory_secincharge.html @@ -49,9 +49,6 @@ Location - Details From 775fee2521a9f6f27c4afcd68b053bb3ee854474 Mon Sep 17 00:00:00 2001 From: ujjawallele13 <111732396+ujjawallele13@users.noreply.github.com> Date: Sun, 5 Mar 2023 20:37:38 +0530 Subject: [PATCH 5/6] Update FusionIIIT/templates/complaintModule/complainthistory_secincharge.html Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com> --- .../complaintModule/complainthistory_secincharge.html | 9 --------- 1 file changed, 9 deletions(-) diff --git a/FusionIIIT/templates/complaintModule/complainthistory_secincharge.html b/FusionIIIT/templates/complaintModule/complainthistory_secincharge.html index 6369ade43..76a6f6b4d 100644 --- a/FusionIIIT/templates/complaintModule/complainthistory_secincharge.html +++ b/FusionIIIT/templates/complaintModule/complainthistory_secincharge.html @@ -145,13 +145,4 @@

- - - - - - - - - {% endblock %} \ No newline at end of file From 9efb0924f928cb2310fe19d629ee54895689db0b Mon Sep 17 00:00:00 2001 From: ujjawallele13 <111732396+ujjawallele13@users.noreply.github.com> Date: Sun, 5 Mar 2023 20:37:49 +0530 Subject: [PATCH 6/6] Update FusionIIIT/templates/complaintModule/resolvecomplaint_caretaker.html Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com> --- .../templates/complaintModule/resolvecomplaint_caretaker.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/FusionIIIT/templates/complaintModule/resolvecomplaint_caretaker.html b/FusionIIIT/templates/complaintModule/resolvecomplaint_caretaker.html index 86dd57bc4..853759ffe 100644 --- a/FusionIIIT/templates/complaintModule/resolvecomplaint_caretaker.html +++ b/FusionIIIT/templates/complaintModule/resolvecomplaint_caretaker.html @@ -3,9 +3,6 @@ {% comment %}The tab menu starts here!{% endcomment %}