Exemplo n.º 1
0
     // If current user is admin
     if ($GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->isAdmin($currentUserID)) {
         $customerID = $request->getParameter("customerID");
         $content->setVariable("CUSTOMER_SELECTION", $viewHelper->getCustomersSelection("courses-remove", $customerID));
     } else {
         if ($GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->isCustomerAdmin($currentUserID)) {
             $customerData = $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->getEmployeeCustomer($currentUserID);
             $customerID = $customerData["id"];
         }
     }
     $content->setVariable("VALUE_CUSTOMER_ID", $customerID);
     foreach ($GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->getAllCourseIDs() as $courseID) {
         $data = $GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->getCourseData($courseID);
         if ($data["customerID"] == $customerID && $customerID != "") {
             $content->setCurrentBlock("BLOCK_COURSES_ENTRY");
             $content->setVariable("COURSE_ENTRY", $viewHelper->getCourseRowRemove($courseID));
             $content->parse("BLOCK_COURSES_ENTRY");
         }
     }
     break;
 case "courses-activate":
     foreach ($GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->getAllCourseIDs() as $courseID) {
         $content->setCurrentBlock("BLOCK_COURSES_ENTRY");
         $content->setVariable("COURSE_ENTRY", $viewHelper->getCourseRow($courseID));
         $content->parse("BLOCK_COURSES_ENTRY");
     }
     $portal->add_javascript_code("usermanagement_index", $viewHelper->jsSetCommandValue());
     $portal->add_javascript_code("usermanagement_index", $viewHelper->jsConfirmAction("confirmDeactivation", "deactivateCourse", "formular", "Den Kurs fuer diesen Unternehmen wirklich loeschen?"));
     $usermanagementHTMLTemplate->set_context("courses");
     break;
     //		case "courses-quota" :