Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ FusionIIIT/Fusion/settings.py

# dbinsertscripts
FusionIIIT/dbinsertscripts

FusionIIIT/Fusion/fusion.db
Binary file removed FusionIIIT/Fusion/fusion.db
Binary file not shown.
2 changes: 1 addition & 1 deletion FusionIIIT/applications/eis/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def profile(request):
flag_rspc = 0
for i in a1:
print(i.designation)
if(str(i.designation)=='Dean (RSPC)'):
if(str(i.designation)=='Dean (R&D)'):
flag_rspc = 1
print(flag_rspc)
# done edit
Expand Down
2 changes: 1 addition & 1 deletion FusionIIIT/applications/office_module/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib import admin

from .models import *

admin.site.register(Project_Registration)
admin.site.register(Requisitions)
admin.site.register(Filemovement)
admin.site.register(stock)
Expand Down
3 changes: 2 additions & 1 deletion FusionIIIT/applications/office_module/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class Project_Registration(models.Model):
sponsored_agency = models.CharField(max_length=100)
CO_PI = models.CharField(max_length=100 ,null=True)
start_date = models.DateField(null=True,blank=True)

duration = models.CharField(default='0', max_length=100)
agreement = models.CharField(choices=Constants.TICK_TYPE,
max_length=10, default='NO')
Expand All @@ -200,7 +201,7 @@ class Project_Registration(models.Model):
max_length=10, default='Pending')
applied_date=models.DateField(null=True,blank=True)
description=models.CharField(max_length=200,null=True)

file = models.FileField(null=True, upload_to='documents/')

def __str__(self):
return self.project_title
Expand Down
2 changes: 1 addition & 1 deletion FusionIIIT/applications/office_module/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
url(r'^officeOfDeanRSPC/extention/$',views.project_extension,name='p_extension'),
url(r'^officeOfDeanRSPC/close/$',views.project_closure,name='p_closure'),
url(r'^officeOfDeanRSPC/reallocate/$',views.project_reallocation,name='p_reallocation'),
url(r'^officeOfDeanRSPC/action/$',views.project_registration_permission,name='registration'),
url(r'^officeOfDeanRSPC/action/$',views.project_registration_permission, name='registration'),
url(r'^officeOfDeanRSPC/extension/$',views.project_extension_permission,name='extension'),
url(r'^officeOfDeanRSPC/closure/$',views.project_closure_permission,name='closure'),
url(r'^officeOfDeanRSPC/reallocation/$',views.project_reallocation_permission,name='reallocation'),
Expand Down
112 changes: 75 additions & 37 deletions FusionIIIT/applications/office_module/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import datetime
from datetime import date, datetime
from datetime import date, datetime, timedelta

from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
Expand All @@ -12,27 +12,30 @@
from applications.globals.models import (Designation, ExtraInfo,
HoldsDesignation, User)
from applications.scholarships.models import Mcm

from applications.eis.models import emp_research_projects, emp_patents, emp_consultancy_projects
from .forms import *
from .models import *
from .models import (Project_Closure, Project_Extension, Project_Reallocation,
Project_Registration)
from .views_office_students import *


@login_required
def officeOfDeanRSPC(request):
project=Project_Registration.objects.all()
project1=Project_Extension.objects.all()
project2=Project_Closure.objects.all()
project3=Project_Reallocation.objects.all()
projects = emp_research_projects.objects.all().order_by('-start_date')
consultancy = emp_consultancy_projects.objects.all().order_by('-start_date')
patents = emp_patents.objects.all().order_by('-p_year', '-a_month')
project = Project_Registration.objects.all()
project1 = Project_Extension.objects.all()
project2 = Project_Closure.objects.all()
project3 = Project_Reallocation.objects.all()

design = HoldsDesignation.objects.filter(working=request.user)
print(design)
desig=[]
for i in design:
desig.append(str(i.designation))

context = {'project':project, 'project1':project1, 'project2':project2, 'project3':project3, 'desig':desig}
context = {'projects': projects, 'consultancy': consultancy, 'patents': patents, 'project': project, 'project1': project1, 'project2': project2, 'project3': project3, 'desig': desig}

return render(request, "officeModule/officeOfDeanRSPC/officeOfDeanRSPC.html", context)

Expand Down Expand Up @@ -272,69 +275,104 @@ def project_register(request):
CO_PI = request.POST.get('copi_name')
# start_date = datetime.strptime(request.POST.get('start_date'), "%Y-%m-%d")
start_date = request.POST.get('start_date')

duration = request.POST.get('duration')
#duration = datetime.timedelta('duration')
agreement=request.POST.get('agreement')
amount_sanctioned = request.POST.get('amount_sanctioned')
project_type = request.POST.get('project_type')
remarks=request.POST.get('remarks')
#remarks=request.POST.get('remarks')
#fund_recieved_date=datetime.strptime(request.POST.get('fund_recieved_date'), "%Y-%m-%d")
project_operated = request.POST.get('project_operated')
fund_recieved_date = request.POST.get('fund_recieved_date')
file = request.FILES['load']
description = request.POST.get('remarks')

