Ejemplo n.º 1
0
    def breakLinks(self,empID):
        #break external links, but don't change existing emp file for archive purposes
        tempEmp=employee(empID)        
        tempEmp.inFile()        


        #remove each project and all superiors/subordinates        
        for projID,projHier in tempEmp.retProjList():
            for sub in projHier.retSub():
                tempEmp=employee(sub)
                tempEmp.inFile()
                tempEmp.remProjSup(projID,empID,0)#remove sup from sub, no push
            for sup in projHier.retSup():
                tempEmp=employee(sup)
                tempEmp.inFile()
                tempEmp.remProjSub(projID,empID,0)#remove sup from sub, no push
            #remove emp from Proj
            from ProjClass import project
            tempProj = project(projID,"")
            tempProj.inFile()
            tempProj.remEmp(empID)

        for skID,skLvl in tempEmp.retSkillList():
            tempSk=ability(skID,"temp","Skill")
            tempSk.inFile()
            tempSk.remEmp(empID)

        for intID,intLvl in tempEmp.retIntList():
            tempInt=ability(intID,"temp","Int")
            tempInt.inFile()
            tempInt.remEmp(empID)       
        
        return 1
Ejemplo n.º 2
0
    def breakLinks(self, empID):
        #break external links, but don't change existing emp file for archive purposes
        tempEmp = employee(empID)
        tempEmp.inFile()

        #remove each project and all superiors/subordinates
        for projID, projHier in tempEmp.retProjList():
            for sub in projHier.retSub():
                tempEmp = employee(sub)
                tempEmp.inFile()
                tempEmp.remProjSup(projID, empID,
                                   0)  #remove sup from sub, no push
            for sup in projHier.retSup():
                tempEmp = employee(sup)
                tempEmp.inFile()
                tempEmp.remProjSub(projID, empID,
                                   0)  #remove sup from sub, no push
            #remove emp from Proj
            from ProjClass import project
            tempProj = project(projID, "")
            tempProj.inFile()
            tempProj.remEmp(empID)

        for skID, skLvl in tempEmp.retSkillList():
            tempSk = ability(skID, "temp", "Skill")
            tempSk.inFile()
            tempSk.remEmp(empID)

        for intID, intLvl in tempEmp.retIntList():
            tempInt = ability(intID, "temp", "Int")
            tempInt.inFile()
            tempInt.remEmp(empID)

        return 1
Ejemplo n.º 3
0
 def addProj(self, name):
     self.inFile()
     self.lastID += 1
     self.projList[self.lastID] = name
     self.outFile()
     from ProjClass import project
     newProj = project(self.lastID, name)
     newProj.outFile()
     return self.lastID
Ejemplo n.º 4
0
 def addProj(self,name):
     self.inFile()
     self.lastID += 1
     self.projList[self.lastID]=name   
     self.outFile()
     from ProjClass import project
     newProj = project(self.lastID,name)
     newProj.outFile()        
     return self.lastID
Ejemplo n.º 5
0
    def breakLinks(self, projID):
        #break external links, but don't change existing proj file for archive purposes
        tempProj = project(projID)
        tempProj.inFile()

        #remove each project and all superiors/subordinates
        for empID in tempProj.retList():
            tempEmp = employee(empID)
            tempEmp.remProjArch(projID)

        return 1
Ejemplo n.º 6
0
    def breakLinks(self,projID):
        #break external links, but don't change existing proj file for archive purposes
        tempProj=project(projID)        
        tempProj.inFile()        

        #remove each project and all superiors/subordinates        
        for empID in tempProj.retList():
            tempEmp=employee(empID)
            tempEmp.remProjArch(projID)
        
        return 1
Ejemplo n.º 7
0
 def addProjOrRole(self,projID,role=""):
     self.inFile()        
     chg=0
     if not self.proj.has_key(projID): #if they aren't on project, add them
         tempHier = hier(projID)
         self.proj[projID]=tempHier
         chg=1
         #Add emp to Proj
         from ProjClass import project
         tempProj = project(projID,"")
         tempProj.inFile()
         tempProj.addEmp(self.id)
     if not role == "":
         self.proj[projID].role = role
         chg=1
     if chg==1:
         self.outFile()           
Ejemplo n.º 8
0
 def addProjOrRole(self, projID, role=""):
     self.inFile()
     chg = 0
     if not self.proj.has_key(projID):  #if they aren't on project, add them
         tempHier = hier(projID)
         self.proj[projID] = tempHier
         chg = 1
         #Add emp to Proj
         from ProjClass import project
         tempProj = project(projID, "")
         tempProj.inFile()
         tempProj.addEmp(self.id)
     if not role == "":
         self.proj[projID].role = role
         chg = 1
     if chg == 1:
         self.outFile()
Ejemplo n.º 9
0
 def remProj(self,projID):
     self.inFile()
     if self.proj.has_key(projID):
         tempHier=self.proj.pop(projID)
         self.outFile()
         for sub in tempHier.retSub():
             tempEmp=employee(sub)
             tempEmp.inFile()
             tempEmp.remProjSup(projID,self.id,0)#remove sup from sub, no push
         for sup in tempHier.retSup():
             tempEmp=employee(sup)
             tempEmp.inFile()
             tempEmp.remProjSub(projID,self.id,0)#remove sup from sub, no push
         #remove emp from Proj
         from ProjClass import project
         tempProj = project(projID,"")
         tempProj.inFile()
         tempProj.remEmp(self.id)
Ejemplo n.º 10
0
 def remProj(self, projID):
     self.inFile()
     if self.proj.has_key(projID):
         tempHier = self.proj.pop(projID)
         self.outFile()
         for sub in tempHier.retSub():
             tempEmp = employee(sub)
             tempEmp.inFile()
             tempEmp.remProjSup(projID, self.id,
                                0)  #remove sup from sub, no push
         for sup in tempHier.retSup():
             tempEmp = employee(sup)
             tempEmp.inFile()
             tempEmp.remProjSub(projID, self.id,
                                0)  #remove sup from sub, no push
         #remove emp from Proj
         from ProjClass import project
         tempProj = project(projID, "")
         tempProj.inFile()
         tempProj.remEmp(self.id)