if (in_array('attendees', $available_actions) || in_array('cancellations', $available_actions) || in_array('waitlist', $available_actions)) { $available_actions[] = 'messageusers'; } //} $attendees = array(); $cancellations = array(); $requests = array(); // Check if the user is manager with staff if (($facetoface->approvalreqd && $staff = get_staff()) || ($facetoface->approvalreqd && is_siteadmin())) { // Lets check to see what state their staff are in // Check if any staff have requests awaiting approval $get_requests = facetoface_get_requests($session->id); if ($get_requests) { $requests = (is_siteadmin() ? $get_requests : array_intersect_key($get_requests, array_flip($staff))); if ($requests) { $allowed_actions[] = 'approvalrequired'; $available_actions[] = 'approvalrequired'; } } // Check if any staff are attending if ($session->datetimeknown) { $get_attendees = facetoface_get_attendees($session->id, array(MDL_F2F_STATUS_BOOKED, MDL_F2F_STATUS_NO_SHOW, MDL_F2F_STATUS_PARTIALLY_ATTENDED, MDL_F2F_STATUS_FULLY_ATTENDED)); } else { $get_attendees = facetoface_get_attendees($session->id, array(MDL_F2F_STATUS_WAITLISTED, MDL_F2F_STATUS_BOOKED, MDL_F2F_STATUS_NO_SHOW,
} } if (!$attendees) { $attendees = array(); } // Set takeattendance base on the attendes number $sessionstarted = facetoface_has_session_started($session, time()); $takeattendance = ($attendees && $session->datetimeknown && $sessionstarted) ? 1 : 0; // Get users waiting approval to add to the "already attending" list as we do not want to add them again $waitingapproval = facetoface_get_requests($session->id); // Set requireapproval $requireapproval = ($waitingapproval) ? 1 : 0; // If we are finished editing, save if ($save && $onlycontent) { if (empty($_SESSION['f2f-bulk-results'])) { $_SESSION['f2f-bulk-results'] = array(); } $added = array(); $errors = array(); // Original booked attendees plus those awaiting approval