request_obj = Project_Registration(PI_id=extrainfo, project_title=project_title,
sponsored_agency=sponsored_agency, CO_PI=CO_PI, agreement=agreement,
amount_sanctioned=amount_sanctioned, project_type=project_type,
remarks=remarks,duration=duration,fund_recieved_date=fund_recieved_date,start_date=start_date)
duration=duration,fund_recieved_date=fund_recieved_date,start_date=start_date, description=description, file=file)
request_obj.save()
context={}
return render(request,"eisModulenew/profile.html",context)

# Project Registration Table End.................................................................................

def project_registration_permission(request):

if 'approve' in request.POST:
id=request.POST.get('id')
obj=Project_Registration.objects.get(pk=id)
if obj.DRSPC_response == 'Pending':
obj.DRSPC_response='Approve'
obj.save()
elif 'forward' in request.POST:
id=request.POST.get('id')
obj=Project_Registration.objects.get(pk=id)
if obj.DRSPC_response == 'Pending':
obj.DRSPC_response='Forward'
obj.save()
elif 'reject' in request.POST:
id=request.POST.get('id')
obj=Project_Registration.objects.get(pk=id)
print(obj.DRSPC_response)
if obj.DRSPC_response == 'Pending':
obj.DRSPC_response='Disapprove'
obj.save()
id_list=request.POST.getlist('id[]')
for id in id_list:
obj=Project_Registration.objects.get(pk=id)
if "Pending" in obj.DRSPC_response or "Disapprove" in obj.DRSPC_response:


#approved project should be registered in project displayed to dean rspc
pf_no=obj.PI_id.id
pi = obj.PI_id.user.first_name + " " + obj.PI_id.user.last_name
co_pi = obj.CO_PI
title = obj.project_title
funding_agency = obj.sponsored_agency
start_date = obj.start_date
days = int(obj.duration)*7
finish_date = start_date + timedelta(days=days)
financial_outlay = obj.amount_sanctioned
ptype = obj.project_type
print(ptype)
date_entry = obj.applied_date
status="Ongoing"
if ptype == "sponsoered research":
emp_projects = emp_research_projects(pi=pi, co_pi=co_pi, title=title, funding_agency=funding_agency,
start_date=start_date, finish_date=finish_date, date_entry=date_entry,
financial_outlay=financial_outlay, status=status, pf_no=pf_no, ptype=ptype)
emp_projects.save()
elif ptype == "consultancy":
emp_projects = emp_consultancy_projects(consultants=pi, title=title, client=funding_agency,
start_date=start_date, end_date=finish_date,
duration=obj.duration + " " + "weeks", financial_outlay=financial_outlay,
pf_no=pf_no, date_entry=date_entry)
emp_projects.save()
obj.DRSPC_response = "Approve"
obj.save()

elif "forward" in request.POST:
id_list = request.POST.getlist('id[]')
for id in id_list:
obj=Project_Registration.objects.get(pk=id)
if obj.DRSPC_response == 'Pending':
obj.DRSPC_response="Forward"
obj.save()
elif "reject" in request.POST:
id_list = request.POST.getlist('id[]')
for id in id_list:
obj=Project_Registration.objects.get(pk=id)
#print(obj.DRSPC_response)
if obj.DRSPC_response == 'Pending':
obj.DRSPC_response="Disapprove"
obj.save()
return HttpResponseRedirect('/office/officeOfDeanRSPC/')


def project_extension_permission(request):
if 'approve' in request.POST:
id=request.POST.get('id')
obj=Project_Extension.objects.get(pk=id)
if obj.DRSPC_response == 'Pending':
obj.DRSPC_response='Approve'
obj.save()
#if obj.DRSPC_response == 'Pending':
obj.DRSPC_response='Approve'
obj.save()
elif 'forward' in request.POST:
id=request.POST.get('id')
obj=Project_Extension.objects.get(pk=id)
if obj.DRSPC_response == 'Pending':
obj.DRSPC_response='Forward'
obj.save()
#if obj.DRSPC_response == 'Pending':
obj.DRSPC_response='Forward'
obj.save()
elif 'reject' in request.POST:
id=request.POST.get('id')
obj=Project_Extension.objects.get(pk=id)
print(obj.DRSPC_response)
if obj.DRSPC_response == 'Pending':
obj.DRSPC_response='Disapprove'
obj.save()
#if obj.DRSPC_response == 'Pending':
obj.DRSPC_response='Disapprove'
obj.save()
return HttpResponseRedirect('/office/officeOfDeanRSPC/')


Expand Down
5 changes: 3 additions & 2 deletions FusionIIIT/templates/dashboard/sidenavbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@ <h4> File Tracking </h4>
<i class="large inverted briefcase icon right floated"></i>
</a>
{% comment %}The email Item ends here!{% endcomment %}
{% if "Dean (RSPC)" in desig %}

