Esempio n. 1
0
 protected function getPendingModuleUpdateStats(LiveCart $application)
 {
     $config = $application->getConfig();
     // modules needing update
     if (!$config->isValueSet('MODULE_STATS_UPDATED') || time() - $config->get('MODULE_STATS_UPDATED') > 3600) {
         $config->set('MODULE_STATS_UPDATED', time());
         $config->save();
         $controller = new ModuleController($this->application);
         $controller->initRepos();
         $updateResponse = $controller->index();
         $modules = $updateResponse->get('sortedModules');
         $config->set('MODULE_STATS_NEED_UPDATING', isset($modules['needUpdate']) ? count($modules['needUpdate']) : 0);
         $config->save();
         foreach ($this->getConfigFiles() as $file) {
             $this->loadLanguageFile($file);
         }
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->moduleModel = $this->labModel->getChildModel('announcements');
     $this->map = array_merge($this->map, ['title' => 'title', 'date' => 'date', 'detail' => 'detail']);
 }
 public function __construct()
 {
     parent::__construct();
     $this->moduleModel = $this->labModel->getChildModel('experiments');
     $this->map = array_merge($this->map, array('title' => 'title', 'principal' => 'principal', 'contact' => 'contact', 'date' => 'date', 'scope' => 'scope', 'brief' => 'brief', 'detail' => 'detail'));
 }
 public function __construct()
 {
     parent::__construct();
     $this->moduleModel = $this->labModel->getChildModel('recruits');
     $this->map = array_merge($this->map, array('type' => 'type', 'number' => 'number', 'researchArea' => 'researchArea', 'deadline' => 'deadline', 'brief' => 'brief', 'detail' => 'detail'));
 }
 public function __construct()
 {
     parent::__construct();
     $this->moduleModel = $this->labModel->getChildModel('rules');
     $this->map = array_merge($this->map, array('title' => 'title', 'date' => 'date', 'detail' => 'detail'));
 }
 public function __construct()
 {
     parent::__construct();
     $this->moduleModel = $this->labModel->getChildModel('projects');
     $this->map = array_merge($this->map, array('name' => 'name', 'origin' => 'origin', 'participants' => 'participants', 'during' => 'during', 'state' => 'state', 'comment' => 'comment'));
 }
 public function viewApplicationAction($id)
 {
     //Get his info
     $em = $this->getDoctrine()->getManager();
     $application = $em->getRepository('MaximModuleApplicationBundle:UserApplication')->findOneBy(array("id" => $id));
     if ($application) {
         $data['application'] = $application;
         $dateofbirth = $application->getUser()->getDateOfBirth();
         $data['age'] = ModuleController::calcAge($dateofbirth);
         //Get this user his minecraft accounts
         // $repository = $em->getRepository('MaximCMSBundle:Useraccounts');
         // $accounts	= $repository->findBy(array("id" => $application->getUser()->getId()));
         //$data['accounts'] = $accounts;
         $data['replies'] = $em->getRepository('MaximModuleApplicationBundle:ApplicationReply')->findBy(array("application" => $data['application']));
         return $this->render("MaximModuleApplicationBundle:Admin:view.html.twig", $data);
     } else {
         throw $this->createNotFoundException("We were unable to find the application with id: " . $id);
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->moduleModel = $this->labModel->getChildModel('equipments');
     $this->map = array_merge($this->map, array('name' => 'name', 'brand' => 'brand', 'model' => 'model', 'principal' => 'principal', 'contact' => 'contact', 'scope' => 'scope', 'picture' => 'picture', 'intro' => 'intro'));
 }
 public function deleteModule()
 {
     if (isset($_GET['idModule'])) {
         $infosUser = new UserDAO();
         $infos = $infosUser->getInfoUser($_SESSION['idUser']);
         if ($infos['type'] == 'Admin') {
             $moduleController = new ModuleController();
             $moduleController->deleteModule($_GET['idModule']);
             $_SESSION['success'] = 'Le module a bien été supprimé';
             $_SESSION['display_msg_success'] = true;
             $this->profile();
         } else {
             $_SESSION['error'] = 'Vous n\'avez pas les droits requis pour accéder à cette page';
             $_SESSION['display_msg_error'] = true;
             $this->profile();
         }
     } else {
         $_SESSION['error'] = '[7] La page n\'existe pas';
         $_SESSION['display_msg_error'] = true;
         $this->profile();
     }
 }