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
            })
コード例 #3
0
    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
            })
コード例 #4
0
    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})
コード例 #5
0
    def get(self, *args, **kargs):
        if check_permission(self):
            projmodel = project.Project()
            proj = projmodel.get_all()
            currentUser = self.auth.get_user_by_session()
            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-add-project.html", {
                "project": proj,
                "userslist": usermodel,
                'permission': 'success'
            })
            #self.render_template("user_new/apm-add-project.html")

        else:
            #self.response.write("you are not allowed")
            #self.render_template("apm-add-project.html",{'not_permitted':'You are not authorized to view this page'})
            self.render_template("user_new/apm-add-project.html")
コード例 #6
0
    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())