{% comment %}if "Dean (RSPC)" in desig{% endcomment %}
{% comment %}The Profile Item starts here!{% endcomment %}
<a class="centered raised item" href="{% url 'office:officeOfDeanRSPC'%}">
<span class="inverted header">Office Of Dean RSPC</span>
<i class="large inverted briefcase icon right floated"></i>
</a>
{% comment %}endif {% endcomment %}

{% endif %}
<a class="centered raised item" href="{% url 'office:officeOfDeanAcademics'%}">
<span class="inverted header">Office Of Dean Academics</span>
<i class="large inverted briefcase icon right floated"></i>
Expand Down
3 changes: 2 additions & 1 deletion FusionIIIT/templates/eisModulenew/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@
</div>
{% comment %}The others ends here!{% endcomment %}

{% comment %}The Thesis Supervision starts here!{% endcomment %}

{% comment %}The Project management form starts here!{% endcomment %}
<div class="ui tab segment" data-tab="ninth">
<!-- <div class="ui active tab segment" data-tab="first"> -->
{% block form1 %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
Project Registration
</a>

<a class="active item" data-tab="tab3content2">
<a class="item" data-tab="tab3content2">
Project Closure
</a>


<a class="active item" data-tab="tab3content3">
<a class="item" data-tab="tab3content3">
Project Extension
</a>

<a class="active item" data-tab="tab3content4">
<a class="item" data-tab="tab3content4">
Fund Allocation
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% load static %}

<form action="{% url 'office:registration' %}" method="POST" id="application">{% csrf_token %}</form>

<table class="ui very basic collapsing celled sortable table"
style="padding-left: 2.5%;
padding-right: 2.5%;
Expand All @@ -9,6 +11,7 @@
<thead>
<tr>
<th class="one wide column">

</th>

<th class="one wide column">
Expand All @@ -31,51 +34,59 @@
Date
</th>
<th class="four wide column">
view Details
View Details
</th>
</tr>
</thead>

<tbody>
<form action="{% url 'office:registration' %}" method="POST">
{% csrf_token %}
{% for pr in project %}
{% if pr.HOD_response == 'Forwarded'%}
<tr>


{% for pr in project %}

{% comment %}if pr.HOD_response == 'Forwarded' {% endcomment %}
<tr>
<td class="collapsing">
<div class="ui fitted checkbox">
<input type="checkbox" value={{pr.id}} name="id"> <label></label>
</div>
{% if "Dean (R&D)" in desig %}
<input type="checkbox" form="application" value={{pr.id}} name="id[]">
{% endif %}
</td>

<td>
{{pr.PI_id}}
<td class="one wide column">
{{pr.PI_id.user.first_name}} {{pr.PI_id.user.last_name}}
</td>

<td>
<td class="one wide column">
{{pr.project_title}}
</td>

<td>
<td class="four wide column">
{{pr.project_type}}
</td>

<td>
<i class="large red crossmark icon">{{pr.DRSPC_response}}</i>
<td class="four wide column">
{% if pr.DRSPC_response == "Approve" %}
<i class="large green checkmark icon">{{pr.DRSPC_response}}</i>
{% elif pr.DRSPC_response == "Pending" %}
<i class="large orange warning icon">{{pr.DRSPC_response}}</i>
{% elif pr.DRSPC_response == "Disapprove" %}
<i class="large red x icon">{{pr.DRSPC_response}}</i>
{% elif pr.DRSPC_response == "Forward" %}
<i class="large orange warning icon">{{pr.DRSPC_response}}</i>
{% endif %}
</td>

<td>
<td class="four wide column">

{{pr.start_date}}

</td>
<td>
<td class="four wide column">
<a href="/office/officeOfDeanRSPC/{{pr.id}}/" target="_blank">Details</a>
</td>

</tr>
{% endif %}
{% comment %} endif {% endcomment %}

{% endfor%}

Expand Down Expand Up @@ -123,21 +134,20 @@
</tbody>
</table>


<br>

<!-- <div class="ui primary right floated button"><a href="" target="_blank" style="color:white;">View Details</a></div> -->
<!-- <a href="/officeOfDeanRSPC/app/"><div class="ui primary right floated button">Approve Selected</div></a> -->
{% if "Dean (RSPC)" in desig %}<button class="ui primary right floated button" type="submit" name="approve" value="approve">Approve</button>
<button class="ui primary right floated button" type="submit" name="reject" value="reject">Reject</button>
{% if "Dean (R&D)" in desig %}<button class="ui primary right floated button" type="submit" form="application" name="approve" value="approve" >Approve</button>
<button class="ui primary right floated button" type="submit" form="application" name="reject" value="reject">Reject</button>
<button class="ui primary right floated button" type="submit" form="application" name="forward" value="approve" >Forward</button>
<!-- <button class="ui primary right floated button" type="submit" name="forward" value="forward">Forward Selected</button>
-->{% endif %}

<!-- {% if request.user.extrainfo.designation.name == 'DeanRSPC'%}
<button class="ui primary right floated button" type="submit" name="hodforward" value="hodforward">Forward Selected</button>
{% endif %} -->

</form>
<br>
<br>
<div class="ui divider"></div>
Expand Down
Loading