Ejemplo n.º 1
0
    def get(self, *args, **kargs):

        #if check_permission(self):
        projectKey = self.session['current_project']
        sprints = sprint.Sprint().get_by_project(projectKey)
        currentUser = self.auth.get_user_by_session()
        currentUser = self.user_model.get_by_id(currentUser['user_id']).key
        if (self.request.get("sprint_id") != ''):
            logging.info("The sprintid is" + self.request.get("sprint_id"))
            estimates = effort_estimation.EffortEstimation(
            ).get_esti_by_sprint(
                ndb.Key('Sprint', int(self.request.get("sprint_id"))))
        else:
            if not sprints:
                estimates = None
            else:
                estimates = effort_estimation.EffortEstimation(
                ).get_esti_by_sprint(sprints[0].key)
    # projectKey = estimates[0].project
        projectmembermodel = project.ProjectMembers()
        projmem = projectmembermodel.get_all(projectKey)
        self.render_template("user_new/apm-effort-estimation.html", {
            "sprint": sprints,
            "efforestimate": estimates,
            "users": projmem
        })
    def post(self, *args, **kargs):
        #        logging.info("it is here "+self.request.__str__())
        #        projid = self.request.get("id")
        #        proj = project.Project()
        #
        #        proj.delete_entity(projid)
        #        self.response.write("success")

        key = ndb.Key(urlsafe=self.request.get('delete_key'))

        project_key = key.get()
        user_info = self.auth.get_user_by_session()
        project_key.modified_by = user_info['email_address']
        project_key.modified_date = datetime.now()
        project_key.status = False
        project_key.put()

        projmem = project.ProjectMembers().get_all(key)

        for mem in projmem:
            mem.modified_by = user_info['email_address']
            mem.modified_date = datetime.now()
            mem.status = False
            mem.put()
        #user_key.delete()
        self.response.write("true")
Ejemplo n.º 3
0
    def get(self, *args, **kargs):
        # if check_permission(self):
        projectKey = self.session['current_project']
        currentUser = self.auth.get_user_by_session()
        currentUser = self.user_model.get_by_id(currentUser['user_id']).key
        project_member = project.ProjectMembers().get_by_project_user(
            projectKey, currentUser)
        tasks = task.Task().get_by_project_user(projectKey, project_member[0])

        open_count = 0
        inprogress_count = 0
        completed_count = 0
        for i in tasks:
            if i.task_status == 'Open':
                open_count = open_count + 1
            if i.task_status == 'In Progress':
                inprogress_count = inprogress_count + 1
            if i.task_status == 'Done':
                completed_count = completed_count + 1

        self.render_template(
            "user_new/test.html", {
                "tasks": tasks,
                "open_count": open_count,
                "inprogress_count": inprogress_count,
                "completed_count": completed_count
            })
    def get(self, *args, **kargs):
        key = ndb.Key(urlsafe=self.request.get('edit_key'))
        backlog_info = key.get()
        #  logging.info(backlog_info)
        sprint_obj = sprint.Sprint()
        sprints = sprint_obj.get_by_project(self.session['current_project'])

        projmodel = project.Project()
        proj = projmodel.get_all()

        key = self.session['current_project']
        team = project.ProjectMembers().get_all(key)

        u = user.OurUser()
        user1 = u.query(
            user.OurUser.tenant_domain == kargs['subdomain']).fetch()

        self.render_template(
            "user_new/edit_backlog.html", {
                "user_data": user1,
                "team": team,
                "backlog_info": backlog_info,
                "project": proj,
                "sprint": sprints
            })
    def get(self, *args, **kargs):
        #if check_permission(self):
        productBacklog = product_backlog.ProductUserStory()
        productBacklog = productBacklog.get_all_by_project(
            self.session['current_project'])

        list = []

        for pb in productBacklog:
            data = {}
            data['key'] = pb.key.id()
            data['sprintId'] = pb.sprintId
            data['storyDesc'] = pb.storyDesc
            data['roughEstimate'] = pb.roughEstimate
            data['priority'] = pb.priority
            data['status'] = pb.status
            list.append(data)

        #self.response.headers['Content-Type'] = 'text/plain'

        #self.response.write(json.dumps(list, ensure_ascii=False))

        type_obj = task.Type()
        type = type_obj.get_all()

        projmodel = project.Project()
        proj = projmodel.get_all()

        company_name = kargs['subdomain']

        sprint_obj = sprint.Sprint()
        sprints = sprint_obj.get_by_project(self.session['current_project'])

        key = self.session['current_project']
        team = project.ProjectMembers().get_all(key)

        u = user.OurUser()
        user1 = u.query(
            user.OurUser.tenant_domain == kargs['subdomain']).fetch()

        release = project.ProjectRelease()
        releases = release.get_by_project(self.session['current_project'])

        self.render_template(
            "user_new/apm-backlog-new.html", {
                "user_data": user1,
                "team": team,
                "productBacklog": productBacklog,
                "type": type,
                "project": proj,
                "sprint": sprints,
                "company_name": company_name,
                "release": releases
            })
