Esempio n. 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
Esempio n. 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)
Esempio n. 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()
Esempio n. 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()
Esempio n. 5
0
 def date(self):
     return ForemanOptions.get_date(self.date_time)
Esempio n. 6
0
 def date_created(self):
     return ForemanOptions.get_date(self.creation_date)
Esempio n. 7
0
 def deleted_date(self):
     return ForemanOptions.get_date(self.date_deleted)
Esempio n. 8
0
 def date(self):
     return ForemanOptions.get_date(self.date_added)
Esempio n. 9
0
 def custody_date(self):
     return ForemanOptions.get_date(self.date_of_custody)
Esempio n. 10
0
 def date_created(self):
     return ForemanOptions.get_date(self.creation_date)
Esempio n. 11
0
 def date(self):
     return ForemanOptions.get_date(self.date_time)
Esempio n. 12
0
 def deleted_date(self):
     return ForemanOptions.get_date(self.date_deleted)
Esempio n. 13
0
 def date(self):
     return ForemanOptions.get_date(self.date_added)
Esempio n. 14
0
 def custody_date(self):
     return ForemanOptions.get_date(self.date_of_custody)