Esempio n. 1
0
 /**
  * put people on the waiting list
  *
  * @param array $answer_ids to put on waiting list
  */
 public function putOnWaitingList($register_ids)
 {
     /* Check if there are too many ppl going to the event */
     if (count($register_ids)) {
         foreach ($register_ids as $rid) {
             $attendee = new REattendee($rid);
             if (!$attendee->toggleWaitingListStatus(1)) {
                 $this->setError($attendee->getError());
                 return false;
             }
         }
     } else {
         return true;
         // event is full already
     }
     return true;
 }
Esempio n. 2
0
 function notifyManagers($submit_key, $unreg = false, $reg_id = 0)
 {
     /* Load database connection */
     $db = JFactory::getDBO();
     if ($reg_id) {
         $registrations = array($reg_id);
     } else {
         /* Get registration settings */
         $q = "SELECT r.id\n\t\t\t\tFROM #__redevent_register r\n\t\t\t\tWHERE submit_key = " . $db->Quote($submit_key);
         $db->setQuery($q);
         $registrations = $db->loadResultArray();
         if (!$registrations || !count($registrations)) {
             JError::raiseError(0, JText::sprintf('COM_REDEVENT_notification_registration_not_found_for_key_s', $submit_key));
             return false;
         }
     }
     foreach ($registrations as $rid) {
         $attendee = new REattendee($rid);
         if (!$attendee->notifyManagers($unreg)) {
             $this->setError($attendee->getError());
             return false;
         }
     }
     return true;
 }