Example #1
0
 public static boolean getGrantAccess() {
   final User user = Authenticate.getUser();
   if (user != null) {
     final int year = Year.now().getValue();
     final CgdCard card = findCardFor(user, year, false);
     return card != null && card.getAllowSendDetails();
   }
   return false;
 }
Example #2
0
 @Atomic
 public static CgdCard setGrantAccess(final boolean allowAccess) {
   final User user = Authenticate.getUser();
   if (user != null) {
     final int year = Year.now().getValue();
     final CgdCard card = findCardFor(user, year, allowAccess);
     if (card != null) {
       card.setAllowSendDetails(allowAccess);
       if (allowAccess) {
         return card;
       }
     }
   }
   return null;
 }
Example #3
0
 @Atomic
 private void doit() {
   final CgdCard card = FenixFramework.getDomainObject(cardId);
   final Person person = card.getUser().getPerson();
   if (person != null) {
     final Student student = person.getStudent();
     if (student != null) {
       for (final Registration registration : student.getRegistrationsSet()) {
         if (registration.isActive()) {
           new CgdForm43Sender().sendForm43For(registration);
         }
       }
     }
   }
 }