Ejemplo n.º 6
0
 def get(self, *args, **kargs):
     projectKey = self.session['current_project']
     currentUser = self.auth.get_user_by_session()
     currentUser = self.user_model.get_by_id(currentUser['user_id']).key
     project_member = project.ProjectMembers().get_by_project_user(
         projectKey, currentUser)
     logging.info(projectKey)
     logging.info(project_member)
     tasks = task.Task().get_by_project_user(projectKey, currentUser)
     logging.info('da.das.dasd')
     logging.info(tasks)
     self.render_template("user_new/my_tasks.html", {"tasks": tasks})
 def get(self, *args, **kargs):
     key = ndb.Key(urlsafe=self.request.get('update_key'))
     backlog_info = key.get()
     u = user.OurUser()
     user1 = u.query(
         user.OurUser.tenant_domain == kargs['subdomain']).fetch()
     key = self.session['current_project']
     team = project.ProjectMembers().get_all(key)
     self.render_template("user_new/update_userstory.html", {
         "backlog_info": backlog_info,
         "user_data": user1,
         "team": team
     })
    def post(self, *args, **kargs):
        currentUser = self.auth.get_user_by_session()
        logging.info("it is here " + self.request.__str__())
        userid = self.request.get("userid")
        projid = self.request.get("projid")
        roleid = self.request.get("role")
        logging.info("it is here and the userId is" + userid)
        logging.info("it is here and the projid is" + projid)
        logging.info("it is here and the role is" + roleid)

        companyId = self.user_model.get_by_id(
            currentUser['user_id']).tenant_key

        projemem = project.ProjectMembers()
        userkey = ndb.Key('OurUser', int(userid))
        model = userkey.get()
        projemem.userName = model.name
        projemem.projectid = ndb.Key('Project', int(projid))
        projemem.companyid = companyId
        projemem.userid = userkey
        projemem.roleid = ndb.Key('Groups', int(roleid))
        projemem.userRole = ndb.Key('Groups', int(roleid)).get().role

        user_info = self.auth.get_user_by_session()
        projemem.created_by = user_info['email_address']
        projemem.status = True

        projekey = projemem.set()
        projmodel = projekey.get()

        sprints = sprint.Sprint().get_by_project(projmodel.projectid)
        logging.info
        if not sprints:
            logging.info("No sprints")
        else:
            task = taskqueue.add(queue_name="my-push-queue",
                                 url='/newusereffortspersist',
                                 params={
                                     'projectid': projmodel.projectid.id(),
                                     'userid': projmodel.userid.id()
                                 })

        data = {}
        data['id'] = projmodel.key.id()
        data['projectid'] = projmodel.projectid.id()
        data['companyid'] = projmodel.companyid.id()
        data['userName'] = (projmodel.userid).get().name
        data['userid'] = projmodel.userid.id()
        data['userRole'] = projmodel.userRole

        self.response.write(json.dumps(data, ensure_ascii=False))
Ejemplo n.º 9
0
    def get(self, *args, **kargs):
        #if check_permission(self):
        key = self.session['current_project']
        type_data = task.Type().get_all()
        team = project.ProjectMembers().get_all(key)
        complexity = project.Estimation().get_all(key)
        logging.info(complexity)
        sprints = sprint.Sprint().get_by_project(key)

        self.render_template(
            "user_new/addtask.html", {
                "type": type_data,
                "team": team,
                "complex": complexity,
                'sprints': sprints
            })
