예제 #1
0
 def all_reports(self, override=False):
     if not ForemanOptions.get_options().manager_inherit and not override:
         return self.direct_reports
     else:
         reports = []
         for direct_report in self.direct_reports:
             reports.append(direct_report)
             reports.extend(direct_report.all_reports())
         return reports
예제 #2
0
    def is_manager_of(self, user):
        man = user.manager
        if man is None:
            return False

        if man.id == self.id:
            return True

        if not ForemanOptions.get_options().manager_inherit:
            return False
        else:
            return self.is_manager_of(man)
예제 #3
0
 def __init__(self, case_name, user, background=None, reference=None, private=False, location=None,
              classification=None, case_type=None, justification=None):
     self.case_name = case_name
     self.reference = reference
     self.set_status(CaseStatus.CREATED, user)
     self.private = private
     self.background = background
     self.classification = classification
     self.case_type = case_type
     self.justification = justification
     if location is None:
         self.location = ForemanOptions.get_default_location()
     else:
         self.location = location
     self.creation_date = datetime.now()
예제 #4
0
 def __init__(self,
              case_name,
              user,
              background=None,
              reference=None,
              private=False,
              location=None,
              classification=None,
              case_type=None,
              justification=None):
     self.case_name = case_name
     self.reference = reference
     self.set_status(CaseStatus.CREATED, user)
     self.private = private
     self.background = background
     self.classification = classification
     self.case_type = case_type
     self.justification = justification
     if location is None:
         self.location = ForemanOptions.get_default_location()
     else:
         self.location = location
     self.creation_date = datetime.now()
예제 #5
0
 def date(self):
     return ForemanOptions.get_date(self.date_time)
예제 #6
0
 def date_created(self):
     return ForemanOptions.get_date(self.creation_date)
예제 #7
0
 def deleted_date(self):
     return ForemanOptions.get_date(self.date_deleted)
예제 #8
0
 def date(self):
     return ForemanOptions.get_date(self.date_added)
예제 #9
0
 def custody_date(self):
     return ForemanOptions.get_date(self.date_of_custody)
예제 #10
0
 def date_created(self):
     return ForemanOptions.get_date(self.creation_date)
예제 #11
0
 def date(self):
     return ForemanOptions.get_date(self.date_time)
예제 #12
0
 def deleted_date(self):
     return ForemanOptions.get_date(self.date_deleted)
예제 #13
0
 def date(self):
     return ForemanOptions.get_date(self.date_added)
예제 #14
0
 def custody_date(self):
     return ForemanOptions.get_date(self.date_of_custody)