Esempio n. 1
0
 public function getCrewsOfGroups(array $groups)
 {
     global $sessioninfo;
     $eventID = $sessioninfo->eventID;
     $crewsOfEvent = \Wannabe\Manager::getInstance()->getCrews(array($eventID));
     $crews = array();
     if (count($crewsOfEvent) < 1) {
         return $crews;
     }
     foreach ($crewsOfEvent as $crew) {
         foreach ($groups as $group) {
             if ($crew->getGroupID() == $group->getGroupID()) {
                 $crews[] = $crew;
             }
         }
     }
     return $crews;
 }
Esempio n. 2
0
<?php

$eventID = $sessioninfo->eventID;
$action = $_GET['action'];
$acl_access = acl_access("wannabeadmin", "", $eventID);
if ($acl_access == 'No') {
    die("You don't have access to this");
}
$wannabeManager = \Wannabe\Manager::getInstance();
$onlineUserID = $sessioninfo->userID;
switch ($action) {
    // -------------------------------- [LIST QUESTIONS] -------------------------------- //
    case "questions":
        if ($acl_access != "Admin") {
            die("You do not have sufficient privileges.");
        }
        $questions = $wannabeManager->getQuestions(array($eventID));
        $content .= "<h1 class=\"page-title\">" . _("Edit wannabe questions") . "</h1>";
        $content .= "<div class=\"action-toolbar\">\n            <div class=\"action\"><a href=\"?module={$module}&amp;action=questions\">" . _("List questions") . "</a></div>\n            <div class=\"action\"><a href=\"?module={$module}&amp;action=editQuestion&amp;questionID=-1\">" . _("New question") . "</a></div>\n        </div>";
        // List questions.
        if (count($questions) > 0) {
            $content .= "<div class=\"table\">\n                <div class=\"row table-header\">\n                    <div class=\"cell\">" . _("Question") . "</div>\n                    <div class=\"cell\">" . _("Actions") . "</div>\n                </div>";
            foreach ($questions as $question) {
                $content .= "<div class=\"row\">\n                    <div class=\"cell\">" . $question->getQuestionData() . "</div>\n                    <div class=\"cell\">\n                        <a href=\"?module={$module}&amp;action=editQuestion&amp;questionID=" . $question->getQuestionID() . "\">" . _("Edit") . "</a>\n                        <a href=\"?module={$module}&amp;action=editQuestion&amp;questionID=" . $question->getQuestionID() . "&amp;delete=true\">" . _("Delete") . "</a>\n                    </div>\n                </div>";
            }
            $content .= "</div>";
        } else {
            $content .= "<div>" . _("No questions has been created yet.") . "</div>";
        }
        break;
        // -------------------------------- [EDIT/NEW QUESTION] -------------------------------- //