Ejemplo n.º 10
0
    def post(self):

        logging.info("The sprintid is" + self.request.get("sprintid"))
        sprintKey = ndb.Key('Sprint', int(self.request.get("sprintid")))
        sprint = sprintKey.get()
        createdBy = self.request.get("createdBy")
        start_date = sprint.startDate
        end_date = sprint.endDate
        working_hours = sprint.workinghours
        logging.info("the working hours" + working_hours)
        projectKey = sprint.project

        projectmembermodel = project.ProjectMembers()
        projmem = projectmembermodel.get_all(projectKey)

        total = 0

        estlist = []

        for mem in projmem:
            usereffort = effort_estimation.UserEffort()
            usereffort.userKey = mem.userid
            usereffort.userName = mem.userName
            usereffort.effortHours = working_hours
            total = total + float(working_hours)
            estlist.append(usereffort)

        logging.info(estlist)

        datelist = []
        d1 = start_date
        d2 = end_date

        delta = d2 - d1

        for i in range(delta.days + 1):
            estimationmodel = effort_estimation.EffortEstimation()
            estimationmodel.project = projectKey
            estimationmodel.sprint = sprintKey
            estimationmodel.effort = estlist
            estimationmodel.date = d1 + td(days=i)
            estimationmodel.createdby = createdBy
            estimationmodel.total_effort = str(total)
            estimationmodel.set()

        logging.info(datelist)
Ejemplo n.º 11
0
 def get(self, *args, **kargs):
     #if check_permission(self):
     edit_key = ndb.Key(urlsafe=self.request.get('edit_key'))
     task_data = edit_key.get()
     key = self.session['current_project']
     type_data = task.Type().get_all()
     team = project.ProjectMembers().get_all(key)
     complexity = project.Estimation().get_all(key)
     sprints = sprint.Sprint().get_by_project(key)
     self.render_template(
         "user_new/edittask.html", {
             "type": type_data,
             "team": team,
             "complex": complexity,
             'sprints': sprints,
             'task_data': task_data
         })
    def get(self, *args, **kargs):
        currentUser = self.auth.get_user_by_session()
        logging.info("it is here proj " + self.request.get("proj_id"))
        projkey = int(self.request.get("proj_id"))
        projmodel = project.Project()
        proj = projmodel.get_proj(projkey)

        #proj.startDate = proj.startDate.strftime('%d/%m/%Y')
        #proj.endDate =   proj.endDate.strftime('%d/%m/%Y')
        logging.info("it is here proj " + proj.__str__())

        estimationmodel = project.Estimation()
        esti = estimationmodel.get_all(ndb.Key('Project', projkey))

        projectmembermodel = project.ProjectMembers()
        projmem = projectmembermodel.get_active(ndb.Key('Project', projkey))

        groupmodel = user.Groups().query(
            ndb.AND(
                user.Groups.tenant_key == self.user_model.get_by_id(
                    currentUser['user_id']).tenant_key,
                user.Groups.application_level == False,
                user.Groups.status == True)).fetch()
        groupmodel1 = user.Groups().query(
            ndb.AND(user.Groups.tenant_key == None,
                    user.Groups.application_level == False,
                    user.Groups.status == True)).fetch()
        groupmodel.extend(groupmodel1)
        currentUser = self.auth.get_user_by_session()
        usermodel = user.OurUser().query(
            ndb.AND(
                user.OurUser.tenant_key == self.user_model.get_by_id(
                    currentUser['user_id']).tenant_key,
                user.OurUser.status == True)).fetch()
        for usr in usermodel:
            for mem in projmem:
                if (usr.key == mem.userid):
                    usermodel.remove(usr)
        self.render_template(
            "user_new/viewproject.html", {
                "project": proj,
                "userslist": usermodel,
                'estimation': esti,
                'projmem': projmem,
                'roles': groupmodel
            })
    def get(self, *args, **kargs):
        #if check_permission(self):
        projmodel = project.Project()
        projmemmodel = project.ProjectMembers()
        currentUser = self.auth.get_user_by_session()
        #proj=projmodel.get_proj_by_user(self.user_model.get_by_id(currentUser['user_id']).tenant_key)
        projformem = projmemmodel.get_proj_by_user(
            self.user_model.get_by_id(currentUser['user_id']).tenant_key,
            self.user_model.get_by_id(currentUser['user_id']).key)
        keys = []
        for promem in projformem:
            keys.append(promem.projectid)

        proj = ndb.get_multi(keys)

        #usermodel = user.OurUser().query(user.OurUser.tenant_key==self.user_model.get_by_id(currentUser['user_id']).tenant_key)
        self.render_template("user_new/apm-all-projects.html",
                             {"project": proj})
