Ejemplo n.º 1
0
 /** @return Tracker_Artifact */
 private function createArtifact(PFUser $user, Tracker $tracker, $title, $body)
 {
     $this->logger->debug("Receiving new artifact from " . $user->getUserName());
     if (!$tracker->userCanSubmitArtifact($user)) {
         $this->logger->info("User " . $user->getUnixName() . " has no right to create an artifact in tracker #" . $tracker->getId());
         $this->notifier->sendErrorMailInsufficientPermissionCreation($user->getEmail(), $title);
         return;
     }
     $title_field = $tracker->getTitleField();
     $description_field = $tracker->getDescriptionField();
     if (!$title_field || !$description_field) {
         throw new Tracker_Artifact_MailGateway_TrackerMissingSemanticException();
     }
     $field_data = array($title_field->getId() => $title, $description_field->getId() => $body);
     UserManager::instance()->setCurrentUser($user);
     return $this->artifact_factory->createArtifact($tracker, $field_data, $user, '');
 }
Ejemplo n.º 2
0
 private function logNoSufficientRightsToCreateChangeset(Tracker_Artifact_MailGateway_IncomingMessage $incoming_message, $raw_mail_parsed)
 {
     $this->logger->info('An artifact for the tracker #' . $incoming_message->getTracker()->getId() . ' has been received but this tracker does not allow create/reply by mail or' . ' his configuration is not compatible with this feature');
     $this->notifier->sendErrorMailTrackerGeneric($raw_mail_parsed);
 }