Ejemplo n.º 14
0
 def get(self,*args,**kargs):
     if check_permission(self):
         currentUser=self.auth.get_user_by_session()
         comp_key =  self.user_model.get_by_id(currentUser['user_id']).tenant_key
         currentUser=self.user_model.get_by_id(currentUser['user_id']).key
         
         if not self.session.has_key('current_project'):
             
             projects= model.project.ProjectMembers().get_proj_by_user(comp_key,currentUser)
             if not projects:
                 
                 self.session['current_project']= None
             else:
                 self.session['current_project']=projects[0].projectid
                 
             projectKey=self.session['current_project']
             
         else:
             projectKey=self.session['current_project']
         #currentUser=self.auth.get_user_by_session()
         #currentUser=self.user_model.get_by_id(currentUser['user_id']).key
         if(projectKey != None):
             project_member=project.ProjectMembers().get_by_project_user(projectKey,currentUser)
             tasks=task.Task().get_by_project_user(projectKey,currentUser)
             
             open_count=0
             inprogress_count =0
             completed_count=0
             for i in tasks:
                 if i.task_status == 'Open':
                     open_count=open_count+1
                 if i.task_status == 'In Progress':
                     inprogress_count=inprogress_count+1
                 if i.task_status == 'Done':
                     completed_count=completed_count+1   
             self.render_template("user_new/apm-user-dashboard.html",{"tasks":tasks,"open_count":open_count,"inprogress_count":inprogress_count,"completed_count":completed_count})
         else:
             
             self.render_template("user_new/apm-user-dashboard.html",{"tasks":None,"open_count":0,"inprogress_count":0,"completed_count":0})
     else:
         self.response.write("you are not allowed")
    def post(self, *args, **kargs):
        logging.info("it is here " + self.request.__str__())
        currentUser = self.auth.get_user_by_session()
        companyId = self.user_model.get_by_id(
            currentUser['user_id']).tenant_key
        logging.info(currentUser)
        logging.info(companyId)
        logging.info(self.request.get("proj_start"))
        projec = project.Project()
        projec.companyid = companyId
        projec.name = self.request.get("proj_name")
        projec.description = self.request.get("proj_desc")
        projec.startDate = datetime.strptime(self.request.get("proj_start"),
                                             '%m/%d/%Y').date()
        projec.endDate = datetime.strptime(self.request.get("proj_end"),
                                           '%m/%d/%Y').date()

        projec.created_by = currentUser['email_address']
        projec.status = True
        #projec.team = (self.request.get("proj_team")).split(",")
        projkey = projec.set()
        #logging.info(projkey)
        estimation = project.Estimation()
        estimation.projectid = projkey
        estimation.companyid = companyId
        estimation.estimationLevel = "Very Simple"
        estimation.estimationPoint = 1
        estimation.estimationHours = 1.0
        estimation.created_by = currentUser['email_address']
        estimation.status = True
        estimation.set()

        estimation = project.Estimation()
        estimation.projectid = projkey
        estimation.companyid = companyId
        estimation.estimationLevel = "Simple"
        estimation.estimationPoint = 1
        estimation.estimationHours = 1.0
        estimation.created_by = currentUser['email_address']
        estimation.status = True
        estimation.set()

        estimation = project.Estimation()
        estimation.projectid = projkey
        estimation.companyid = companyId
        estimation.estimationLevel = "Medium"
        estimation.estimationPoint = 1
        estimation.estimationHours = 1.0
        estimation.created_by = currentUser['email_address']
        estimation.status = True
        estimation.set()

        estimation = project.Estimation()
        estimation.projectid = projkey
        estimation.companyid = companyId
        estimation.estimationLevel = "Complex"
        estimation.estimationPoint = 1
        estimation.estimationHours = 1.0
        estimation.created_by = currentUser['email_address']
        estimation.status = True
        estimation.set()

        estimation = project.Estimation()
        estimation.projectid = projkey
        estimation.companyid = companyId
        estimation.estimationLevel = "Very Complex"
        estimation.estimationPoint = 1
        estimation.estimationHours = 1.0
        estimation.created_by = currentUser['email_address']
        estimation.status = True
        estimation.set()

        projemem = project.ProjectMembers()
        projemem.userName = self.user_model.get_by_id(
            currentUser['user_id']).name
        projemem.projectid = projkey
        projemem.companyid = companyId
        projemem.userid = self.user_model.get_by_id(currentUser['user_id']).key
        group = user.Groups()
        groupmodel = group.get_default_role()
        for g in groupmodel:
            projemem.userRole = g.role
            projemem.roleid = g.key
        projemem.created_by = currentUser['email_address']
        projemem.status = True
        projemem.set()

        self.response.write(projkey.id())